fix: the navigation bar stays dark when the launcher is not fullscreen

From Android 14 the Material theme leaves the navigation bar
transparent, so with launcher fullscreen off a white system bar showed
under the dark launcher. AppTheme now sets the navigation bar to black,
matching the status bar.
This commit is contained in:
Kirk authored and maxjivi05 committed 2026-11-03 13:25:08 -05:00
1 parent d1707dc1b7
commit d25f6940ee
2 files changed
+26

No files matched your search

+1
View File
@@ -2,6 +2,7 @@
<resources>
<style name="AppTheme" parent="@android:style/Theme.Material.NoActionBar">
<item name="android:colorBackground">#FF101418</item>
<item name="android:navigationBarColor">@android:color/black</item>
</style>
<style name="SessionTheme" parent="@android:style/Theme.Material.NoActionBar.Fullscreen">
<item name="android:windowBackground">@android:color/black</item>
@@ -0,0 +1,25 @@
package com.droiddeck.launcher.ui
import android.graphics.Color
import android.view.ContextThemeWrapper
import com.droiddeck.launcher.R
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.annotation.Config
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [34])
class AppThemeTest {
@Test fun theNavigationBarIsOpaqueAndDarkSoNothingLightShowsThroughIt() {
val themed = ContextThemeWrapper(RuntimeEnvironment.getApplication(), R.style.AppTheme)
val attrs = themed.obtainStyledAttributes(intArrayOf(android.R.attr.navigationBarColor))
val color = attrs.getColor(0, Color.TRANSPARENT)
attrs.recycle()
assertEquals(0xFF, Color.alpha(color))
assertTrue(Color.luminance(color) < 0.1f)
}
}