[go: up one dir, main page]

Skip to content

Commit

Permalink
Fixed system UI behaviour in PhotoZoomActivity (#148)
Browse files Browse the repository at this point in the history
Fixed system UI backgrounds were transparent on first click:
- fixed by hiding system UI once the decor view is ready (`window.decorView.post`)

Fixed navigation bar controls were not displayed light.

Fixed content resizing on devices with display cutouts when system UI reappeared.
  • Loading branch information
Drumber authored Nov 3, 2021
1 parent 50911c2 commit d7320e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ class PhotoZoomActivity : BaseActivity(R.layout.activity_photo_zoom) {
super.onCreate(savedInstanceState)

WindowCompat.setDecorFitsSystemWindows(window, false)
toggleSystemUi(false)
window.decorView.post {
toggleSystemUi(false)
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
window.decorView.setOnApplyWindowInsetsListener { view, windowInsets ->
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<item name="android:statusBarColor">@color/immersive_sys_ui</item>
<item name="android:navigationBarColor">@color/immersive_sys_ui</item>
<item name="android:windowLightStatusBar" tools:targetApi="m">false</item>
<item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">false</item>
<item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="o_mr1">shortEdges</item>
</style>

<!-- Base custom theme which will be shared between both light and dark theme variants -->
Expand Down

0 comments on commit d7320e6

Please sign in to comment.