Status Update
Comments
mo...@google.com <mo...@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
va...@google.com <va...@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
mo...@google.com <mo...@google.com> #4
I'm going to wait on shared element transitions work to be done before exploring the animation APIs. I think we're going to want to treat the animations completely differently.
I can add an isVisible
function. I can see that as being convenient.
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit 9ad715087ea11e0d321c1da32cc2a62e8003a161
Author: George Mount <mount@google.com>
Date: Mon Mar 21 10:15:11 2022
Add window insets visibility
Bug: 217770337
Relnote: "WindowInsets companion now exposes the visibility
(whether they are on the screen, regardless of
whether thy intersect with the window), and the
size they could be if they are available on the device,
but not currently active."
Test: new tests for R+
Change-Id: I65182e3c8cdc868b9f6de3aef403c9f4d5074711
A compose/foundation/foundation-layout/src/androidAndroidTest/kotlin/androidx/compose/foundation/layout/WindowInsetsIgnoringVisibilityTest.kt
M compose/foundation/foundation-layout/api/public_plus_experimental_current.txt
M compose/foundation/foundation-layout/src/androidMain/kotlin/androidx/compose/foundation/layout/WindowInsets.android.kt
lu...@gmail.com <lu...@gmail.com> #6
Is there any temporary solution for a isVisible
function? Or should I wait for the issue to be fixed before I migrate Insets Accompanist to the Compose foundation insets?
va...@google.com <va...@google.com> #7
The isVisible
portion has been merged but didn't make it into 1.2.0-alpha07
that was just released.
If you'd like, you should be able to use isVisible
with one of the most recent androidx snapshots until it is released normally.
re...@gmail.com <re...@gmail.com> #8
In terms of temporary workaround, try this code:
val WindowInsets.Companion.isImeVisible: Boolean
@Composable
get() {
val density = LocalDensity.current
val ime = this.ime
return remember {
derivedStateOf {
ime.getBottom(density) > 0
}
}.value
}
Source:
ry...@educast.com <ry...@educast.com> #9
mo...@google.com <mo...@google.com> #10
LookaheadLayout
is now available, but isn't complete. SubcomposeLayout
implementations for BoxWithConstraints
and LazyColumn
/LazyRow
are yet to be done.
When those complete, I expect to make the look-ahead work with WindowInsets. You'll be able to see the target position of the IME, for example, and then customize your animation for it.
da...@gmail.com <da...@gmail.com> #11
Nice, thanks for the update. Where can we see the work in progress?
Please keep us updated!!
Nice work!
mo...@google.com <mo...@google.com> #12
Alex suggested a different solution that will work well. I can provide the source and target IME WindowInsets and you can use it to determine where the IME will be and the progress (combined with the current IME insets).
mo...@google.com <mo...@google.com>
ap...@google.com <ap...@google.com> #14
Branch: androidx-main
commit 977d53a595ad75ee1693140c84c052cc60bce305
Author: George Mount <mount@google.com>
Date: Fri Aug 26 14:58:13 2022
Added WindowInsets IME animation source and target
Fixes: 217770337
Relnote: "Added WindowInsets.imeAnimationSource and
WindowInsets.imeAnimationTarget to determine the
animation progress and know where the IME will be
after animation completes."
Test: new tests, manual
Change-Id: I356f1bac4ac4ff311573eb8df7227098b9186c20
M compose/foundation/foundation-layout/src/androidAndroidTest/kotlin/androidx/compose/foundation/layout/WindowInsetsActivity.kt
M compose/foundation/foundation-layout/src/androidAndroidTest/AndroidManifest.xml
A compose/foundation/foundation-layout/src/androidAndroidTest/kotlin/androidx/compose/foundation/layout/WindowInsetsAnimationTest.kt
M compose/foundation/foundation-layout/api/public_plus_experimental_current.txt
M compose/foundation/foundation-layout/src/androidMain/kotlin/androidx/compose/foundation/layout/WindowInsets.android.kt
na...@google.com <na...@google.com> #15
The following release(s) address this bug:
androidx.compose.foundation:foundation-layout:1.4.0-alpha01
Description
accompanist/insets provides a few additional pieces of information about each type of insets, other than just the current size.
These include:
isVisible
- if a type of insets are currently visible (especially useful for IME)animationInProgress
- whether that type of insets are currently being animatedanimationFraction
- the current fraction of animation (useful for running with another animation)layoutInsets
/animatedInsets
- contains the last normally applied insets, and the currently animated insets, respectively. (useful for informing external animations)