Status Update
Comments
lu...@gmail.com <lu...@gmail.com> #2
ma...@google.com <ma...@google.com> #3
Can you clarify your expected behavior? When you add padding to an unexpanded search bar, are you trying to add it to the inside or outside of its visual Surface?
lu...@gmail.com <lu...@gmail.com> #4
ma...@google.com <ma...@google.com>
so...@gmail.com <so...@gmail.com> #5
so...@gmail.com <so...@gmail.com> #6
But if you implement the current compose SearchBar, it doesn't have any horizontal padding during the collapsed state and the SearchBar covers the entire width. But if you set a padding modifier, it also affects the expanded Search View, which is undesirable.
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
Author: Max Alfonso-Ying <
Link:
Publish new search bar APIs.
Expand for full commit details
Publish new search bar APIs.
Samples have also been updated.
Bug: b/261496232, b/263130999, b/283311462, b/350916229, b/352872248
Test: manually + existing unit/screenshot tests
Relnote: """New search bar APIs:
* Collapsed search bars and expanded search "views" are now
separate composables.
* `SearchBar` represents a search bar in the collapsed state.
* `ExpandedFullScreenSearchBar` and `ExpandedDockedSearchBar`
represent the search bar in the expanded state. These open
in a new window.
* `SearchBarState` to control the state of the search bar
* `TopSearchBar` to add insets handling and scroll behavior
* New overload of `InputField` which uses `SearchBarState`
"""
Change-Id: Ie0723015eddd66c82f420481dc6f366a7e26f4a8
Files:
- M
compose/material3/material3/api/current.txt
- M
compose/material3/material3/api/restricted_current.txt
- M
compose/material3/material3/integration-tests/material3-catalog/src/main/java/androidx/compose/material3/catalog/library/model/Examples.kt
- M
compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/SearchBarSamples.kt
- M
compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/SearchBarScreenshotTest.kt
- M
compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/SearchBar.kt
Hash: 2c46cabd287091ae4a47a7309f2f3eb19930c754
Date: Tue Jan 21 18:19:22 2025
ma...@google.com <ma...@google.com>
ma...@google.com <ma...@google.com> #8
New search bar APIs will be released in an upcoming version with separate components for collapsed and expanded search bars, so you will be able to add padding to one and not the other. Please try the new search bar once it is released and see if it covers your use case.
pr...@google.com <pr...@google.com> #9
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material3:material3:1.4.0-alpha08
androidx.compose.material3:material3-android:1.4.0-alpha08
androidx.compose.material3:material3-jvmstubs:1.4.0-alpha08
androidx.compose.material3:material3-linuxx64stubs:1.4.0-alpha08
androidx.core:core-viewtree:1.0.0-rc01
Description
Jetpack Compose version: 2024.06.00 bom
Material Library Version (M2, M3 or Both?): M3
Material Compose component used: SearchBar
Android Studio Build: 2024.1.1 Patch 1
Kotlin version: 2.0
Steps to Reproduce or Code Sample to Reproduce:
There should be a way to add padding to the SearchBar without affecting the active expanded view, ideally via a parameter on the SearchBar Composable. Screenshots attached.