Skip to content

Commit

Permalink
Fix weird padding on android 10 and below (#1046)
Browse files Browse the repository at this point in the history
  • Loading branch information
MV-GH authored Jul 17, 2023
1 parent 55d8400 commit bfb4483
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,21 @@ fun ImageViewer(url: String, onBackRequest: () -> Unit) {
)

onDispose { // Restore previous system bars
WindowCompat.setDecorFitsSystemWindows(window, true)

// Does weird behaviour on android 10 and below
if (SDK_INT >= 30) {
WindowCompat.setDecorFitsSystemWindows(window, true)
}

systemUiController.setStatusBarColor(
color = oldBarColor,
darkIcons = oldIcons,
)

systemUiController.isSystemBarsVisible = true
if (!showTopBar) {
systemUiController.isSystemBarsVisible = true
}

window.addFlags(FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
@Suppress("DEPRECATION")
window.clearFlags(FLAG_TRANSLUCENT_NAVIGATION)
Expand Down

0 comments on commit bfb4483

Please sign in to comment.