Status Update
Comments
va...@google.com <va...@google.com>
st...@google.com <st...@google.com>
ap...@google.com <ap...@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
ap...@google.com <ap...@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
st...@google.com <st...@google.com>
ys...@google.com <ys...@google.com> #4
Heads up - I ended up using repeatOnLifecycle(state = Lifecycle.State.STARTED)
in some code because repeatOnLifecycle(state = Lifecycle.State.RESUMED)
wasn't firing, and Alex mentioned this one.
Will provide a repro offline.
ys...@google.com <ys...@google.com> #5
Shared the repro offline. Steve, do you want me to open a diff bug?
st...@google.com <st...@google.com> #7
When swiping to dismiss, we trigger an animation and call popWithTransition so that the lifecycle does reached Resumed until the animation has completed (when onTransitionComplete gets called) - see WearNavigator::popBackStack.
The problem is that, if we call navController.popBackStack directly, that is also calling WearNavigator.popBackStack, which in turn calls popWithTransition - but there's no corresponding animation, so onTransitionComplete is not called and the lifecycle never reaches Resumed. Conversely, we should not call pop (without transition) for the case where animation is running, because the lifecycle would become Resumed too early.
ap...@google.com <ap...@google.com> #8
Branch: androidx-main
commit 4c67987dbc870d8e35d811af15ae3edb36f1c836
Author: stevebower <stevebower@google.com>
Date: Mon Mar 28 14:54:44 2022
Destinations do not reach Lifecycle RESUMED after popping the navigation back stack
Test: androidx.wear.compose.navigation
Bug: 202863359
Change-Id: Iff21b4603fd126120241661e066dfaf294d9c25c
M wear/compose/compose-navigation/src/androidTest/kotlin/androidx/wear/compose/navigation/SwipeDismissableNavHostTest.kt
M wear/compose/compose-navigation/src/main/java/androidx/wear/compose/navigation/SwipeDismissableNavHost.kt
Description
Component used: androidx.wear.compose:compose-navigation
Version used: 1.0.0-alpha07
When using
SwipeDismissableNavHost
to navigate, destinations are never reaching theRESUMED
lifecycle state, and are always being capped atSTARTED
.It looks like navigation is occurring with
pushWithTransition
andpopWithTransition
, but there is no corresponding call tomarkTransitionCompleted
to allow the state to reachRESUMED
.Can be reproduced withhttps://github.com/android/wear-os-samples/tree/main/ComposeAdvanced