Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small UI bug with Android 15 #2690

Open
Tolriq opened this issue Jun 19, 2024 · 3 comments
Open

Small UI bug with Android 15 #2690

Tolriq opened this issue Jun 19, 2024 · 3 comments

Comments

@Tolriq
Copy link

Tolriq commented Jun 19, 2024

Description

Small UI bug.

image

Steps to Reproduce

Build with targetSDK 35

This was more or less expected due to Android 15 inset changes, but I did expect the "action bar" to go under the status bar, not the bar to be correct and the content completely missplaced and under.

@pyricau
Copy link
Member

pyricau commented Jun 20, 2024

Thanks! If anyone wants to figure out a quick fix for this one that'd benefit everybody, feel free to!

@Tolriq
Copy link
Author

Tolriq commented Jun 20, 2024

The quick ugly workaround is to apply .windowInsetsPadding(WindowInsets.safeDrawing) to the outermost component. Don't really know the architecture of the app.

@priyanshu-lgtm
Copy link

SO i have 2 suggestions

If you are using the Scaffold as the parent layout have you tried giving the top padding to its child like this
{ Column( modifier = Modifier.fillMaxSize().padding(top = it.calculateTopPadding()) .verticalScroll(rememberScrollState()).background(colorResource(R.color.bg_color))

in my cases this works like a charm and automatically adjust the top for me.

  1. I think you must have already tried it but im suggesting this just in case, so in any view in composable there are inbuild padding functions
    and for managing the statusbar we have Modifier.statusbarPadding()

and if these are not the solution (most probably bug in Android's end) one other workaround would be to calculate the screen height and the subtracting a safe amount of padding from it and and giving it as the top padding of that top view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants