diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenMediumTopAppBar.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenMediumTopAppBar.kt index dd6f4039fe4..e072fe9c921 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenMediumTopAppBar.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenMediumTopAppBar.kt @@ -1,6 +1,11 @@ package com.x8bit.bitwarden.ui.platform.components.appbar import androidx.compose.foundation.layout.RowScope +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.WindowInsetsSides +import androidx.compose.foundation.layout.add +import androidx.compose.foundation.layout.displayCutout +import androidx.compose.foundation.layout.only import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.MediumTopAppBar import androidx.compose.material3.Text @@ -47,6 +52,9 @@ fun BitwardenMediumTopAppBar( actions: @Composable RowScope.() -> Unit = {}, ) { TopAppBar( + windowInsets = TopAppBarDefaults.windowInsets.add( + WindowInsets.displayCutout.only(WindowInsetsSides.Horizontal), + ), colors = bitwardenTopAppBarColors(), scrollBehavior = scrollBehavior, expandedHeight = 56.dp, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenSearchTopAppBar.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenSearchTopAppBar.kt index 6e0049490d9..20315d3b3c3 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenSearchTopAppBar.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenSearchTopAppBar.kt @@ -1,11 +1,17 @@ package com.x8bit.bitwarden.ui.platform.components.appbar +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.WindowInsetsSides +import androidx.compose.foundation.layout.add +import androidx.compose.foundation.layout.displayCutout import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.only import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Text import androidx.compose.material3.TextField import androidx.compose.material3.TopAppBar +import androidx.compose.material3.TopAppBarDefaults import androidx.compose.material3.TopAppBarScrollBehavior import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect @@ -49,6 +55,9 @@ fun BitwardenSearchTopAppBar( modifier = modifier .testTag(tag = "HeaderBarComponent") .bottomDivider(), + windowInsets = TopAppBarDefaults.windowInsets.add( + WindowInsets.displayCutout.only(WindowInsetsSides.Horizontal), + ), colors = bitwardenTopAppBarColors(), scrollBehavior = scrollBehavior, navigationIcon = { diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenTopAppBar.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenTopAppBar.kt index 4291eee46d6..3ac79a4d401 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenTopAppBar.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/appbar/BitwardenTopAppBar.kt @@ -1,6 +1,11 @@ package com.x8bit.bitwarden.ui.platform.components.appbar import androidx.compose.foundation.layout.RowScope +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.WindowInsetsSides +import androidx.compose.foundation.layout.add +import androidx.compose.foundation.layout.displayCutout +import androidx.compose.foundation.layout.only import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.MediumTopAppBar import androidx.compose.material3.Text @@ -129,6 +134,9 @@ fun BitwardenTopAppBar( if (titleTextHasOverflow) { MediumTopAppBar( + windowInsets = TopAppBarDefaults.windowInsets.add( + WindowInsets.displayCutout.only(WindowInsetsSides.Horizontal), + ), colors = bitwardenTopAppBarColors(), scrollBehavior = scrollBehavior, navigationIcon = navigationIconContent, @@ -149,6 +157,9 @@ fun BitwardenTopAppBar( ) } else { TopAppBar( + windowInsets = TopAppBarDefaults.windowInsets.add( + WindowInsets.displayCutout.only(WindowInsetsSides.Horizontal), + ), colors = bitwardenTopAppBarColors(), scrollBehavior = scrollBehavior, navigationIcon = navigationIconContent, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/scaffold/BitwardenScaffold.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/scaffold/BitwardenScaffold.kt index 3804d665387..8e3a13fdbd5 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/scaffold/BitwardenScaffold.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/components/scaffold/BitwardenScaffold.kt @@ -3,10 +3,15 @@ package com.x8bit.bitwarden.ui.platform.components.scaffold import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.WindowInsetsSides +import androidx.compose.foundation.layout.displayCutout +import androidx.compose.foundation.layout.displayCutoutPadding import androidx.compose.foundation.layout.exclude import androidx.compose.foundation.layout.navigationBars import androidx.compose.foundation.layout.navigationBarsPadding +import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.FabPosition import androidx.compose.material3.Scaffold @@ -42,7 +47,7 @@ fun BitwardenScaffold( contentColor: Color = BitwardenTheme.colorScheme.text.primary, contentWindowInsets: WindowInsets = ScaffoldDefaults .contentWindowInsets - .exclude(WindowInsets.navigationBars), + .exclude(WindowInsets.navigationBars.only(WindowInsetsSides.Vertical)), content: @Composable (PaddingValues) -> Unit, ) { Scaffold( @@ -53,7 +58,11 @@ fun BitwardenScaffold( bottomBar = bottomBar, snackbarHost = snackbarHost, floatingActionButton = { - Box(modifier = Modifier.navigationBarsPadding()) { + Box( + modifier = Modifier + .navigationBarsPadding() + .displayCutoutPadding(), + ) { floatingActionButton() } }, @@ -64,12 +73,16 @@ fun BitwardenScaffold( content = { paddingValues -> val internalPullToRefreshState = rememberPullToRefreshState() Box( - modifier = Modifier.pullToRefresh( - state = internalPullToRefreshState, - isRefreshing = pullToRefreshState.isRefreshing, - onRefresh = pullToRefreshState.onRefresh, - enabled = pullToRefreshState.isEnabled, - ), + modifier = Modifier + .windowInsetsPadding( + insets = WindowInsets.displayCutout.only(WindowInsetsSides.Horizontal), + ) + .pullToRefresh( + state = internalPullToRefreshState, + isRefreshing = pullToRefreshState.isRefreshing, + onRefresh = pullToRefreshState.onRefresh, + enabled = pullToRefreshState.isEnabled, + ), ) { content(paddingValues) diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/vaultunlockednavbar/VaultUnlockedNavBarScreen.kt b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/vaultunlockednavbar/VaultUnlockedNavBarScreen.kt index 1a3b029cdac..a3e438a9c09 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/vaultunlockednavbar/VaultUnlockedNavBarScreen.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/vaultunlockednavbar/VaultUnlockedNavBarScreen.kt @@ -2,16 +2,15 @@ package com.x8bit.bitwarden.ui.platform.feature.vaultunlockednavbar import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.WindowInsetsSides import androidx.compose.foundation.layout.consumeWindowInsets -import androidx.compose.foundation.layout.exclude import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.ime import androidx.compose.foundation.layout.navigationBars +import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.statusBars import androidx.compose.material3.BottomAppBar -import androidx.compose.material3.ScaffoldDefaults import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableIntStateOf @@ -21,6 +20,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.platform.testTag +import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.navigation.NavBackStackEntry @@ -177,10 +177,9 @@ private fun VaultUnlockedNavBarScaffold( var shouldDimNavBar by remember { mutableStateOf(false) } // This scaffold will host screens that contain top bars while not hosting one itself. - // We need to ignore the status bar insets here and let the content screens handle - // it themselves. + // We need to ignore the all insets here and let the content screens handle it themselves. BitwardenScaffold( - contentWindowInsets = ScaffoldDefaults.contentWindowInsets.exclude(WindowInsets.statusBars), + contentWindowInsets = WindowInsets(0.dp), bottomBar = { Box { var appBarHeightPx by remember { mutableIntStateOf(0) } @@ -210,13 +209,13 @@ private fun VaultUnlockedNavBarScaffold( }, ) { innerPadding -> // Because this Scaffold has a bottom navigation bar, the NavHost will: - // - consume the navigation bar insets. + // - consume the vertical navigation bar insets. // - consume the IME insets. NavHost( navController = navController, startDestination = VAULT_GRAPH_ROUTE, modifier = Modifier - .consumeWindowInsets(WindowInsets.navigationBars) + .consumeWindowInsets(WindowInsets.navigationBars.only(WindowInsetsSides.Vertical)) .consumeWindowInsets(WindowInsets.ime) .padding(innerPadding.max(WindowInsets.ime)), enterTransition = RootTransitionProviders.Enter.fadeIn, diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5acfbc730b9..e94cc6788d7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,8 +2,8 @@ [versions] # SDK Versions -compileSdk = "34" -targetSdk = "34" +compileSdk = "35" +targetSdk = "35" minSdk = "29" # Dependency Versions @@ -13,17 +13,17 @@ androidXBiometrics = "1.2.0-alpha05" androidxBrowser = "1.8.0" androidxCamera = "1.4.0" androidxComposeBom = "2024.10.01" -androidxCore = "1.13.1" +androidxCore = "1.15.0" androidxCredentials = "1.3.0" androidxHiltNavigationCompose = "1.2.0" -androidxLifecycle = "2.8.6" +androidxLifecycle = "2.8.7" androidxNavigation = "2.8.0" androidxRoom = "2.6.1" androidXSecurityCrypto = "1.1.0-alpha06" androidxSplash = "1.1.0-rc01" androidXAppCompat = "1.7.0" androdixAutofill = "1.1.0" -androidxWork = "2.9.1" +androidxWork = "2.10.0" bitwardenSdk = "1.0.0-20241030.101847-8" crashlytics = "3.0.2" detekt = "1.23.7"