square / leakcanary

A memory leak detection library for Android.
https://square.github.io/leakcanary
Apache License 2.0
29.43k stars 3.97k forks source link

Small UI bug with Android 15 #2690

Open Tolriq opened 5 months ago

Tolriq commented 5 months ago

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 commented 5 months ago

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

Tolriq commented 5 months ago

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 commented 6 days ago

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.