From bca0d1d9654452ec2c7a2a022f0de02ae13b8ae2 Mon Sep 17 00:00:00 2001 From: Artem Chepurnoy Date: Sat, 30 Dec 2023 11:44:38 +0200 Subject: [PATCH] refactor: Use Skeleton item as a loader component of Confirmation dialogs --- .../feature/confirmation/ConfirmationScreen.kt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/confirmation/ConfirmationScreen.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/confirmation/ConfirmationScreen.kt index f49c4545..eb667025 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/confirmation/ConfirmationScreen.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/confirmation/ConfirmationScreen.kt @@ -6,13 +6,13 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.ExperimentalLayoutApi import androidx.compose.foundation.layout.FlowRow import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.Info import androidx.compose.material3.Checkbox -import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.Icon import androidx.compose.material3.LocalContentColor import androidx.compose.material3.LocalTextStyle @@ -24,7 +24,6 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.key import androidx.compose.runtime.remember import androidx.compose.runtime.rememberUpdatedState -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.input.KeyboardType @@ -48,6 +47,7 @@ import com.artemchep.keyguard.ui.FlatItemLayout import com.artemchep.keyguard.ui.FlatTextField import com.artemchep.keyguard.ui.MediumEmphasisAlpha import com.artemchep.keyguard.ui.PasswordStrengthBadge +import com.artemchep.keyguard.ui.skeleton.SkeletonItem import com.artemchep.keyguard.ui.theme.Dimens import com.artemchep.keyguard.ui.theme.combineAlpha import com.artemchep.keyguard.ui.theme.monoFontFamily @@ -86,7 +86,10 @@ fun ConfirmationScreen( content = if (showContent) { // composable { - Column { + Column( + modifier = Modifier + .fillMaxWidth(), + ) { val items = state.items.getOrNull().orEmpty() if (args.message != null) { Text( @@ -112,11 +115,7 @@ fun ConfirmationScreen( } if (state.items is Loadable.Loading) { - CircularProgressIndicator( - modifier = Modifier - .align(Alignment.CenterHorizontally) - .padding(16.dp), - ) + SkeletonItem() } } }