Status Update
Comments
se...@google.com <se...@google.com>
si...@google.com <si...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
Author: Louis Pullen-Freilich <
Link:
Adds OverscrollEffect#withoutDrawing and OverscrollEffect#withoutEventHandling
Expand for full commit details
Adds OverscrollEffect#withoutDrawing and OverscrollEffect#withoutEventHandling
These APIs allow overscroll to have events dispatched to it by one component, and rendered in a separate component.
Fixes: b/266550551
Fixes: b/204650733
Fixes: b/255554340
Fixes: b/229537244
Test: OverscrollTest
Relnote: "Adds OverscrollEffect#withoutDrawing and OverscrollEffect#withoutEventHandling APIs - these APIs create a wrapped instance of the provided overscroll effect that doesn't draw / handle events respectively, which allows for rendering overscroll in a separate component from the component that is dispatching events. For example, disabling drawing the overscroll inside a lazy list, and then drawing the overscroll separately on top / elsewhere."
Change-Id: Idbb3d91546b49c1987a041f959bce4b2b09a9f61
Files:
- M
compose/foundation/foundation/api/current.txt
- M
compose/foundation/foundation/api/restricted_current.txt
- M
compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/OverscrollDemo.kt
- M
compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/OverscrollSample.kt
- M
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/OverscrollTest.kt
- M
compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Overscroll.kt
Hash: f64e25b7a473c757d080521e7dd97b3f6670f60d
Date: Fri Nov 01 18:43:56 2024
so...@google.com <so...@google.com> #3
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.8.0-alpha06
androidx.compose.foundation:foundation-android:1.8.0-alpha06
androidx.compose.foundation:foundation-jvmstubs:1.8.0-alpha06
androidx.compose.foundation:foundation-linuxx64stubs:1.8.0-alpha06
si...@google.com <si...@google.com> #4
I'm wondering how it will behave if you have a textfield taking up the whole screen (like Notes app). Will it scroll anyway?
It would depend on scrolling implementation we will implement (as far as I know we still didn't). I don't see a reason why it wouldn't scroll to the correct place (if the label does not take too much space).
One issue is showing the cursor. If we send the whole box, and if the TextField is too long (lets say 100 lines), then sending the whole box means that the cursor might not show up.
Maybe it is something we should take into account while implementing i.e. sending 2 rectangles:
- 1 for the box
- 1 for the cursor
- we try to show the box as a whole but we also try to make sure the cursor rectangle is visible (which means if the Textfield is 2 pages long, and the cursor is at the end, we lean towards the bottom half of the box; or if the cursor is at the begining we lean towards the top half of the box.
- this might be an edge case that we can check later as well.
I couldn't know the exact/correct answer right now :/
si...@google.com <si...@google.com> #5
might be a P3 as well. I wanted to remove P4 since this is in our current list of tasks to do.
ni...@google.com <ni...@google.com> #6
Bulk edit: This bug is currently marked as blocking Compose 1.0. Once rc01 is cut, all changes will need to go through our cherry-pick process.
If you intend to fix it in Compose 1.0, no action is needed except prioritizing finishing this work.
Otherwise, please remove this bug from the appropriate 1.0 hotlist (likely
Thanks!
so...@google.com <so...@google.com> #7
Played a bit with one of the ideas: if the line being edited is not the last one, leave current behavior (i.e. show the cursor); otherwise use the decoration box bounds. In that case single line text field will always display padding/decoration box. In multi-line text field (Notes like app for example) we won't show the decoration box if not the last line is being edited.
Alternatively, I want to consider another option where we show the cursor and a bit more. I'll add more details when I played more with the idea.
We might need a UX input here.
Another point is that we need to make sure we request rectangle after editing, as currently we only do this on initial focus. As a result, when user types, the cursor becomes hidden behind the keyboard anyway.
so...@google.com <so...@google.com> #8
Zach, this one is fixed, isn't it? Probably can be marked as duplicate
kl...@google.com <kl...@google.com> #9
This isn't working yet because of bringIntoView
call it works as expected.
ap...@google.com <ap...@google.com> #10
Branch: androidx-main
commit 04501ae82a6f8349c5a4037080bb2b93c7fddefe
Author: Zach Klippenstein <klippenstein@google.com>
Date: Fri Apr 15 15:26:57 2022
Ignore bringIntoView requests that are already satisfied by an in-progress request.
If a new bringIntoView call happens before the previous one is finished,
then if the new one requests a rectangle that will already be in
view after the old request is satisfied, the new request is ignored.
Bug:
Fixes:
Test: New tests for BringIntoViewResponder and text field.
Test: ./gradlew :compose:f:f:cDAT
Relnote: "Concurrent `BringIntoViewRequester.bringIntoView` calls for
rectangles that are completely overlapping will now only honor the
larger rectangle's request."
Change-Id: I34be70f23527e4fea694fd5266bbc127cc1d1b0b
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldFocusTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/relocation/BringIntoViewRequester.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/TextFieldsInScrollableDemo.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/relocation/BringIntoViewResponderTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/relocation/BringIntoViewResponder.kt
Description
If the software keyboard comes into view, decorationBox of BasicTextField gets ignored. The keyboard appears --> the content scrolls up, but only until the TextFields input area. It does not observe the extra padding provided by the decorationBox.