Status Update
Comments
se...@google.com <se...@google.com>
sg...@google.com <sg...@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
sa...@gmail.com <sa...@gmail.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
sg...@google.com <sg...@google.com> #4
As there is a bit more involved code that deals with the height of the app-bar and the scroll-behavior, each app-bar has dedicated params to control the heights and it's not done through a Modifier
.
See for example the
collapsedHeight: Dp = TopAppBarDefaults.LargeAppBarCollapsedHeight,
expandedHeight: Dp = TopAppBarDefaults.LargeAppBarExpandedHeight,
bo...@gmail.com <bo...@gmail.com> #5
Sorry for some ignorance here: The Status of this issue is "Fixed", but there's no indication of what release it is in, or is targeting. In fact, "Public Project Status" is "Not started". What does this all mean? Is this code released?
sg...@google.com <sg...@google.com> #6
I believe this will be released with 1.4.0-alpha01
, which should be available shortly.
Description
Jetpack Compose component used: TopAppBar
The Material3 spec says the TopAppBar height must always be 64dp and this is enforced in the library, but sometimes it's just too big, and one good example of this is in landscape mode where vertical space is at at a premium.
Factoring in the system bars, 64dp is around 20% of the available vertical space in landscape mode on typical phones. There's even less space if an app uses a bottom navigation bar. The Play Store app is a good example that even first party apps are affected by this. In landscape mode, there is only space for a single row of app icons when browsing apps on the Play Store.
There is currently no standard pattern to add anything more to the TopAppBar in Landscape mode than a navigation icon, title and action icon buttons which are there in portrait. This means that the extra horizontal space in landscape mode ends up unused.
It would be great if we could have some more control over the TopAppBar height, to make it smaller than 64.dp. Due to the minimum touch target size of 48dp, I've used a 48dp height TopAppBar in my app which I'm quite happy with.
In portrait mode too, having a 56dp height TopAppBar allows for a slightly more compact layout on devices with smaller screens.
Thanks!