Fixed
Status Update
Comments
si...@google.com <si...@google.com>
qq...@google.com <qq...@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
si...@google.com <si...@google.com>
se...@google.com <se...@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
se...@google.com <se...@google.com> #4
One big change is that clearing selection is not done by back in the Compose implementation.
Exploring how to implement this in compose:foundation without adding activity-compose.
Exploring how to implement this in compose:foundation without adding activity-compose.
se...@google.com <se...@google.com> #7
Comment has been deleted.
se...@google.com <se...@google.com> #8
Thanks for the report, super helpful!
A patch is coming for CoreTextField shortly, investigating the selection behavior for Text as well.
se...@google.com <se...@google.com> #9
Checking TextView, it looks like the non-editable selection doesn't need cleared on back. Thanks for report!
ap...@google.com <ap...@google.com> #10
Project: platform/frameworks/support
Branch: androidx-main
commit de1034714344ecdfc22f94a1244ab076cbc066b1
Author: Sean McQuillan <seanmcq@google.com>
Date: Tue Jul 13 17:12:50 2021
When text is selected in compose, back deselects
Matches Android platfrom behavior of intercepting back key up to dismiss
selection popups and deselect text.
Bug: b/174173645
Test: new unit tests
Relnote: "TextField now clears selection when back button is pressed,
which matches Android EditText behavior."
Change-Id: I3ca164d09ee6d82f292aacfd2df0af05643cb1aa
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/restricted_current.txt
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/CoreTextFieldSelectionOnBackTest.kt
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/KeyEventHelpersTest.kt
A compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/text/KeyEventHelpers.android.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
A compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/KeyEventHelpers.kt
A compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/text/KeyEventHelpers.desktop.kt
https://android-review.googlesource.com/1765368
Branch: androidx-main
commit de1034714344ecdfc22f94a1244ab076cbc066b1
Author: Sean McQuillan <seanmcq@google.com>
Date: Tue Jul 13 17:12:50 2021
When text is selected in compose, back deselects
Matches Android platfrom behavior of intercepting back key up to dismiss
selection popups and deselect text.
Bug:
Test: new unit tests
Relnote: "TextField now clears selection when back button is pressed,
which matches Android EditText behavior."
Change-Id: I3ca164d09ee6d82f292aacfd2df0af05643cb1aa
M compose/foundation/foundation/api/current.txt
M compose/foundation/foundation/api/public_plus_experimental_current.txt
M compose/foundation/foundation/api/restricted_current.txt
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/CoreTextFieldSelectionOnBackTest.kt
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/KeyEventHelpersTest.kt
A compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/text/KeyEventHelpers.android.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
A compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/KeyEventHelpers.kt
A compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/text/KeyEventHelpers.desktop.kt
Description
With traditional views, if you have the keyboard open with text selection handle bars being shown, the following happens when you press the back button:
Ideally, Compose would follow this same behavior automatically as well, if possible.
I attached two videos to the report. One shows the (ideal/correct) behavior with traditional views. The second shows the (current/incorrect) behavior with Compose as of today (1.0.0-alpha08 snapshot).