Hello, I'm having issues with Dialog and Alert com...
# compose-wear
a
Hello, I'm having issues with Dialog and Alert composable. No matter what I try, Dialog is not in 100% size, there is like 1% of pixels visible from composable which was used to initiate Dialog. Also, in Alert, I'm not able to turn off shadow around screen. It also works somehow wrongly. Is this because I use some wrong library? Anyone faced similar issue?
👀 1
k
The shadow on top and bottom edges looks like Vignette, do you set it in Scaffold?
a
Hi Kseniia, thanks for replying 🙂 No, it's not set directly in Scaffold. (I forgot it's called Vignette). I'm sending code samples for starting theme and dialog. Maybe it's because I didn't add chip composables directly to the content of Alert? I'll be trying. It's a still mystery to me why it's not filling full space when fillmaxsize is used
I think both issues are caused because Dialog is not filling full space
Strangely enough, I don't see same behavior on Galaxy Watch 6 (480x480 screen) and also on 450x450 with my other apps.
s
The vignette is part of the Material Dialog implementation so is always shown (you can see it fading in and fading out as part of the dialog animations). As for the sizing - Modifier.fillMaxSize() is passed to your Scaffold, but you would also need to pass it to your Dialog's modifier parameter, as the Dialog is displayed separately.
🙄 1
a
@stevebower Unfortunately, no change. fillMaxSize() in both. I can only see this on my 450x450 device. On 480x480 it's ok. Anything else I could try?
@stevebower so, I moved my other app which was OK from material to foundation.lazy and I'm seeing same issue. To duplicate, just create scaffold, place Box of fillMaxSize and then create dialog on top of it. (I'm testing on 450x450 - GalaxyWatch4)
Wrong dialog size is happening after these Kotlin 1.8.20 -> 1.9.0 Gradle 8.1.0 -> 8.1.1 compileSDK 33 -> 34 compose ui 1.4.3 -> 1.5.0 compose wear 1.1.2 -> 1.2.0 and switching two imports from androidx.wear.compose.material to androidx.wear.compose.foundation.lazy (only rememberScalingLazyListState) Maybe something did change in Dialog between compose-material 1.1.2 and 1.2.0?
@stevebower I was able to isolate problem, when I switch from androidx.compose.ui 1.4.3 to 1.5.0 and material from 1.1.2 to 1.2.0, Dialog shows wrongly with that corrupted vignette and not fills entire watch screen
s
Hi - I've reproduced similar artifacts on the edges of the screen on a Galaxy Watch 4 (but not visible in the emulator or on a Pixel Watch). It's something to do with the compose.ui dialog that the Wear Compose dialog is calling - I'll raise a ticket and we'll report back.
Apparently, this is another case of an existing bug, https://issuetracker.google.com/issues/211022812 - which seems to be a rounding error somewhere that affects popup and dialog.