diff --git a/app/src/main/kotlin/com/wire/android/navigation/MainNavHost.kt b/app/src/main/kotlin/com/wire/android/navigation/MainNavHost.kt index 8b8a67d1aa..fbd1660dab 100644 --- a/app/src/main/kotlin/com/wire/android/navigation/MainNavHost.kt +++ b/app/src/main/kotlin/com/wire/android/navigation/MainNavHost.kt @@ -21,6 +21,7 @@ package com.wire.android.navigation import androidx.compose.animation.ExperimentalAnimationApi import androidx.compose.runtime.Composable import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier import androidx.hilt.navigation.compose.hiltViewModel import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi import com.ramcosta.composedestinations.DestinationsNavHost @@ -44,6 +45,7 @@ import com.wire.android.ui.home.newconversation.NewConversationViewModel fun MainNavHost( navigator: Navigator, startDestination: Route, + modifier: Modifier = Modifier, ) { val navHostEngine = rememberAnimatedNavHostEngine( rootDefaultAnimations = DefaultRootNavGraphAnimations, @@ -55,6 +57,7 @@ fun MainNavHost( ) DestinationsNavHost( + modifier = modifier, navGraph = WireMainNavGraph, engine = navHostEngine, startRoute = startDestination, diff --git a/app/src/main/kotlin/com/wire/android/ui/AppLockActivity.kt b/app/src/main/kotlin/com/wire/android/ui/AppLockActivity.kt index 36a9466e6a..7ce3e80fe6 100644 --- a/app/src/main/kotlin/com/wire/android/ui/AppLockActivity.kt +++ b/app/src/main/kotlin/com/wire/android/ui/AppLockActivity.kt @@ -19,12 +19,12 @@ package com.wire.android.ui import android.os.Bundle import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge import androidx.appcompat.app.AppCompatActivity import androidx.biometric.BiometricManager import androidx.compose.material3.SnackbarHostState import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.remember -import androidx.core.view.WindowCompat import com.wire.android.appLogger import com.wire.android.navigation.MainNavHost import com.wire.android.navigation.rememberNavigator @@ -39,7 +39,7 @@ import dagger.hilt.android.AndroidEntryPoint class AppLockActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - WindowCompat.setDecorFitsSystemWindows(window, false) + enableEdgeToEdge() setContent { val snackbarHostState = remember { SnackbarHostState() } CompositionLocalProvider( diff --git a/app/src/main/kotlin/com/wire/android/ui/WireActivity.kt b/app/src/main/kotlin/com/wire/android/ui/WireActivity.kt index 54d9e7ff6d..3dc15193a4 100644 --- a/app/src/main/kotlin/com/wire/android/ui/WireActivity.kt +++ b/app/src/main/kotlin/com/wire/android/ui/WireActivity.kt @@ -26,11 +26,14 @@ import android.os.Bundle import android.view.WindowManager import android.widget.Toast import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatDelegate import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.statusBarsPadding +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.consumeWindowInsets +import androidx.compose.foundation.layout.statusBars import androidx.compose.material3.SnackbarHostState import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider @@ -47,7 +50,6 @@ import androidx.compose.ui.platform.LocalSoftwareKeyboardController import androidx.compose.ui.semantics.semantics import androidx.compose.ui.semantics.testTagsAsResourceId import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen -import androidx.core.view.WindowCompat import androidx.lifecycle.Lifecycle import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope @@ -163,7 +165,7 @@ class WireActivity : AppCompatActivity() { super.onCreate(savedInstanceState) splashScreen.setKeepOnScreenCondition { shouldKeepSplashOpen } - WindowCompat.setDecorFitsSystemWindows(window, false) + enableEdgeToEdge() lifecycleScope.launch { @@ -232,18 +234,17 @@ class WireActivity : AppCompatActivity() { WireTheme { Column( modifier = Modifier - .statusBarsPadding() .semantics { testTagsAsResourceId = true } ) { val navigator = rememberNavigator(this@WireActivity::finish) WireTopAppBar( - themeOption = viewModel.globalAppState.themeOption, commonTopAppBarState = commonTopAppBarViewModel.state, ) CompositionLocalProvider(LocalNavigator provides navigator) { MainNavHost( navigator = navigator, - startDestination = startDestination + startDestination = startDestination, + modifier = Modifier.consumeWindowInsets(WindowInsets.statusBars) ) } @@ -260,11 +261,11 @@ class WireActivity : AppCompatActivity() { @Composable private fun WireTopAppBar( - themeOption: ThemeOption, - commonTopAppBarState: CommonTopAppBarState + commonTopAppBarState: CommonTopAppBarState, + modifier: Modifier = Modifier, ) { CommonTopAppBar( - themeOption = themeOption, + modifier = modifier, commonTopAppBarState = commonTopAppBarState, onReturnToCallClick = { establishedCall -> getOngoingCallIntent( diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/StartingCallActivity.kt b/app/src/main/kotlin/com/wire/android/ui/calling/StartingCallActivity.kt index 56cbe581ff..c2fc5447e6 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/StartingCallActivity.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/StartingCallActivity.kt @@ -21,6 +21,7 @@ import android.content.Context import android.content.Intent import android.os.Bundle import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge import androidx.compose.animation.AnimatedContent import androidx.compose.animation.togetherWith import androidx.compose.material3.SnackbarHostState @@ -33,7 +34,6 @@ import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.semantics.semantics import androidx.compose.ui.semantics.testTagsAsResourceId -import androidx.core.view.WindowCompat import com.wire.android.appLogger import com.wire.android.navigation.style.TransitionAnimationType import com.wire.android.ui.LocalActivity @@ -87,7 +87,7 @@ class StartingCallActivity : CallActivity() { setUpScreenshotPreventionFlag() setUpCallingFlags() - WindowCompat.setDecorFitsSystemWindows(window, false) + enableEdgeToEdge() handleNewIntent(intent) diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/OngoingCallActivity.kt b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/OngoingCallActivity.kt index 4a407e84e1..a0e4f7e1c1 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/OngoingCallActivity.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/OngoingCallActivity.kt @@ -26,6 +26,7 @@ import android.graphics.drawable.Icon import android.os.Bundle import android.util.Rational import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge import androidx.compose.animation.AnimatedContent import androidx.compose.animation.togetherWith import androidx.compose.material3.SnackbarHostState @@ -38,7 +39,6 @@ import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.semantics.semantics import androidx.compose.ui.semantics.testTagsAsResourceId -import androidx.core.view.WindowCompat import com.wire.android.R import com.wire.android.appLogger import com.wire.android.navigation.style.TransitionAnimationType @@ -90,7 +90,7 @@ class OngoingCallActivity : CallActivity() { setUpScreenshotPreventionFlag() setUpCallingFlags() - WindowCompat.setDecorFitsSystemWindows(window, false) + enableEdgeToEdge() handleNewIntent(intent) diff --git a/app/src/main/kotlin/com/wire/android/ui/common/topappbar/CommonTopAppBar.kt b/app/src/main/kotlin/com/wire/android/ui/common/topappbar/CommonTopAppBar.kt index c22b5c6099..ce9ef4e88b 100644 --- a/app/src/main/kotlin/com/wire/android/ui/common/topappbar/CommonTopAppBar.kt +++ b/app/src/main/kotlin/com/wire/android/ui/common/topappbar/CommonTopAppBar.kt @@ -20,11 +20,10 @@ package com.wire.android.ui.common.topappbar -import androidx.compose.animation.AnimatedVisibility +import androidx.compose.animation.animateColor import androidx.compose.animation.animateContentSize -import androidx.compose.animation.expandIn -import androidx.compose.animation.shrinkOut -import androidx.compose.foundation.background +import androidx.compose.animation.core.animateFloat +import androidx.compose.animation.core.updateTransition import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -32,27 +31,27 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.drawBehind import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.unit.IntSize -import com.google.accompanist.systemuicontroller.rememberSystemUiController import com.wire.android.BuildConfig import com.wire.android.R -import com.wire.android.ui.theme.ThemeOption +import com.wire.android.ui.theme.WireColorScheme import com.wire.android.ui.theme.WireTheme +import com.wire.android.ui.theme.updateSystemBarIconsAppearance import com.wire.android.ui.theme.wireColorScheme import com.wire.android.ui.theme.wireDimensions import com.wire.android.ui.theme.wireTypography @@ -62,114 +61,111 @@ import com.wire.kalium.network.NetworkState @Composable fun CommonTopAppBar( - themeOption: ThemeOption, commonTopAppBarState: CommonTopAppBarState, onReturnToCallClick: (ConnectivityUIState.Call.Established) -> Unit, onReturnToIncomingCallClick: (ConnectivityUIState.Call.Incoming) -> Unit, onReturnToOutgoingCallClick: (ConnectivityUIState.Call.Outgoing) -> Unit, modifier: Modifier = Modifier, ) { - Column(modifier = modifier) { + val transition = updateTransition( + targetState = MaterialTheme.wireColorScheme to commonTopAppBarState.connectivityState.toColorType(), + label = "connectivity state transition" + ) + val backgroundColor = transition.animateColor(label = "top app bar background color") { (colorScheme, colorType) -> + colorScheme.getBackgroundColor(colorType) + } + val systemBarIconsAppearance = transition.animateFloat(label = "system bar icons appearance") { (colorScheme, colorType) -> + if (colorScheme.getStatusBarIconsAppearance(colorType)) 1f else 0f + } + + updateSystemBarIconsAppearance(systemBarIconsAppearance.value > 0.5f) + + Column( + modifier = modifier + .drawBehind { drawRect(backgroundColor.value) } + .statusBarsPadding() + ) { ConnectivityStatusBar( - themeOption = themeOption, networkState = commonTopAppBarState.networkState, connectivityInfo = commonTopAppBarState.connectivityState, onReturnToCallClick = onReturnToCallClick, onReturnToIncomingCallClick = onReturnToIncomingCallClick, - onReturnToOutgoingCallClick = onReturnToOutgoingCallClick + onReturnToOutgoingCallClick = onReturnToOutgoingCallClick, + modifier = modifier, ) } } -@Composable -fun getBackgroundColor(connectivityInfo: ConnectivityUIState): Color { - return when (connectivityInfo) { - is ConnectivityUIState.Calls -> MaterialTheme.wireColorScheme.positive +private enum class ConnectivityStatusColorType { Calls, Connection, None } - is ConnectivityUIState.WaitingConnection, - ConnectivityUIState.Connecting -> MaterialTheme.wireColorScheme.primary +private fun ConnectivityUIState.toColorType() = when (this) { + is ConnectivityUIState.Calls -> ConnectivityStatusColorType.Calls + is ConnectivityUIState.Connecting, + is ConnectivityUIState.WaitingConnection -> ConnectivityStatusColorType.Connection + is ConnectivityUIState.None -> ConnectivityStatusColorType.None +} - ConnectivityUIState.None -> MaterialTheme.wireColorScheme.background - } +private fun WireColorScheme.getBackgroundColor(statusColorType: ConnectivityStatusColorType): Color = when (statusColorType) { + ConnectivityStatusColorType.Calls -> positive + ConnectivityStatusColorType.Connection -> primary + ConnectivityStatusColorType.None -> background +} + +private fun WireColorScheme.getStatusBarIconsAppearance(statusColorType: ConnectivityStatusColorType): Boolean = when (statusColorType) { + ConnectivityStatusColorType.Calls, + ConnectivityStatusColorType.Connection -> connectivityBarShouldUseDarkIcons + ConnectivityStatusColorType.None -> useDarkSystemBarIcons } @Composable private fun ConnectivityStatusBar( - themeOption: ThemeOption, connectivityInfo: ConnectivityUIState, networkState: NetworkState, onReturnToCallClick: (ConnectivityUIState.Call.Established) -> Unit, onReturnToIncomingCallClick: (ConnectivityUIState.Call.Incoming) -> Unit, onReturnToOutgoingCallClick: (ConnectivityUIState.Call.Outgoing) -> Unit, + modifier: Modifier = Modifier, ) { - val isVisible = connectivityInfo !is ConnectivityUIState.None - val backgroundColor = getBackgroundColor(connectivityInfo) - - if (isVisible) { - val darkIcons = MaterialTheme.wireColorScheme.connectivityBarShouldUseDarkIcons - val systemUiController = rememberSystemUiController() - systemUiController.setStatusBarColor( - color = backgroundColor, - darkIcons = darkIcons - ) - LaunchedEffect(themeOption) { - systemUiController.setStatusBarColor( - color = backgroundColor, - darkIcons = darkIcons - ) - } - } else { - ClearStatusBarColor() - } - - AnimatedVisibility( - visible = isVisible, - enter = expandIn(initialSize = { fullSize -> IntSize(fullSize.width, 0) }), - exit = shrinkOut(targetSize = { fullSize -> IntSize(fullSize.width, 0) }) + Column( + modifier = modifier + .animateContentSize() + .fillMaxWidth(), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center ) { - Column( - modifier = Modifier - .animateContentSize() - .fillMaxWidth() - .heightIn(min = MaterialTheme.wireDimensions.ongoingCallLabelHeight) - .background(backgroundColor), - horizontalAlignment = Alignment.CenterHorizontally, - verticalArrangement = Arrangement.Center - ) { - when (connectivityInfo) { - is ConnectivityUIState.Calls -> - CallsContent( - calls = connectivityInfo.calls, - onReturnToCallClick = onReturnToCallClick, - onReturnToIncomingCallClick = onReturnToIncomingCallClick, - onReturnToOutgoingCallClick = onReturnToOutgoingCallClick - ) + when (connectivityInfo) { + is ConnectivityUIState.Calls -> + CallsContent( + calls = connectivityInfo.calls, + onReturnToCallClick = onReturnToCallClick, + onReturnToIncomingCallClick = onReturnToIncomingCallClick, + onReturnToOutgoingCallClick = onReturnToOutgoingCallClick + ) - ConnectivityUIState.Connecting -> + ConnectivityUIState.Connecting -> + StatusLabel( + R.string.connectivity_status_bar_connecting, + MaterialTheme.wireColorScheme.onPrimary + ) + + is ConnectivityUIState.WaitingConnection -> { + val color = MaterialTheme.wireColorScheme.onPrimary + val waitingStatus: @Composable () -> Unit = { StatusLabel( - R.string.connectivity_status_bar_connecting, - MaterialTheme.wireColorScheme.onPrimary + stringResource = R.string.connectivity_status_bar_waiting_for_network, + color ) + } - is ConnectivityUIState.WaitingConnection -> { - val color = MaterialTheme.wireColorScheme.onPrimary - val waitingStatus: @Composable () -> Unit = { - StatusLabel( - stringResource = R.string.connectivity_status_bar_waiting_for_network, - color - ) - } - - if (!BuildConfig.PRIVATE_BUILD) { - waitingStatus() - return@Column - } - - WaitingStatusLabelInternal(connectivityInfo, networkState, waitingStatus) + if (!BuildConfig.PRIVATE_BUILD) { + waitingStatus() + return@Column } - ConnectivityUIState.None -> {} + WaitingStatusLabelInternal(connectivityInfo, networkState, waitingStatus) } + + ConnectivityUIState.None -> {} } } } @@ -381,20 +377,9 @@ private fun MicrophoneIcon( ) } -@Composable -private fun ClearStatusBarColor() { - val backgroundColor = MaterialTheme.wireColorScheme.background - val darkIcons = MaterialTheme.wireColorScheme.useDarkSystemBarIcons - - rememberSystemUiController().setSystemBarsColor( - color = backgroundColor, - darkIcons = darkIcons - ) -} - @Composable private fun PreviewCommonTopAppBar(connectivityUIState: ConnectivityUIState) = WireTheme { - CommonTopAppBar(ThemeOption.SYSTEM, CommonTopAppBarState(connectivityUIState), {}, {}, {}) + CommonTopAppBar(CommonTopAppBarState(connectivityUIState), {}, {}, {}) } @PreviewMultipleThemes diff --git a/app/src/main/kotlin/com/wire/android/ui/common/topappbar/CommonTopAppBarViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/common/topappbar/CommonTopAppBarViewModel.kt index d682035168..7bc542bea4 100644 --- a/app/src/main/kotlin/com/wire/android/ui/common/topappbar/CommonTopAppBarViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/common/topappbar/CommonTopAppBarViewModel.kt @@ -38,10 +38,10 @@ import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.feature.session.CurrentSessionResult import com.wire.kalium.network.NetworkState import dagger.hilt.android.lifecycle.HiltViewModel -import kotlinx.coroutines.delay import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.combine +import kotlinx.coroutines.flow.debounce import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.flowOf @@ -95,37 +95,44 @@ class CommonTopAppBarViewModel @Inject constructor( init { viewModelScope.launch { coreLogic.globalScope { - session.currentSessionFlow().flatMapLatest { - when (it) { - is CurrentSessionResult.Failure.Generic, - is CurrentSessionResult.Failure.SessionNotFound -> flowOf( - ConnectivityUIState.None - ) + session.currentSessionFlow() + .flatMapLatest { + when (it) { + is CurrentSessionResult.Failure.Generic, + is CurrentSessionResult.Failure.SessionNotFound -> flowOf( + ConnectivityUIState.None + ) - is CurrentSessionResult.Success -> { - val userId = it.accountInfo.userId - combine( - activeCallsFlow(userId), - currentScreenFlow(), - connectivityFlow(userId), - ) { activeCalls, currentScreen, connectivity -> - mapToConnectivityUIState(currentScreen, connectivity, activeCalls) + is CurrentSessionResult.Success -> { + val userId = it.accountInfo.userId + combine( + activeCallsFlow(userId), + currentScreenFlow(), + connectivityFlow(userId), + ) { activeCalls, currentScreen, connectivity -> + mapToConnectivityUIState(currentScreen, connectivity, activeCalls) + } } } } - }.collectLatest { connectivityUIState -> - /** - * Adding some delay here to avoid some bad UX : ongoing call banner displayed and - * hided in a short time when the user hangs up the call - * Call events could take some time to be received and this function - * could be called when the screen is changed, so we delayed - * showing the banner until getting the correct calling values - */ - if (connectivityUIState is ConnectivityUIState.Calls && connectivityUIState.hasOngoingCall) { - delay(WAITING_TIME_TO_SHOW_ONGOING_CALL_BANNER) + .debounce { state -> + /** + * Adding some debounce here to avoid some bad UX and prevent from having blinking effect when the state changes + * quickly, e.g. when displaying ongoing call banner and hiding it in a short time when the user hangs up the call. + * Call events could take some time to be received and this function could be called when the screen is changed, + * so we delayed showing the banner until getting the correct calling values and for calls this debounce is bigger + * than for other states in order to allow for the correct handling of hanging up a call. + * When state changes to None, handle it immediately, that's why we return 0L debounce time in this case. + */ + when { + state is ConnectivityUIState.None -> 0L + state is ConnectivityUIState.Calls && state.hasOngoingCall -> CONNECTIVITY_STATE_DEBOUNCE_ONGOING_CALL + else -> CONNECTIVITY_STATE_DEBOUNCE_DEFAULT + } + } + .collectLatest { connectivityUIState -> + state = state.copy(connectivityState = connectivityUIState) } - state = state.copy(connectivityState = connectivityUIState) - } } coreLogic.networkStateObserver.observeNetworkState().collectLatest { state = state.copy(networkState = it) @@ -171,6 +178,7 @@ class CommonTopAppBarViewModel @Inject constructor( } private companion object { - const val WAITING_TIME_TO_SHOW_ONGOING_CALL_BANNER = 600L + const val CONNECTIVITY_STATE_DEBOUNCE_ONGOING_CALL = 600L + const val CONNECTIVITY_STATE_DEBOUNCE_DEFAULT = 200L } } diff --git a/app/src/main/kotlin/com/wire/android/ui/emoji/HandleDraggableBottomSheetDialog.kt b/app/src/main/kotlin/com/wire/android/ui/emoji/HandleDraggableBottomSheetDialog.kt index adc6212903..ff109265ff 100644 --- a/app/src/main/kotlin/com/wire/android/ui/emoji/HandleDraggableBottomSheetDialog.kt +++ b/app/src/main/kotlin/com/wire/android/ui/emoji/HandleDraggableBottomSheetDialog.kt @@ -16,14 +16,11 @@ package com.wire.android.ui.emoji import android.content.Context -import android.os.Build -import android.os.Build.VERSION_CODES import android.os.Bundle import android.util.TypedValue import android.view.View import android.view.ViewGroup import android.view.Window -import android.view.WindowManager import android.widget.FrameLayout import androidx.annotation.LayoutRes import androidx.annotation.StyleRes @@ -84,21 +81,7 @@ class HandleDraggableBottomSheetDialog : AppCompatDialog { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val window = window - if (window != null) { - if (Build.VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) { - // The status bar should always be transparent because of the window animation. - window.statusBarColor = 0 - - window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) - if (Build.VERSION.SDK_INT < VERSION_CODES.M) { - // It can be transparent for API 23 and above because we will handle switching the status - // bar icons to light or dark as appropriate. For API 21 and API 22 we just set the - // translucent status bar. - window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) - } - } - window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) - } + window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) } override fun setContentView(view: View) { @@ -269,18 +252,5 @@ class HandleDraggableBottomSheetDialog : AppCompatDialog { } return themeId } - - @Deprecated("use {@link EdgeToEdgeUtils#setLightStatusBar(Window, boolean)} instead") - fun setLightStatusBar(view: View, isLight: Boolean) { - if (Build.VERSION.SDK_INT >= VERSION_CODES.M) { - var flags = view.systemUiVisibility - flags = if (isLight) { - flags or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR - } else { - flags and View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR.inv() - } - view.systemUiVisibility = flags - } - } } } diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index 60279fa17b..46e28ece02 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -23,8 +23,6 @@ --> diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index a568f7c097..d35c62cd6a 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -21,8 +21,6 @@ @@ -33,8 +31,6 @@