Status Update
Comments
kl...@google.com <kl...@google.com>
kl...@google.com <kl...@google.com> #2
just query LocalView instead of setting this metadata at the ComposeView layer to unblock the most common cases.
As we can't know when / if the ComposeView
is moved to a different part of the View
hierarchy, we don't have a good callback / place to update this value within ComposeView
- theoretically since shouldDelayChildPressedState
is a function, it could return different values at different points in time in any case. So we should instead continue to query the view hierarchy during a press, to see if at that point in time we should delay the press or not.
So instead we just need to provide whether there is a scrollable Compose node, and then consumers can combine querying that with whether there is a scrollable ViewGroup
, to work out whether they should delay presses or not. AndroidView
can solely query whether it is in a scrollable Compose node, as anything inside it will look up the view hierarchy anyway
is...@google.com <is...@google.com>
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #3
Branch: androidx-main
commit b9c029ef8bc7d6abe73b72bc4fb00e02da90b366
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Oct 18 23:43:49 2021
Delays PressInteractions if the Compose view is inside a scrolling ViewGroup
Updates ComposeView and other ViewGroups to correctly set shouldDelayChildPressedState to false
Bug:
Test: ClickableInScrollableViewGroupTest.kt
Change-Id: Ib7e000139d2bf39c9453fde38efbe2d84a6eac9a
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/selection/Toggleable.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
M compose/foundation/foundation/src/desktopMain/kotlin/androidx/compose/foundation/Clickable.desktop.kt
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ClickableInScrollableViewGroupTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidViewsHandler.android.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ClickableTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/ComposeView.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/viewinterop/AndroidViewHolder.android.kt
M compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/Clickable.android.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Clickable.kt
pr...@google.com <pr...@google.com> #4
Branch: androidx-main
commit 262448965ac6cc81652e47e0a1534ae14ff7014e
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Oct 18 17:18:06 2021
No longer delays PressInteractions within Modifier.scrollable()
As a result ripples in non-scrollable containers will now instantly start to ripple on a down event, instead of waiting for a delay.
Bug:
Test: tests
Relnote: "Ripples and other indications will now only be delayed if they are inside a Modifier.scrollable() container, instead of always being delayed for a down event."
Change-Id: Ibefe01bcdef89e01b6e9f7edf9fe13622450f487
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/selection/Toggleable.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CardTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ClickableTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ToggleableTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonScreenshotTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/IndicationTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwitchScreenshotTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SurfaceTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/RadioButtonScreenshotTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/CheckboxScreenshotTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/SelectableTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/FloatingActionButtonScreenshotTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/Scrollable.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Clickable.kt
Description
The following Experimental APIs have existed for several releases.
Please consider stabilising or removing these APIs: