Is there any good example of the M3 SearchBar/Dock...
# compose
g
Is there any good example of the M3 SearchBar/DockedSearchBar anyone knows off hand that I could read through? It seems like it just kind of floats on top and doesn't have much layout control so I'm wondering if it's just me not having used it before, or if it's really that alpha still and I should just do the search bar from scratch. I guess I was expecting things like integration with scaffold and topappbar behaviors, etc. it also seems like the documentation for it on the android dev site doesn't exist yet.
j
DockedSearchBar is input field and intend bake result under input field. Its not alpha from what I recall. I used in production for a while. SearchBar is the one you want if using Scaffold, just put inside topAppBar slot. I dont know why the documentation is gone.
g
SearchBar in the topappbar slot doesn't respect padding anywhere, it just kind of floats overtop of everything.
j
Not sure I follow. But can use it without Scaffold as well. In general I think they designed for full screen search where they in use. I think padding is from input field if remember correct. I have used it in Scaffold even if not intended as so. I do agree the difference between search bars is diffuse.
g
Are you sure you're using the same search bar? The M3 one is still very much alpha, it requires
@OptIn(ExperimentalMaterial3Api::class)
My biggest gripe is it completely ignores padding/insets/etc. It just seems to position itself ontop of the entire view stack nomatter where in the hierarchy you put it.
j
It was released in compose M3 1.1.0 release. A lot of things using experimental existing long time. I ignore experimental flags.
Sounds odd if it place itself floating. Sounds like a bug.