Fixed
Status Update
Comments
ke...@google.com <ke...@google.com>
ma...@google.com <ma...@google.com>
ap...@google.com <ap...@google.com> #2
Lines for reference in ModalBottomSheet.android.kt
causing this behavior:
val newTarget = when (sheetState.anchoredDraggableState.targetValue) {
Hidden -> Hidden
PartiallyExpanded, Expanded -> {
val hasPartiallyExpandedState = newAnchors
.hasAnchorFor(PartiallyExpanded)
val newTarget = if (hasPartiallyExpandedState) PartiallyExpanded
else if (newAnchors.hasAnchorFor(Expanded)) Expanded else Hidden
newTarget
}
}
ma...@google.com <ma...@google.com> #3
My proposed solution would be:
val targetValue = sheetState.anchoredDraggableState.targetValue
val newTarget = when (targetValue) {
Hidden -> Hidden
PartiallyExpanded, Expanded -> {
when {
newAnchors.hasAnchorFor(targetValue)) -> targetValue
newAnchors.hasAnchorFor(PartiallyExpanded)) -> PartiallyExpanded
newAnchors.hasAnchorFor(Expanded)) -> Expanded
else -> Hidden
}
}
}
pr...@google.com <pr...@google.com> #4
Project: chromium/src
Branch: main
commit 0fe5e3c558992a1c0b5b2aef2594049862b1c703
Author: Zach Katz <katzz@google.com>
Date: Fri May 03 23:02:15 2024
[ASH] Add fieldtrial_testing_config
Bug: 324934884
Change-Id: Ib9d0ade90999a67cd74d1b94e6ab43087b5e1ead
Reviewed-on:https://chromium-review.googlesource.com/c/chromium/src/+/5516358
Reviewed-by: Jinsuk Kim <jinsukkim@chromium.org>
Commit-Queue: Zach Katz <katzz@google.com>
Cr-Commit-Position: refs/heads/main@{#1296421}
M testing/variations/fieldtrial_testing_config.json
https://chromium-review.googlesource.com/5516358
Branch: main
commit 0fe5e3c558992a1c0b5b2aef2594049862b1c703
Author: Zach Katz <katzz@google.com>
Date: Fri May 03 23:02:15 2024
[ASH] Add fieldtrial_testing_config
Bug: 324934884
Change-Id: Ib9d0ade90999a67cd74d1b94e6ab43087b5e1ead
Reviewed-on:
Reviewed-by: Jinsuk Kim <jinsukkim@chromium.org>
Commit-Queue: Zach Katz <katzz@google.com>
Cr-Commit-Position: refs/heads/main@{#1296421}
M testing/variations/fieldtrial_testing_config.json
Description
Jetpack Compose version: BOM 2024.06.00
Material Library Version (M2, M3 or Both?): M3
Material Compose component used: SearchBar
Android Studio Build: 2024.1.1
Kotlin version: 2.0.0
Steps to Reproduce or Code Sample to Reproduce:
SearchBar
astopBar
and aLazyColumn
of items ascontent
into aScaffold
.SearchBar
.SearchBar
pushes content below away instead of overlaying above it, and closing it pulls back the content below.SearchBar
increasing its layout height in-place, which means thecontent
will be given less height during measurement.This can be seen in blog posts about how to usehttps://medium.com/@shivathapaa/custom-topappbar-using-android-jetpack-compose-f9b33388a125 (disclaimer: I'm not the author of it) has a GIF recording which shows this problem if one observe carefully.
SearchBar
as well, e.g.This isn't a problem in Compose Material Catalog SearchBarSamples because the sample is using a
Box
and a fixed top padding for the list. However, that doesn't work in most real world scenarios e.g. when people need to useScaffold
.I think the material-components-android approach for , which is to offer
SearchBar
SearchBar
andSearchView
separately, is more flexible and will make it possible to handle layout (and window insets) correctly under all scenarios.Stack trace (if applicable): N/A