Bug 1837365 - Remove lifestyle image assets

fenix/118.0
t-p-white 10 months ago committed by mergify[bot]
parent af43fb7f16
commit 25066dee83

@ -81,10 +81,6 @@ objects:
description: The resource id of the image to be displayed.
# This should never be defaulted.
default: ic_onboarding_welcome
image-is-illustration:
type: Boolean
description: True if the image type is an illustration.
default: true
ordering:
type: Int
description: Used to sequence the cards.

@ -4,7 +4,6 @@
package org.mozilla.fenix.onboarding.view
import androidx.compose.ui.layout.ContentScale
import org.junit.Assert.assertEquals
import org.junit.Rule
import org.junit.Test
@ -36,7 +35,6 @@ class JunoOnboardingMapperTest {
private val defaultBrowserPageUiData = OnboardingPageUiData(
type = OnboardingPageUiData.Type.DEFAULT_BROWSER,
imageRes = R.drawable.ic_onboarding_welcome,
imageResContentScale = ContentScale.Fit,
title = "default browser title",
description = "default browser body with link text",
linkText = "link text",
@ -46,7 +44,6 @@ private val defaultBrowserPageUiData = OnboardingPageUiData(
private val syncPageUiData = OnboardingPageUiData(
type = OnboardingPageUiData.Type.SYNC_SIGN_IN,
imageRes = R.drawable.ic_onboarding_sync,
imageResContentScale = ContentScale.Fit,
title = "sync title",
description = "sync body",
primaryButtonLabel = "sync primary button text",
@ -55,7 +52,6 @@ private val syncPageUiData = OnboardingPageUiData(
private val notificationPageUiData = OnboardingPageUiData(
type = OnboardingPageUiData.Type.NOTIFICATION_PERMISSION,
imageRes = R.drawable.ic_notification_permission,
imageResContentScale = ContentScale.Crop,
title = "notification title",
description = "notification body",
primaryButtonLabel = "notification primary button text",
@ -65,7 +61,6 @@ private val notificationPageUiData = OnboardingPageUiData(
private val defaultBrowserCardData = OnboardingCardData(
cardType = OnboardingCardType.DEFAULT_BROWSER,
imageRes = R.drawable.ic_onboarding_welcome,
imageIsIllustration = true,
title = StringHolder(null, "default browser title"),
body = StringHolder(null, "default browser body with link text"),
linkText = StringHolder(null, "link text"),
@ -76,7 +71,6 @@ private val defaultBrowserCardData = OnboardingCardData(
private val syncCardData = OnboardingCardData(
cardType = OnboardingCardType.SYNC_SIGN_IN,
imageRes = R.drawable.ic_onboarding_sync,
imageIsIllustration = true,
title = StringHolder(null, "sync title"),
body = StringHolder(null, "sync body"),
primaryButtonLabel = StringHolder(null, "sync primary button text"),
@ -86,7 +80,6 @@ private val syncCardData = OnboardingCardData(
private val notificationCardData = OnboardingCardData(
cardType = OnboardingCardType.NOTIFICATION_PERMISSION,
imageRes = R.drawable.ic_notification_permission,
imageIsIllustration = false,
title = StringHolder(null, "notification title"),
body = StringHolder(null, "notification body"),
primaryButtonLabel = StringHolder(null, "notification primary button text"),

@ -4,7 +4,6 @@
package org.mozilla.fenix.onboarding.view
import androidx.compose.ui.layout.ContentScale
import org.mozilla.fenix.compose.LinkTextState
import org.mozilla.fenix.nimbus.OnboardingCardData
import org.mozilla.fenix.nimbus.OnboardingCardType
@ -26,7 +25,6 @@ internal fun Collection<OnboardingCardData>.toPageUiData(showNotificationPage: B
private fun OnboardingCardData.toPageUiData() = OnboardingPageUiData(
type = cardType.toPageUiDataType(),
imageRes = imageRes.resourceId,
imageResContentScale = imageIsIllustration.toContentScale(),
title = title,
description = body,
linkText = linkText,
@ -34,12 +32,6 @@ private fun OnboardingCardData.toPageUiData() = OnboardingPageUiData(
secondaryButtonLabel = secondaryButtonLabel,
)
private fun Boolean.toContentScale() = if (this) {
ContentScale.Fit
} else {
ContentScale.Crop
}
private fun OnboardingCardType.toPageUiDataType() = when (this) {
OnboardingCardType.DEFAULT_BROWSER -> OnboardingPageUiData.Type.DEFAULT_BROWSER
OnboardingCardType.SYNC_SIGN_IN -> OnboardingPageUiData.Type.SYNC_SIGN_IN

@ -28,7 +28,6 @@ import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.input.nestedscroll.NestedScrollConnection
import androidx.compose.ui.input.nestedscroll.NestedScrollSource
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.launch
@ -174,10 +173,7 @@ private fun JunoOnboardingContent(
onNotificationPermissionButtonClick = onNotificationPermissionButtonClick,
onNotificationPermissionSkipClick = onNotificationPermissionSkipClick,
)
OnboardingPage(
pageState = onboardingPageState,
imageResContentScale = pageUiState.imageResContentScale,
)
OnboardingPage(pageState = onboardingPageState)
}
PagerIndicator(
@ -237,7 +233,6 @@ private fun defaultPreviewPages() = listOf(
OnboardingPageUiData(
type = OnboardingPageUiData.Type.DEFAULT_BROWSER,
imageRes = R.drawable.ic_onboarding_welcome,
imageResContentScale = ContentScale.Fit,
title = stringResource(R.string.juno_onboarding_default_browser_title_nimbus),
description = stringResource(R.string.juno_onboarding_default_browser_description_nimbus),
linkText = stringResource(R.string.juno_onboarding_default_browser_description_link_text),
@ -247,7 +242,6 @@ private fun defaultPreviewPages() = listOf(
OnboardingPageUiData(
type = OnboardingPageUiData.Type.SYNC_SIGN_IN,
imageRes = R.drawable.ic_onboarding_sync,
imageResContentScale = ContentScale.Fit,
title = stringResource(R.string.juno_onboarding_sign_in_title),
description = stringResource(R.string.juno_onboarding_sign_in_description),
primaryButtonLabel = stringResource(R.string.juno_onboarding_sign_in_positive_button),
@ -256,7 +250,6 @@ private fun defaultPreviewPages() = listOf(
OnboardingPageUiData(
type = OnboardingPageUiData.Type.NOTIFICATION_PERMISSION,
imageRes = R.drawable.ic_notification_permission,
imageResContentScale = ContentScale.Fit,
title = stringResource(R.string.juno_onboarding_enable_notifications_title_nimbus),
description = stringResource(R.string.juno_onboarding_enable_notifications_description_nimbus),
primaryButtonLabel = stringResource(R.string.juno_onboarding_enable_notifications_positive_button),

@ -18,14 +18,11 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
@ -37,7 +34,6 @@ import org.mozilla.fenix.compose.LinkTextState
import org.mozilla.fenix.compose.annotation.LightDarkPreview
import org.mozilla.fenix.compose.button.PrimaryButton
import org.mozilla.fenix.compose.button.SecondaryButton
import org.mozilla.fenix.compose.ext.thenConditional
import org.mozilla.fenix.theme.FirefoxTheme
/**
@ -63,15 +59,12 @@ private const val IMAGE_HEIGHT_RATIO_SMALL = 0.28f
* @param modifier The modifier to be applied to the Composable.
* @param onDismiss Invoked when the user clicks the close button. This defaults to null. When null,
* it doesn't show the close button.
* @param imageResContentScale The [ContentScale] for the [OnboardingPageState.imageRes].
*/
@Composable
@Suppress("LongMethod")
fun OnboardingPage(
pageState: OnboardingPageState,
modifier: Modifier = Modifier,
onDismiss: (() -> Unit)? = null,
imageResContentScale: ContentScale = ContentScale.Fit,
) {
BoxWithConstraints(
modifier = Modifier
@ -109,12 +102,7 @@ fun OnboardingPage(
Image(
painter = painterResource(id = pageState.imageRes),
contentDescription = null,
contentScale = imageResContentScale,
modifier = Modifier
.height(imageHeight(boxWithConstraintsScope))
.thenConditional(Modifier.clip(MaterialTheme.shapes.medium)) {
imageResContentScale == ContentScale.Crop
},
modifier = Modifier.height(imageHeight(boxWithConstraintsScope)),
)
Spacer(modifier = Modifier.height(32.dp))

@ -5,7 +5,6 @@
package org.mozilla.fenix.onboarding.view
import androidx.annotation.DrawableRes
import androidx.compose.ui.layout.ContentScale
import org.mozilla.fenix.nimbus.OnboardingCardData
/**
@ -14,7 +13,6 @@ import org.mozilla.fenix.nimbus.OnboardingCardData
data class OnboardingPageUiData(
val type: Type,
@DrawableRes val imageRes: Int,
val imageResContentScale: ContentScale,
val title: String,
val description: String,
val linkText: String? = null,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 KiB

@ -1,3 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:keep="@drawable/onboarding_default_browser,@drawable/onboarding_sync,@drawable/onboarding_notification,@drawable/onboarding_ctd_default_browser,@drawable-night/onboarding_ctd_default_browser,@drawable/onboarding_ctd_sync,@drawable/onboarding_ctd_notification" />
tools:keep="@drawable/onboarding_ctd_default_browser,@drawable-night/onboarding_ctd_default_browser,@drawable/onboarding_ctd_sync,@drawable/onboarding_ctd_notification" />

@ -4,7 +4,6 @@
package org.mozilla.fenix.onboarding.view
import androidx.compose.ui.layout.ContentScale
import org.junit.Assert.assertEquals
import org.junit.Test
import org.mozilla.fenix.R
@ -31,7 +30,6 @@ class JunoOnboardingMapperTest {
val onboardingPageUiData = OnboardingPageUiData(
type = OnboardingPageUiData.Type.DEFAULT_BROWSER,
imageRes = R.drawable.ic_onboarding_welcome,
imageResContentScale = ContentScale.Fit,
title = "default browser title",
description = "default browser body with link text",
linkText = "link text",
@ -65,7 +63,6 @@ class JunoOnboardingMapperTest {
val onboardingPageUiData = OnboardingPageUiData(
type = OnboardingPageUiData.Type.SYNC_SIGN_IN,
imageRes = R.drawable.ic_onboarding_sync,
imageResContentScale = ContentScale.Fit,
title = "sync title",
description = "sync body",
linkText = null,
@ -99,7 +96,6 @@ class JunoOnboardingMapperTest {
val onboardingPageUiData = OnboardingPageUiData(
type = OnboardingPageUiData.Type.NOTIFICATION_PERMISSION,
imageRes = R.drawable.ic_notification_permission,
imageResContentScale = ContentScale.Fit,
title = "notification title",
description = "notification body",
linkText = null,

@ -4,7 +4,6 @@
package org.mozilla.fenix.onboarding.view
import androidx.compose.ui.layout.ContentScale
import org.junit.Assert.assertEquals
import org.junit.Test
import org.mozilla.fenix.R
@ -55,7 +54,6 @@ class OnboardingPageUiDataTest {
private val defaultBrowserPageUiData = OnboardingPageUiData(
type = OnboardingPageUiData.Type.DEFAULT_BROWSER,
imageRes = R.drawable.ic_onboarding_welcome,
imageResContentScale = ContentScale.Fit,
title = "default browser title",
description = "default browser body with link text",
linkText = "link text",
@ -66,7 +64,6 @@ private val defaultBrowserPageUiData = OnboardingPageUiData(
private val syncPageUiData = OnboardingPageUiData(
type = OnboardingPageUiData.Type.SYNC_SIGN_IN,
imageRes = R.drawable.ic_onboarding_sync,
imageResContentScale = ContentScale.Fit,
title = "sync title",
description = "sync body",
primaryButtonLabel = "sync primary button text",
@ -76,7 +73,6 @@ private val syncPageUiData = OnboardingPageUiData(
private val notificationPageUiData = OnboardingPageUiData(
type = OnboardingPageUiData.Type.NOTIFICATION_PERMISSION,
imageRes = R.drawable.ic_notification_permission,
imageResContentScale = ContentScale.Fit,
title = "notification title",
description = "notification body",
primaryButtonLabel = "notification primary button text",

Loading…
Cancel
Save