I use this method to show the content above the status bar:
Copy code
fun Activity.setSystemPaddingForAppContent(view: View) {
WindowCompat.setDecorFitsSystemWindows(window, false)
ViewCompat.setOnApplyWindowInsetsListener(view) { view, windowInsets ->
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemGestures())
// Apply the insets as padding to the view. Here we're setting all of the
// dimensions, but apply as appropriate to your layout. You could also
// update the views margin if more appropriate.
view.updatePadding(insets.left, 0, insets.right, insets.bottom)
// Return CONSUMED if we don't want the window insets to keep being passed
// down to descendant views.
WindowInsetsCompat.CONSUMED
}
}
But the problem is that I have a simple activity due to the above function ScrollView, NestedScrollView not scroll even the content is scrollable.
q
qian
11/03/2022, 8:50 AM
Hello consider posting this in #android channel you will get more relevant responses 🙂
a
Asad Mukhtar
11/08/2022, 7:05 PM
@qian i posted there and no one reply me and react on my post as not Kotlin?
q
qian
11/08/2022, 7:53 PM
I think your problem is purely Android thus has nothing to do with the programming language itself and you might find more help on StackOverflow or other android community.
And I think the question itself is not clear enough either, you might want to rephrase your question to make it more understandable.