File tree Expand file tree Collapse file tree
libs/SalesforceSDK/src/com/salesforce/androidsdk/ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ import androidx.browser.customtabs.CustomTabColorSchemeParams
9393import androidx.browser.customtabs.CustomTabsIntent
9494import androidx.compose.material3.MaterialTheme
9595import androidx.compose.ui.graphics.Color
96+ import androidx.compose.ui.graphics.luminance
9697import androidx.compose.ui.graphics.toArgb
9798import androidx.core.content.ContextCompat
9899import androidx.core.content.ContextCompat.getMainExecutor
@@ -920,7 +921,10 @@ open class LoginActivity : FragmentActivity() {
920921 ? : return @evaluateJavascript
921922
922923 // Ensure Status Bar Icons are readable no matter which OS theme is used.
923- val useLightIcons = viewModel.dynamicBackgroundTheme.value == DARK
924+ val titleTextColorLight = viewModel.titleTextColor?.luminance()?.let { it < 0.5 }
925+ val topAppBarDark = viewModel.topBarColor?.luminance()?.let { it < 0.5 }
926+ val dynamicThemeIsDark = viewModel.dynamicBackgroundTheme.value == DARK
927+ val useLightIcons = titleTextColorLight ? : topAppBarDark ? : dynamicThemeIsDark
924928 WindowCompat .getInsetsController(window, window.decorView).isAppearanceLightStatusBars = useLightIcons
925929 }.also {
926930 if (! viewModel.authFinished.value) {
You can’t perform that action at this time.
0 commit comments