fix: the navigation bar stays dark when the launcher is not fullscreen (#1975)

This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-11-03 06:58:51 -05:00
commit 61cbf91150
2 files changed
+26

No files matched your search

@@ -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)
}
}