diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingEmpty.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingEmpty.kt index 7c3fc7aeb..0dd96c2c1 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingEmpty.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingEmpty.kt @@ -2,7 +2,6 @@ package com.x8bit.bitwarden.ui.vault.feature.itemlisting import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.material3.MaterialTheme @@ -21,7 +20,6 @@ import com.x8bit.bitwarden.ui.vault.feature.vault.VaultNoItems */ @Composable fun VaultItemListingEmpty( - paddingValues: PaddingValues, itemListingType: VaultItemListingState.ItemListingType, addItemClickAction: () -> Unit, modifier: Modifier = Modifier, @@ -43,7 +41,7 @@ fun VaultItemListingEmpty( else -> { VaultNoItems( - paddingValues = paddingValues, + modifier = modifier, addItemClickAction = addItemClickAction, ) } diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingScreen.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingScreen.kt index d5d337ab7..fe3fa50c0 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingScreen.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingScreen.kt @@ -142,7 +142,6 @@ private fun VaultItemListingScaffold( is VaultItemListingState.ViewState.NoItems -> { VaultItemListingEmpty( - paddingValues = paddingValues, itemListingType = state.itemListingType, addItemClickAction = addVaultItemClick, modifier = modifier, diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultContent.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultContent.kt index b300c8eb6..df1c5bbaf 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultContent.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultContent.kt @@ -1,8 +1,6 @@ package com.x8bit.bitwarden.ui.vault.feature.vault -import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding @@ -32,12 +30,10 @@ fun VaultContent( identityGroupClick: () -> Unit, secureNoteGroupClick: () -> Unit, trashClick: () -> Unit, - paddingValues: PaddingValues, + modifier: Modifier = Modifier, ) { LazyColumn( - modifier = Modifier - .fillMaxSize() - .padding(paddingValues), + modifier = modifier, ) { if (state.favoriteItems.isNotEmpty()) { diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultLoading.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultLoading.kt index dcc675597..a98fe6b98 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultLoading.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultLoading.kt @@ -2,9 +2,6 @@ package com.x8bit.bitwarden.ui.vault.feature.vault import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.PaddingValues -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.padding import androidx.compose.material3.CircularProgressIndicator import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment @@ -14,11 +11,9 @@ import androidx.compose.ui.Modifier * Loading view for the [VaultScreen]. */ @Composable -fun VaultLoading(paddingValues: PaddingValues) { +fun VaultLoading(modifier: Modifier = Modifier) { Column( - modifier = Modifier - .fillMaxSize() - .padding(paddingValues), + modifier = modifier, verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally, ) { diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultNoItems.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultNoItems.kt index e1cbdcd5c..45db0c126 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultNoItems.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultNoItems.kt @@ -2,9 +2,7 @@ package com.x8bit.bitwarden.ui.vault.feature.vault import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding @@ -25,13 +23,11 @@ import com.x8bit.bitwarden.R */ @Composable fun VaultNoItems( - paddingValues: PaddingValues, addItemClickAction: () -> Unit, + modifier: Modifier = Modifier, ) { Column( - modifier = Modifier - .fillMaxSize() - .padding(paddingValues), + modifier = modifier, verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally, ) { diff --git a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultScreen.kt b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultScreen.kt index f25523268..443c4c948 100644 --- a/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultScreen.kt +++ b/app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/vault/VaultScreen.kt @@ -200,6 +200,9 @@ private fun VaultScreenScaffold( }, modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection), ) { paddingValues -> + val modifier = Modifier + .fillMaxSize() + .padding(paddingValues) Box { when (val viewState = state.viewState) { is VaultState.ViewState.Content -> VaultContent( @@ -211,12 +214,12 @@ private fun VaultScreenScaffold( identityGroupClick = identityGroupClick, secureNoteGroupClick = secureNoteGroupClick, trashClick = trashClick, - paddingValues = paddingValues, + modifier = modifier, ) - is VaultState.ViewState.Loading -> VaultLoading(paddingValues = paddingValues) + is VaultState.ViewState.Loading -> VaultLoading(modifier = modifier) is VaultState.ViewState.NoItems -> VaultNoItems( - paddingValues = paddingValues, + modifier = modifier, addItemClickAction = addItemClickAction, ) } @@ -231,9 +234,7 @@ private fun VaultScreenScaffold( onAddAccountClick = addAccountClickAction, onDismissRequest = { updateAccountMenuVisibility(false) }, topAppBarScrollBehavior = scrollBehavior, - modifier = Modifier - .fillMaxSize() - .padding(paddingValues), + modifier = modifier, ) } }