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

Fix image viewer adding unneeded padding on android 10 and below #1046

Merged
merged 2 commits into from
Jul 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix weird padding on android 10 and below
MV-GH committed Jul 15, 2023
commit 262e0e3ecfd0ae3bb9f3be6bd006009b9347a7e0
Original file line number Diff line number Diff line change
@@ -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)