diff --git a/app/data/data-product-variant/data-product-variant-public/src/main/kotlin/com/hedvig/android/data/productvariant/ProductVariant.kt b/app/data/data-product-variant/data-product-variant-public/src/main/kotlin/com/hedvig/android/data/productvariant/ProductVariant.kt index ec412affea..407944e9c2 100644 --- a/app/data/data-product-variant/data-product-variant-public/src/main/kotlin/com/hedvig/android/data/productvariant/ProductVariant.kt +++ b/app/data/data-product-variant/data-product-variant-public/src/main/kotlin/com/hedvig/android/data/productvariant/ProductVariant.kt @@ -108,12 +108,13 @@ fun ProductVariantFragment.toProductVariant() = ProductVariant( url = document.url, type = @Suppress("ktlint:standard:max-line-length") when (document.type) { - InsuranceDocumentType.TERMS_AND_CONDITIONS -> com.hedvig.android.data.productvariant.InsuranceVariantDocument.InsuranceDocumentType.TERMS_AND_CONDITIONS - InsuranceDocumentType.PRE_SALE_INFO_EU_STANDARD -> com.hedvig.android.data.productvariant.InsuranceVariantDocument.InsuranceDocumentType.PRE_SALE_INFO_EU_STANDARD - InsuranceDocumentType.PRE_SALE_INFO -> com.hedvig.android.data.productvariant.InsuranceVariantDocument.InsuranceDocumentType.PRE_SALE_INFO - InsuranceDocumentType.GENERAL_TERMS -> com.hedvig.android.data.productvariant.InsuranceVariantDocument.InsuranceDocumentType.GENERAL_TERMS - InsuranceDocumentType.PRIVACY_POLICY -> com.hedvig.android.data.productvariant.InsuranceVariantDocument.InsuranceDocumentType.PRIVACY_POLICY - InsuranceDocumentType.UNKNOWN__ -> com.hedvig.android.data.productvariant.InsuranceVariantDocument.InsuranceDocumentType.UNKNOWN__ + InsuranceDocumentType.TERMS_AND_CONDITIONS -> InsuranceVariantDocument.InsuranceDocumentType.TERMS_AND_CONDITIONS + InsuranceDocumentType.PRE_SALE_INFO_EU_STANDARD -> InsuranceVariantDocument.InsuranceDocumentType.PRE_SALE_INFO_EU_STANDARD + InsuranceDocumentType.PRE_SALE_INFO -> InsuranceVariantDocument.InsuranceDocumentType.PRE_SALE_INFO + InsuranceDocumentType.GENERAL_TERMS -> InsuranceVariantDocument.InsuranceDocumentType.GENERAL_TERMS + InsuranceDocumentType.PRIVACY_POLICY -> InsuranceVariantDocument.InsuranceDocumentType.PRIVACY_POLICY + InsuranceDocumentType.UNKNOWN__ -> InsuranceVariantDocument.InsuranceDocumentType.UNKNOWN__ + InsuranceDocumentType.SCAR_TABLE -> InsuranceVariantDocument.InsuranceDocumentType.UNKNOWN__ }, ) }, diff --git a/app/feature/feature-delete-account/build.gradle.kts b/app/feature/feature-delete-account/build.gradle.kts index fd9691ddd4..1a80da9f34 100644 --- a/app/feature/feature-delete-account/build.gradle.kts +++ b/app/feature/feature-delete-account/build.gradle.kts @@ -20,7 +20,6 @@ dependencies { implementation(libs.arrow.core) implementation(libs.compose.richtext) implementation(libs.compose.richtextCommonmark) - implementation(libs.compose.richtextMaterial) implementation(libs.coroutines.core) implementation(libs.koin.compose) implementation(libs.koin.core) @@ -28,10 +27,9 @@ dependencies { implementation(projects.apolloCore) implementation(projects.apolloOctopusPublic) implementation(projects.authCorePublic) + implementation(projects.designSystemHedvig) implementation(projects.coreCommonPublic) - implementation(projects.coreDesignSystem) implementation(projects.coreResources) - implementation(projects.coreUi) implementation(projects.moleculeAndroid) implementation(projects.moleculePublic) implementation(projects.navigationCommon) diff --git a/app/feature/feature-delete-account/src/main/kotlin/com/hedvig/android/feature/deleteaccount/DeleteAccountDestination.kt b/app/feature/feature-delete-account/src/main/kotlin/com/hedvig/android/feature/deleteaccount/DeleteAccountDestination.kt index 1e10560f7b..bdf074f943 100644 --- a/app/feature/feature-delete-account/src/main/kotlin/com/hedvig/android/feature/deleteaccount/DeleteAccountDestination.kt +++ b/app/feature/feature-delete-account/src/main/kotlin/com/hedvig/android/feature/deleteaccount/DeleteAccountDestination.kt @@ -6,11 +6,6 @@ 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.material3.ButtonColors -import androidx.compose.material3.ButtonDefaults -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Surface -import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier @@ -20,13 +15,16 @@ import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameter import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.halilibo.richtext.commonmark.Markdown -import com.halilibo.richtext.ui.material3.RichText -import com.hedvig.android.core.designsystem.component.button.HedvigContainedButton -import com.hedvig.android.core.designsystem.component.error.HedvigErrorSection -import com.hedvig.android.core.designsystem.component.progress.HedvigFullScreenCenterAlignedProgress -import com.hedvig.android.core.designsystem.preview.HedvigPreview -import com.hedvig.android.core.designsystem.theme.HedvigTheme -import com.hedvig.android.core.ui.scaffold.HedvigScaffold +import com.hedvig.android.design.system.hedvig.HedvigButton +import com.hedvig.android.design.system.hedvig.HedvigErrorSection +import com.hedvig.android.design.system.hedvig.HedvigFullScreenCenterAlignedProgress +import com.hedvig.android.design.system.hedvig.HedvigPreview +import com.hedvig.android.design.system.hedvig.HedvigRedTextButton +import com.hedvig.android.design.system.hedvig.HedvigScaffold +import com.hedvig.android.design.system.hedvig.HedvigText +import com.hedvig.android.design.system.hedvig.HedvigTheme +import com.hedvig.android.design.system.hedvig.RichText +import com.hedvig.android.design.system.hedvig.Surface import com.hedvig.android.feature.chat.DeleteAccountViewModel import hedvig.resources.R @@ -71,6 +69,7 @@ private fun DeleteAccountScreen( buttonText = stringResource(R.string.general_back_button), onButtonClick = navigateBack, modifier = Modifier.weight(1f), + isButtonRed = false, ) } @@ -85,10 +84,7 @@ private fun DeleteAccountScreen( onButtonClick = initiateAccountDeletion, modifier = Modifier.weight(1f), isButtonLoading = uiState.isPerformingDeletion, - buttonColors = ButtonDefaults.buttonColors( - containerColor = MaterialTheme.colorScheme.error, - contentColor = MaterialTheme.colorScheme.onError, - ), + isButtonRed = true, ) } } @@ -102,20 +98,15 @@ private fun DeleteScreenContents( description: String, buttonText: String, onButtonClick: () -> Unit, + isButtonRed: Boolean, modifier: Modifier = Modifier, isButtonLoading: Boolean = false, - buttonColors: ButtonColors = ButtonDefaults.buttonColors( - containerColor = MaterialTheme.colorScheme.primary, - contentColor = MaterialTheme.colorScheme.onPrimary, - disabledContainerColor = MaterialTheme.colorScheme.primary.copy(alpha = 0.12f), - disabledContentColor = MaterialTheme.colorScheme.onPrimary.copy(alpha = 0.38f), - ), ) { Column(modifier) { Spacer(Modifier.height(16.dp)) - Text( + HedvigText( text = title, - style = MaterialTheme.typography.headlineMedium, + style = HedvigTheme.typography.headlineMedium, modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), @@ -133,15 +124,26 @@ private fun DeleteScreenContents( Spacer(Modifier.height(16.dp)) Spacer(Modifier.weight(1f)) Spacer(Modifier.height(8.dp)) - HedvigContainedButton( - text = buttonText, - onClick = onButtonClick, - isLoading = isButtonLoading, - colors = buttonColors, - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 16.dp), - ) + if (isButtonRed) { + HedvigRedTextButton( + text = buttonText, + onClick = onButtonClick, + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 16.dp), + ) + } else { + HedvigButton( + text = buttonText, + onClick = onButtonClick, + enabled = true, + isLoading = isButtonLoading, + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 16.dp), + ) + } + Spacer(Modifier.height(16.dp)) } } @@ -160,8 +162,10 @@ private fun DeleteAccountUiState.CanNotDelete.descriptionStringRes(): Int { return when (this) { DeleteAccountUiState.CanNotDelete.AlreadyRequestedDeletion -> R.string.DELETE_ACCOUNT_PROCESSED_DESCRIPTION + DeleteAccountUiState.CanNotDelete.HasActiveInsurance -> R.string.DELETE_ACCOUNT_YOU_HAVE_ACTIVE_INSURANCE_DESCRIPTION + DeleteAccountUiState.CanNotDelete.HasOngoingClaim -> R.string.DELETE_ACCOUNT_YOU_HAVE_ACTIVE_CLAIM_DESCRIPTION } @@ -173,7 +177,7 @@ private fun PreviewDeleteAccountScreen( @PreviewParameter(DeleteAccountUiStateProvider::class) uiState: DeleteAccountUiState, ) { HedvigTheme { - Surface(color = MaterialTheme.colorScheme.background) { + Surface(color = HedvigTheme.colorScheme.backgroundPrimary) { DeleteAccountScreen(uiState, {}, {}, {}, {}) } } diff --git a/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/insurancedetail/ContractDetailDestination.kt b/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/insurancedetail/ContractDetailDestination.kt index c1b1d02d98..cd81c67e28 100644 --- a/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/insurancedetail/ContractDetailDestination.kt +++ b/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/insurancedetail/ContractDetailDestination.kt @@ -343,7 +343,7 @@ private fun PagerSelector(pagerState: PagerState, modifier: Modifier = Modifier) } }, modifier = modifier.fillMaxWidth(), - tabSize = TabSize.Medium, + tabSize = TabSize.Small, tabStyle = Filled, ) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4acd847e52..3db8d9fbe8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -53,8 +53,8 @@ coil = "2.7.0" composeRichtext = "1.0.0-alpha01" coreLibraryDesugaring = "2.1.3" coroutines = "1.9.0" -datadog = "2.15.1" -dependencyAnalysis = "2.4.2" +datadog = "2.16.0" +dependencyAnalysis = "2.5.0" firebaseCrashlyticsBuildtools = "3.0.2" hedvigAuthlib = "1.4.3" junit = "4.13.2"