Asad Mukhtar
10/30/2022, 7:17 PMfun 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.