Is there an equivalent of `fillMaxRectangle` but o...
# compose-wear
t
Is there an equivalent of
fillMaxRectangle
but only for width?
To ensure that the header in a
ScalingLazyColumn
takes the most place without being cut to please the review team ?
f
Did you try fillMaxWidth?
t
It does a full max width so cut the text on a round display.
f
Maybe you can try to wrap your header inside a BoxWithConstraint or Box and play with padding
t
Yes there's many hack, was wondering about an official way. Easy way is just
Copy code
.fillMaxWidth(0.85f)
that works due the top padding.
y
Horologist has modifiers for this.
Copy code
ResponsiveListHeader(contentPadding = firstItemPadding()) {
Text(text = "Main")
}
🦜 1
t
Thanks, I completely missed that part of the docs 😞
y
Well it's rare Horologist has docs 🙂
t
There's many things everywhere, and TBH I find horologist module split for media a complete mess with everything everywhere, making it hard to get only part of it. (But still lot of good stuff, but requires copy paste to adapt if you do not want some parts)
y
Any suggestions?
We started with the idea of a starter kit for local media playback, but it was all or nothing.
Then based on feedback split into MAD layers, UI, data. And exoplayer services separately.
t
BTW the
firstItemPadding
would be nice without a bottom padding to allow handling a second header with less spacing.
y
Unfortunately that these are not visible to you, but these components match some internal Figma for Wear Material apps. I'd suggest copy and pasting this firstItemPadding if you want it to do something slightly different. Sorry
t
I have no real idea as I'm taking this piece by piece to also reuse my own code from the phone app. But there's many different modules split, but in the end when you want to use one, you mostly need all the others.
About the firstItem yes I imagine there's a reason, but it's strange that you force 8.dp there when the default spacing in the lazy are 4 for example. But I'll copy paste and adapt 🙂
👍🏻 1
y
The specs we are using leak out a bit via screenshot tests, and hopefully we'll share more assets at some point.
Purple being the spec, overlaid on the result of rememberResponseColumnState and ResponsiveListHeader.
t
Is there screenshots and details about the I think you call entity view? The one with a title, the 2/3 buttons then the items. In the end my filter screen is mostly the same design.
y
You can run the uamp sample to see it.
Or open up EntityScreenPreview in AS
image.png
t
Hum yes the previews 😞 I stopped using those early when it was so broken and slow and never looked back. I should start again. Anyway it looks like you keep large padding too so I guess I'll keep that too. And never saw the first one will need to look more at that part of horologist thanks.
y
There are more docs than typical for the Media parts - https://google.github.io/horologist/media-toolkit/
👍 1