diff --git a/app/core/core-resources/src/androidMain/res/values-sv-rSE/strings.xml b/app/core/core-resources/src/androidMain/res/values-sv-rSE/strings.xml index 68970be8b3..2f044f7c15 100644 --- a/app/core/core-resources/src/androidMain/res/values-sv-rSE/strings.xml +++ b/app/core/core-resources/src/androidMain/res/values-sv-rSE/strings.xml @@ -513,7 +513,6 @@ Hedvig Läs mer Upptäck våra försäkringar - Se pris Hur kan vi hjälpa dig? Hej %1$s Ändra adress @@ -663,7 +662,6 @@ Kunde inte spara, försök igen Så vi kan nå dig om det behövs Telefonnummer - Se pris Alltid mörkt läge Alltid ljust läge Välj hur appen ska se ut diff --git a/app/core/core-resources/src/androidMain/res/values/strings.xml b/app/core/core-resources/src/androidMain/res/values/strings.xml index 8ee6ac1426..35b62d4efc 100644 --- a/app/core/core-resources/src/androidMain/res/values/strings.xml +++ b/app/core/core-resources/src/androidMain/res/values/strings.xml @@ -513,7 +513,6 @@ Hedvig Read more Discover our insurances - See price How can we help? Hi %1$s Change address @@ -663,7 +662,6 @@ Could not save, please try again So we can reach you if we need to Phone number - See price Always dark Always light Choose how the app looks diff --git a/app/core/core-resources/src/commonMain/composeResources/values-sv-rSE/strings.xml b/app/core/core-resources/src/commonMain/composeResources/values-sv-rSE/strings.xml index 71e5c23b81..b94e0cb675 100644 --- a/app/core/core-resources/src/commonMain/composeResources/values-sv-rSE/strings.xml +++ b/app/core/core-resources/src/commonMain/composeResources/values-sv-rSE/strings.xml @@ -512,7 +512,6 @@ Hedvig Läs mer Upptäck våra försäkringar - Se pris Hur kan vi hjälpa dig? Hej %1$s Ändra adress @@ -662,7 +661,6 @@ Kunde inte spara, försök igen Så vi kan nå dig om det behövs Telefonnummer - Se pris Alltid mörkt läge Alltid ljust läge Välj hur appen ska se ut diff --git a/app/core/core-resources/src/commonMain/composeResources/values/strings.xml b/app/core/core-resources/src/commonMain/composeResources/values/strings.xml index 256355ad6d..680f424013 100644 --- a/app/core/core-resources/src/commonMain/composeResources/values/strings.xml +++ b/app/core/core-resources/src/commonMain/composeResources/values/strings.xml @@ -512,7 +512,6 @@ Hedvig Read more Discover our insurances - See price How can we help? Hi %1$s Change address @@ -662,7 +661,6 @@ Could not save, please try again So we can reach you if we need to Phone number - See price Always dark Always light Choose how the app looks diff --git a/app/data/data-contract/src/commonMain/kotlin/com/hedvig/android/data/contract/CrossSell.kt b/app/data/data-contract/src/commonMain/kotlin/com/hedvig/android/data/contract/CrossSell.kt index 403a7f10ab..f3d3b38b20 100644 --- a/app/data/data-contract/src/commonMain/kotlin/com/hedvig/android/data/contract/CrossSell.kt +++ b/app/data/data-contract/src/commonMain/kotlin/com/hedvig/android/data/contract/CrossSell.kt @@ -13,7 +13,7 @@ data class CrossSell( val storeUrl: String, val pillowImageSmall: ImageAsset, val pillowImageLarge: ImageAsset, - val buttonText: String? = null, // todo!! + val buttonText: String, ) data class ImageAsset( diff --git a/app/feature/feature-cross-sell-sheet/src/main/graphql/QueryBottomSheetCrossSells.graphql b/app/feature/feature-cross-sell-sheet/src/main/graphql/QueryBottomSheetCrossSells.graphql index ef28cbf869..8c0a4e9e17 100644 --- a/app/feature/feature-cross-sell-sheet/src/main/graphql/QueryBottomSheetCrossSells.graphql +++ b/app/feature/feature-cross-sell-sheet/src/main/graphql/QueryBottomSheetCrossSells.graphql @@ -47,6 +47,7 @@ fragment CrossSellFragment on CrossSell { title description storeUrl + buttonTitle pillowImageSmall { src id diff --git a/app/feature/feature-cross-sell-sheet/src/main/kotlin/com/hedvig/android/feature/cross/sell/sheet/CrossSellSheetViewModel.kt b/app/feature/feature-cross-sell-sheet/src/main/kotlin/com/hedvig/android/feature/cross/sell/sheet/CrossSellSheetViewModel.kt index 025d3cfa0a..aaa2e4d530 100644 --- a/app/feature/feature-cross-sell-sheet/src/main/kotlin/com/hedvig/android/feature/cross/sell/sheet/CrossSellSheetViewModel.kt +++ b/app/feature/feature-cross-sell-sheet/src/main/kotlin/com/hedvig/android/feature/cross/sell/sheet/CrossSellSheetViewModel.kt @@ -229,6 +229,7 @@ internal fun CrossSellFragment.toCrossSell(): CrossSell { src = pillowImageLarge.src, description = pillowImageLarge.alt, ), + buttonText = this.buttonTitle, ) } } diff --git a/app/feature/feature-home/src/main/graphql/QueryHome.graphql b/app/feature/feature-home/src/main/graphql/QueryHome.graphql index 4dbed4558a..c738b8364a 100644 --- a/app/feature/feature-home/src/main/graphql/QueryHome.graphql +++ b/app/feature/feature-home/src/main/graphql/QueryHome.graphql @@ -127,6 +127,7 @@ fragment HomeCrossSellFragment on CrossSell { title description storeUrl + buttonTitle pillowImageSmall { src id diff --git a/app/feature/feature-home/src/main/kotlin/com/hedvig/android/feature/home/home/data/GetHomeDataUseCase.kt b/app/feature/feature-home/src/main/kotlin/com/hedvig/android/feature/home/home/data/GetHomeDataUseCase.kt index 1c3993b0a6..3710dc5ac8 100644 --- a/app/feature/feature-home/src/main/kotlin/com/hedvig/android/feature/home/home/data/GetHomeDataUseCase.kt +++ b/app/feature/feature-home/src/main/kotlin/com/hedvig/android/feature/home/home/data/GetHomeDataUseCase.kt @@ -312,6 +312,7 @@ internal class GetHomeDataUseCaseImpl( src = pillowImageLarge.src, description = pillowImageLarge.alt, ), + buttonText = this.buttonTitle, ) } } diff --git a/app/feature/feature-home/src/main/kotlin/com/hedvig/android/feature/home/home/data/GetHomeDataUseCaseDemo.kt b/app/feature/feature-home/src/main/kotlin/com/hedvig/android/feature/home/home/data/GetHomeDataUseCaseDemo.kt index 87a2c229be..c572e246f5 100644 --- a/app/feature/feature-home/src/main/kotlin/com/hedvig/android/feature/home/home/data/GetHomeDataUseCaseDemo.kt +++ b/app/feature/feature-home/src/main/kotlin/com/hedvig/android/feature/home/home/data/GetHomeDataUseCaseDemo.kt @@ -34,6 +34,7 @@ private val demoCarCrossSell = CrossSell( "", ImageAsset("", "", ""), ImageAsset("", "", ""), + buttonText = "See price", ) private val demoPetCrossSell = CrossSell( @@ -43,6 +44,7 @@ private val demoPetCrossSell = CrossSell( "", ImageAsset("", "", ""), ImageAsset("", "", ""), + buttonText = "See price", ) private val demoHomeData = HomeData( diff --git a/app/feature/feature-home/src/main/kotlin/com/hedvig/android/feature/home/home/ui/HomeDestination.kt b/app/feature/feature-home/src/main/kotlin/com/hedvig/android/feature/home/home/ui/HomeDestination.kt index 5f337228cc..1016a91ad5 100644 --- a/app/feature/feature-home/src/main/kotlin/com/hedvig/android/feature/home/home/ui/HomeDestination.kt +++ b/app/feature/feature-home/src/main/kotlin/com/hedvig/android/feature/home/home/ui/HomeDestination.kt @@ -213,7 +213,6 @@ import hedvig.resources.HC_QUICK_ACTIONS_UPGRADE_COVERAGE_SUBTITLE import hedvig.resources.HC_QUICK_ACTIONS_UPGRADE_COVERAGE_TITLE import hedvig.resources.HOME_ADDONS_READ_MORE_BUTTON import hedvig.resources.HOME_DISCOVER_SECTION_TITLE -import hedvig.resources.HOME_DISCOVER_SEE_PRICE_BUTTON import hedvig.resources.HOME_GREETING_SUBTITLE import hedvig.resources.HOME_GREETING_TITLE import hedvig.resources.HOME_QUOTES_SECTION_TITLE @@ -1556,7 +1555,6 @@ private fun DiscoverInsurancesSection( modifier = Modifier.padding(horizontal = 16.dp), onSheetDismissed = {}, imageLoader = imageLoader, - buttonText = stringResource(string.HOME_DISCOVER_SEE_PRICE_BUTTON), buttonSize = ButtonSize.Small, buttonShape = HedvigTheme.shapes.cornerFull, ) @@ -1692,6 +1690,7 @@ private fun PreviewHomeScreen( "", ImageAsset("", "", ""), ImageAsset("", "", ""), + buttonText = "See price", ), bannerText = "50% discount the first year", discountText = "-50%", @@ -1708,6 +1707,7 @@ private fun PreviewHomeScreen( "", ImageAsset("", "", ""), ImageAsset("", "", ""), + buttonText = "See price", ), ), recommendedAddon = null, diff --git a/app/feature/feature-home/src/test/kotlin/com/hedvig/android/feature/home/home/ui/HomePresenterTest.kt b/app/feature/feature-home/src/test/kotlin/com/hedvig/android/feature/home/home/ui/HomePresenterTest.kt index 37d8eb6b90..2cce60208b 100644 --- a/app/feature/feature-home/src/test/kotlin/com/hedvig/android/feature/home/home/ui/HomePresenterTest.kt +++ b/app/feature/feature-home/src/test/kotlin/com/hedvig/android/feature/home/home/ui/HomePresenterTest.kt @@ -76,6 +76,7 @@ internal class HomePresenterTest { "url", ImageAsset("", "", ""), ImageAsset("", "", ""), + buttonText = "See price", ), bannerText = "50% discount the first year", buttonText = "Explore offer", @@ -539,6 +540,7 @@ internal class HomePresenterTest { subtitle = "subt", pillowImageSmall = ImageAsset("", "", ""), pillowImageLarge = ImageAsset("", "", ""), + buttonText = "See price", ) homePresenter.test(HomeUiState.Loading) { assertThat(awaitItem()).isEqualTo(HomeUiState.Loading) @@ -709,6 +711,7 @@ internal class HomePresenterTest { storeUrl = "url", pillowImageSmall = ImageAsset("", "", ""), pillowImageLarge = ImageAsset("", "", ""), + buttonText = "See price", ) homePresenter.test(HomeUiState.Loading) { assertThat(awaitItem()).isEqualTo(HomeUiState.Loading) diff --git a/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/data/GetCrossSellsUseCaseDemo.kt b/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/data/GetCrossSellsUseCaseDemo.kt index 5410950d54..5aa65c8665 100644 --- a/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/data/GetCrossSellsUseCaseDemo.kt +++ b/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/data/GetCrossSellsUseCaseDemo.kt @@ -24,6 +24,7 @@ internal class GetCrossSellsUseCaseDemo : GetCrossSellsUseCase { "", ImageAsset("", "", ""), ImageAsset("", "", ""), + buttonText = "button", ), CrossSell( "2", @@ -32,6 +33,7 @@ internal class GetCrossSellsUseCaseDemo : GetCrossSellsUseCase { "", ImageAsset("", "", ""), ImageAsset("", "", ""), + buttonText = "button", ), CrossSell( "3", @@ -40,6 +42,7 @@ internal class GetCrossSellsUseCaseDemo : GetCrossSellsUseCase { "", ImageAsset("", "", ""), ImageAsset("", "", ""), + buttonText = "button", ), CrossSell( "4", @@ -48,6 +51,7 @@ internal class GetCrossSellsUseCaseDemo : GetCrossSellsUseCase { "", ImageAsset("", "", ""), ImageAsset("", "", ""), + buttonText = "button", ), ), ) diff --git a/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/insurance/InsuranceDestination.kt b/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/insurance/InsuranceDestination.kt index 9390b1127e..33972876f2 100644 --- a/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/insurance/InsuranceDestination.kt +++ b/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/insurance/InsuranceDestination.kt @@ -38,8 +38,6 @@ import androidx.compose.ui.layout.SubcomposeLayout import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.semantics.Role import androidx.compose.ui.semantics.heading -import androidx.compose.ui.semantics.onClick -import androidx.compose.ui.semantics.role import androidx.compose.ui.semantics.semantics import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider @@ -530,6 +528,7 @@ private fun PreviewInsuranceScreen( storeUrl = "", ImageAsset("", "", ""), ImageAsset("", "", ""), + buttonText = "button", ) }, quantityOfCancelledInsurances = 1, @@ -622,6 +621,7 @@ private class InsuranceUiStateProvider : CollectionPreviewParameterProvider "${item.title} - ${item.subtitle}" } val description = "$dataDescription; " + pluralStringResource( - Res.plurals.A11Y_NUMBER_OF_ELIGIBLE_INSURANCES, + plurals.A11Y_NUMBER_OF_ELIGIBLE_INSURANCES, recommendedCrossSell.bundleProgress.numberOfEligibleContracts, recommendedCrossSell.bundleProgress.numberOfEligibleContracts, ) @@ -504,7 +511,7 @@ private fun RecommendationSection( onCrossSellClick(recommendedCrossSell.crossSell.storeUrl) dismissSheet() }, - onClickLabel = stringResource(Res.string.TALKBACK_OPEN_EXTERNAL_LINK), + onClickLabel = stringResource(string.TALKBACK_OPEN_EXTERNAL_LINK), enabled = true, modifier = Modifier .fillMaxWidth() @@ -561,8 +568,8 @@ private fun StackedPillows(recommendedCrossSell: RecommendedCrossSell, imageLoad if (recommendedCrossSell.discountText != null) { HighlightLabel( labelText = recommendedCrossSell.discountText, - size = HighlightLabelDefaults.HighLightSize.Small, - color = HighlightLabelDefaults.HighlightColor.Green(HighlightLabelDefaults.HighlightShade.LIGHT), + size = Small, + color = Green(HighlightShade.LIGHT), modifier = Modifier .align(Alignment.TopEnd) .padding(top = 16.dp), @@ -587,16 +594,16 @@ private fun StackedPillows(recommendedCrossSell: RecommendedCrossSell, imageLoad @Composable private fun getHedvigStepProgressData(bundleProgress: BundleProgress): List { - val firstStepTitle = stringResource(Res.string.BUNDLE_DISCOUNT_PROGRESS_SEGMENT_TITLE_ONE_INSURANCE) - val firstStepSubtitle = stringResource(Res.string.BUNDLE_DISCOUNT_PROGRESS_SEGMENT_SUBTITLE_NO_DISCOUNT) + val firstStepTitle = stringResource(string.BUNDLE_DISCOUNT_PROGRESS_SEGMENT_TITLE_ONE_INSURANCE) + val firstStepSubtitle = stringResource(string.BUNDLE_DISCOUNT_PROGRESS_SEGMENT_SUBTITLE_NO_DISCOUNT) val stepOne = StepProgressItem(firstStepTitle, firstStepSubtitle) - val secondStepTitle = stringResource(Res.string.BUNDLE_DISCOUNT_PROGRESS_SEGMENT_TITLE_TWO_INSURANCES) + val secondStepTitle = stringResource(string.BUNDLE_DISCOUNT_PROGRESS_SEGMENT_TITLE_TWO_INSURANCES) val secondStepSubtitle = stringResource( - Res.string.BUNDLE_DISCOUNT_PROGRESS_SEGMENT_SUBTITLE_CURRENT_APPLIED_DISCOUNT, + string.BUNDLE_DISCOUNT_PROGRESS_SEGMENT_SUBTITLE_CURRENT_APPLIED_DISCOUNT, "${bundleProgress.discountPercent}%", ) val stepTwo = StepProgressItem(secondStepTitle, secondStepSubtitle) - val thirdStepTitle = stringResource(Res.string.BUNDLE_DISCOUNT_PROGRESS_SEGMENT_TITLE_THREE_OR_MORE) + val thirdStepTitle = stringResource(string.BUNDLE_DISCOUNT_PROGRESS_SEGMENT_TITLE_THREE_OR_MORE) val stepThree = StepProgressItem(thirdStepTitle, secondStepSubtitle) return listOf(stepOne, stepTwo, stepThree) } @@ -611,8 +618,7 @@ fun CrossSellsSection( withSubHeader: Boolean = true, hasCrossSellDiscounts: Boolean = false, title: String? = null, - buttonText: String? = null, - buttonSize: ButtonDefaults.ButtonSize = ButtonDefaults.ButtonSize.Medium, + buttonSize: ButtonSize = ButtonSize.Medium, buttonShape: Shape? = null, ) { Column(modifier) { @@ -630,7 +636,7 @@ fun CrossSellsSection( imageLoader = imageLoader, crossSellImageAsset = crossSell.pillowImageSmall, onSheetDismissed = onSheetDismissed, - buttonText = crossSell.buttonText ?: buttonText, + buttonText = crossSell.buttonText, buttonSize = buttonSize, buttonShape = buttonShape, ) @@ -640,7 +646,6 @@ fun CrossSellsSection( onCrossSellClick, onSheetDismissed = onSheetDismissed, imageLoader = imageLoader, - buttonText = buttonText, buttonSize = buttonSize, buttonShape = buttonShape, ) @@ -666,6 +671,7 @@ fun CrossSellItemPlaceholder(imageLoader: ImageLoader, modifier: Modifier = Modi isLoading = true, modifier = Modifier, onSheetDismissed = {}, + buttonText = "button", ) } } @@ -674,7 +680,7 @@ fun CrossSellItemPlaceholder(imageLoader: ImageLoader, modifier: Modifier = Modi private fun CrossSellsSubHeaderWithDivider(title: String? = null) { Column { NotificationSubheading( - text = title ?: stringResource(Res.string.insurance_tab_cross_sells_title), + text = title ?: stringResource(string.insurance_tab_cross_sells_title), modifier = Modifier.semantics { heading() }, ) Spacer(Modifier.height(16.dp)) @@ -688,8 +694,7 @@ private fun CrossSellItem( onSheetDismissed: () -> Unit, imageLoader: ImageLoader, modifier: Modifier = Modifier, - buttonText: String? = null, - buttonSize: ButtonDefaults.ButtonSize = ButtonDefaults.ButtonSize.Medium, + buttonSize: ButtonSize = ButtonSize.Medium, buttonShape: Shape? = null, ) { CrossSellItem( @@ -702,9 +707,9 @@ private fun CrossSellItem( imageLoader = imageLoader, crossSellImageAsset = crossSell.pillowImageSmall, onSheetDismissed = onSheetDismissed, - buttonText = buttonText, buttonSize = buttonSize, buttonShape = buttonShape, + buttonText = crossSell.buttonText, ) } @@ -718,22 +723,22 @@ private fun CrossSellItem( isLoading: Boolean, imageLoader: ImageLoader, onSheetDismissed: () -> Unit, + buttonText: String, modifier: Modifier = Modifier, - buttonText: String? = null, - buttonSize: ButtonDefaults.ButtonSize = ButtonDefaults.ButtonSize.Medium, + buttonSize: ButtonSize = ButtonSize.Medium, buttonShape: Shape? = null, ) { PillowRow( title = crossSellTitle, subtitle = crossSellSubtitle, pillowImage = crossSellImageAsset, - buttonText = buttonText ?: stringResource(Res.string.cross_sell_get_price), + buttonText = buttonText, onButtonClick = { onCrossSellClick(storeUrl) onSheetDismissed() }, imageLoader = imageLoader, - onButtonClickLabel = stringResource(Res.string.TALKBACK_OPEN_EXTERNAL_LINK), + onButtonClickLabel = stringResource(string.TALKBACK_OPEN_EXTERNAL_LINK), isLoading = isLoading, modifier = modifier, buttonSize = buttonSize, @@ -756,9 +761,9 @@ fun PillowRow( imageLoader: ImageLoader, modifier: Modifier = Modifier, onButtonClickLabel: String? = null, - buttonStyle: ButtonDefaults.ButtonStyle = ButtonDefaults.ButtonStyle.Secondary, + buttonStyle: ButtonStyle = ButtonStyle.Secondary, isLoading: Boolean = false, - buttonSize: ButtonDefaults.ButtonSize = ButtonDefaults.ButtonSize.Medium, + buttonSize: ButtonSize = ButtonSize.Medium, buttonShape: Shape? = null, pillow: (@Composable () -> Unit)? = null, ) { @@ -846,7 +851,7 @@ private fun CrossSellItemWithDiscounts( imageLoader: ImageLoader, onSheetDismissed: () -> Unit, modifier: Modifier = Modifier, - buttonSize: ButtonDefaults.ButtonSize = ButtonDefaults.ButtonSize.Medium, + buttonSize: ButtonSize = ButtonSize.Medium, buttonShape: Shape? = null, ) { val description = "$crossSellTitle $crossSellSubtitle" @@ -900,14 +905,14 @@ private fun CrossSellItemWithDiscounts( } Spacer(Modifier.width(16.dp)) HedvigButton( - text = buttonText ?: stringResource(Res.string.cross_sell_get_price), + text = buttonText ?: stringResource(string.cross_sell_get_price), onClick = { onCrossSellClick(storeUrl) onSheetDismissed() }, - onClickLabel = stringResource(Res.string.TALKBACK_OPEN_EXTERNAL_LINK), + onClickLabel = stringResource(string.TALKBACK_OPEN_EXTERNAL_LINK), buttonSize = buttonSize, - buttonStyle = ButtonDefaults.ButtonStyle.PrimaryAlt, + buttonStyle = ButtonStyle.PrimaryAlt, shape = buttonShape, modifier = Modifier.hedvigPlaceholder( visible = isLoading, @@ -933,7 +938,7 @@ private fun NotificationSubheading(text: String, modifier: Modifier = Modifier) private fun CrossSellDragHandle( modifier: Modifier = Modifier, contentPadding: PaddingValues? = null, - text: String? = stringResource(Res.string.CROSS_SELL_BANNER_TEXT), + text: String? = stringResource(string.CROSS_SELL_BANNER_TEXT), ) { val direction = LocalLayoutDirection.current Box( @@ -994,6 +999,7 @@ private fun PreviewCrossSellsSheetContent( "", ImageAsset("", "", ""), ImageAsset("", "", ""), + buttonText = "button", ), bannerText = "50% discount the first year", buttonText = "Explore offer", @@ -1010,6 +1016,7 @@ private fun PreviewCrossSellsSheetContent( "", ImageAsset("", "", ""), ImageAsset("", "", ""), + buttonText = "button", ), ).takeIf { case != TripleCase.FIRST }.orEmpty(), onCrossSellClick = {}, @@ -1039,6 +1046,7 @@ private fun PreviewCrossSellsFloatingSheetContent( "", ImageAsset("", "", ""), ImageAsset("", "", ""), + buttonText = "button", ), bannerText = "50% discount the first year", buttonText = "Explore offer", @@ -1055,6 +1063,7 @@ private fun PreviewCrossSellsFloatingSheetContent( "", ImageAsset("", "", ""), ImageAsset("", "", ""), + buttonText = "button", ), ).takeIf { case != TripleCase.FIRST }.orEmpty(), dismissSheet = {}, @@ -1079,6 +1088,7 @@ private fun PreviewCrossSellsSection() { "storeUrl", ImageAsset("", "", ""), ImageAsset("", "", ""), + buttonText = "button", ) }, {},