diff --git a/app/src/main/java/app/opendocument/droid/ui/activity/MainActivity.kt b/app/src/main/java/app/opendocument/droid/ui/activity/MainActivity.kt index 30779b51bdfb..70f96a9327fe 100644 --- a/app/src/main/java/app/opendocument/droid/ui/activity/MainActivity.kt +++ b/app/src/main/java/app/opendocument/droid/ui/activity/MainActivity.kt @@ -177,7 +177,13 @@ class MainActivity : AppCompatActivity(), MenuProvider { WindowInsetsCompat.CONSUMED } - title = "" + // nothing lives in the toolbar any more - the landing screen has its own header and the + // document its buttons - so the bar would just be an empty strip of colour. Hiding it + // rather than moving to a .NoActionBar theme keeps it as the host the action modes are + // raised in: appcompat shows the container again for as long as one is up, and takes it + // back down afterwards, so find, tts and edit still get their bar without the app + // having to put one on screen itself. + supportActionBar?.hide() onBackPressedDispatcher.addCallback(this, backCallback) @@ -480,8 +486,6 @@ class MainActivity : AppCompatActivity(), MenuProvider { WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE insetsController.hide(WindowInsetsCompat.Type.statusBars()) - supportActionBar?.hide() - // delay offer to wait for fullscreen animation to finish handler.postDelayed( { @@ -591,8 +595,6 @@ class MainActivity : AppCompatActivity(), MenuProvider { return } - supportActionBar?.show() - WindowCompat.getInsetsController(window, window.decorView) .show(WindowInsetsCompat.Type.statusBars()) diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 25eb44bca7b9..0dec01cdbb63 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -6,8 +6,13 @@ have to add what is specific to them. Copying the whole theme per qualifier is what let the colours drift apart before. - Not a .NoActionBar variant: there is no Toolbar view anywhere, the app relies on the - default ActionBar and drives it through supportActionBar / startSupportActionMode. + Not a .NoActionBar variant, even though no screen puts anything in the bar any more: + the ActionBar's container is what startSupportActionMode() raises find, tts and edit + in, and appcompat only shows it for as long as one of them is up. MainActivity hides + the bar itself on start, so the container is off screen the rest of the time and the + window inset math stays the one ActionBarOverlayLayout does - which a NoActionBar + theme would swap for a decor that pads itself, on top of the padding MainActivity + applies. -->