From f600cd9b05fc7d54fc2dfa57ea1f75e0de461e31 Mon Sep 17 00:00:00 2001 From: ThomasIent Date: Fri, 15 Nov 2024 11:48:29 +0000 Subject: [PATCH] chore: Remove duplicate xml resources Delete duplicate drawable resources in pages Auto-layout all drawable resources (Small format change in build.gradle.kts) Resolves: 10331 --- .../main/res/drawable/baseline_today_24.xml | 13 ++++++---- components/src/main/res/drawable/ic_error.xml | 6 ++--- .../main/res/drawable/ic_external_site.xml | 6 ++--- .../src/main/res/drawable/ic_warning_icon.xml | 6 ++--- .../res/drawable/preview__gdsvectorimage.xml | 12 +++++----- .../android/ui/pages/brp/BrpInstructions.kt | 24 +++++++++---------- .../ui/pages/instructions/Instructions.kt | 9 +++---- .../ui/pages/m3/instructions/Instructions.kt | 9 +++---- .../main/res/drawable/ic_external_site.xml | 9 ------- .../src/main/res/drawable/ic_photo_camera.xml | 13 ++++++---- .../src/main/res/drawable/ic_warning_icon.xml | 6 ++--- .../res/drawable/preview__brpinstructions.xml | 12 ---------- theme/build.gradle.kts | 4 ++-- 13 files changed, 60 insertions(+), 69 deletions(-) delete mode 100644 pages/src/main/res/drawable/ic_external_site.xml delete mode 100644 pages/src/main/res/drawable/preview__brpinstructions.xml diff --git a/components/src/main/res/drawable/baseline_today_24.xml b/components/src/main/res/drawable/baseline_today_24.xml index f614a72..7e4901c 100644 --- a/components/src/main/res/drawable/baseline_today_24.xml +++ b/components/src/main/res/drawable/baseline_today_24.xml @@ -1,5 +1,10 @@ - - + + diff --git a/components/src/main/res/drawable/ic_error.xml b/components/src/main/res/drawable/ic_error.xml index 1b9ad7c..6e7b5db 100644 --- a/components/src/main/res/drawable/ic_error.xml +++ b/components/src/main/res/drawable/ic_error.xml @@ -3,7 +3,7 @@ android:height="80dp" android:viewportWidth="80" android:viewportHeight="80"> - + diff --git a/components/src/main/res/drawable/ic_external_site.xml b/components/src/main/res/drawable/ic_external_site.xml index 56f9037..9256849 100644 --- a/components/src/main/res/drawable/ic_external_site.xml +++ b/components/src/main/res/drawable/ic_external_site.xml @@ -3,7 +3,7 @@ android:height="16sp" android:viewportWidth="17" android:viewportHeight="16"> - + diff --git a/components/src/main/res/drawable/ic_warning_icon.xml b/components/src/main/res/drawable/ic_warning_icon.xml index 1d1aa09..b3db1d5 100644 --- a/components/src/main/res/drawable/ic_warning_icon.xml +++ b/components/src/main/res/drawable/ic_warning_icon.xml @@ -3,7 +3,7 @@ android:height="30dp" android:viewportWidth="30" android:viewportHeight="30"> - + diff --git a/components/src/main/res/drawable/preview__gdsvectorimage.xml b/components/src/main/res/drawable/preview__gdsvectorimage.xml index 5563b21..cbffb41 100644 --- a/components/src/main/res/drawable/preview__gdsvectorimage.xml +++ b/components/src/main/res/drawable/preview__gdsvectorimage.xml @@ -3,10 +3,10 @@ android:height="125dp" android:viewportWidth="375" android:viewportHeight="250"> - - + + diff --git a/pages/src/main/java/uk/gov/android/ui/pages/brp/BrpInstructions.kt b/pages/src/main/java/uk/gov/android/ui/pages/brp/BrpInstructions.kt index 50d4010..e19c73e 100644 --- a/pages/src/main/java/uk/gov/android/ui/pages/brp/BrpInstructions.kt +++ b/pages/src/main/java/uk/gov/android/ui/pages/brp/BrpInstructions.kt @@ -26,6 +26,7 @@ import uk.gov.android.ui.components.GdsVectorImage import uk.gov.android.ui.components.HeadingParameters import uk.gov.android.ui.components.HeadingSize import uk.gov.android.ui.components.HelpTextParameters +import uk.gov.android.ui.components.R.drawable import uk.gov.android.ui.components.VectorImageParameters import uk.gov.android.ui.components.buttons.ButtonParameters import uk.gov.android.ui.components.buttons.ButtonType @@ -34,8 +35,7 @@ import uk.gov.android.ui.components.content.ContentParameters import uk.gov.android.ui.components.content.GdsContent import uk.gov.android.ui.components.content.GdsContentText.GdsContentTextArray import uk.gov.android.ui.components.images.icon.IconParameters -import uk.gov.android.ui.pages.R as pagesR -import uk.gov.android.ui.pages.R.drawable +import uk.gov.android.ui.pages.R import uk.gov.android.ui.pages.R.string import uk.gov.android.ui.theme.GdsTheme import uk.gov.android.ui.theme.mediumPadding @@ -205,23 +205,23 @@ data class BrpInstructionsParameters( class BrpInstructionsProvider : PreviewParameterProvider { override val values: Sequence = sequenceOf( BrpInstructionsParameters( - topIcon = pagesR.drawable.ic_photo_camera, - title = pagesR.string.preview__BrpInstructions__title, + topIcon = R.drawable.ic_photo_camera, + title = string.preview__BrpInstructions__title, content = listOf( BrpInstructionsContentSection( - subTitle = pagesR.string.preview__BrpInstructions__subtitle_1, - text = pagesR.array.preview__BrpInstructions__array_0 + subTitle = string.preview__BrpInstructions__subtitle_1, + text = R.array.preview__BrpInstructions__array_0 ), BrpInstructionsContentSection( - subTitle = pagesR.string.preview__BrpInstructions__subtitle_2, - text = pagesR.array.preview__BrpInstructions__array_1 + subTitle = string.preview__BrpInstructions__subtitle_2, + text = R.array.preview__BrpInstructions__array_1 ) ), - image = pagesR.drawable.preview__brpinstructions, - primaryButtonText = pagesR.string.preview__BrpInstructions__primary_button, - secondaryButtonText = pagesR.string.preview__BrpInstructions__secondary_button, + image = drawable.preview__gdsvectorimage, + primaryButtonText = string.preview__BrpInstructions__primary_button, + secondaryButtonText = string.preview__BrpInstructions__secondary_button, helpTextParameters = HelpTextParameters( - text = pagesR.string.preview__BrpInstructions__help_text, + text = string.preview__BrpInstructions__help_text, iconParameters = IconParameters( image = drawable.ic_warning_icon ), diff --git a/pages/src/main/java/uk/gov/android/ui/pages/instructions/Instructions.kt b/pages/src/main/java/uk/gov/android/ui/pages/instructions/Instructions.kt index 1dfdfeb..fdf211c 100644 --- a/pages/src/main/java/uk/gov/android/ui/pages/instructions/Instructions.kt +++ b/pages/src/main/java/uk/gov/android/ui/pages/instructions/Instructions.kt @@ -26,6 +26,7 @@ import uk.gov.android.ui.components.GdsVectorImage import uk.gov.android.ui.components.HeadingParameters import uk.gov.android.ui.components.HeadingSize import uk.gov.android.ui.components.HelpTextParameters +import uk.gov.android.ui.components.R.drawable import uk.gov.android.ui.components.VectorImageParameters import uk.gov.android.ui.components.buttons.ButtonParameters import uk.gov.android.ui.components.buttons.ButtonType @@ -188,7 +189,7 @@ class InstructionsProvider : PreviewParameterProvider { text = R.array.preview__BrpInstructions__array_1 ) ), - image = R.drawable.preview__brpinstructions, + image = drawable.preview__gdsvectorimage, helpTextParameters = HelpTextParameters( text = R.string.preview__BrpInstructions__help_text, iconParameters = IconParameters( @@ -213,7 +214,7 @@ class InstructionsProvider : PreviewParameterProvider { buttonType = ButtonType.ICON( buttonType = ButtonType.SECONDARY(), iconParameters = IconParameters( - image = R.drawable.ic_external_site, + image = drawable.ic_external_site, description = R.string.externalSite ) ), @@ -238,7 +239,7 @@ class InstructionsProvider : PreviewParameterProvider { text = R.array.preview__BrpInstructions__array_1 ) ), - image = R.drawable.preview__brpinstructions, + image = drawable.preview__gdsvectorimage, helpTextParameters = HelpTextParameters( text = R.string.preview__BrpInstructions__help_text, iconParameters = IconParameters( @@ -263,7 +264,7 @@ class InstructionsProvider : PreviewParameterProvider { buttonType = ButtonType.ICON( buttonType = ButtonType.SECONDARY(), iconParameters = IconParameters( - image = R.drawable.ic_external_site, + image = drawable.ic_external_site, description = R.string.externalSite ) ), diff --git a/pages/src/main/java/uk/gov/android/ui/pages/m3/instructions/Instructions.kt b/pages/src/main/java/uk/gov/android/ui/pages/m3/instructions/Instructions.kt index 5a49160..050f78f 100644 --- a/pages/src/main/java/uk/gov/android/ui/pages/m3/instructions/Instructions.kt +++ b/pages/src/main/java/uk/gov/android/ui/pages/m3/instructions/Instructions.kt @@ -21,6 +21,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.tooling.preview.PreviewParameterProvider import uk.gov.android.ui.components.GdsVectorImage +import uk.gov.android.ui.components.R.drawable import uk.gov.android.ui.components.VectorImageParameters import uk.gov.android.ui.components.content.GdsContentText import uk.gov.android.ui.components.images.icon.IconParameters @@ -187,7 +188,7 @@ class InstructionsProvider : PreviewParameterProvider { text = R.array.preview__BrpInstructions__array_1 ) ), - image = R.drawable.preview__brpinstructions, + image = drawable.preview__gdsvectorimage, helpTextParameters = HelpText( text = R.string.preview__BrpInstructions__help_text, iconParameters = IconParameters( @@ -212,7 +213,7 @@ class InstructionsProvider : PreviewParameterProvider { buttonType = ButtonType.ICON( parentButtonType = ButtonType.QUATERNARY(), iconParameters = IconParameters( - image = R.drawable.ic_external_site, + image = drawable.ic_external_site, description = R.string.externalSite ) ), @@ -237,7 +238,7 @@ class InstructionsProvider : PreviewParameterProvider { text = R.array.preview__BrpInstructions__array_1 ) ), - image = R.drawable.preview__brpinstructions, + image = drawable.preview__gdsvectorimage, helpTextParameters = HelpText( text = R.string.preview__BrpInstructions__help_text, iconParameters = IconParameters( @@ -262,7 +263,7 @@ class InstructionsProvider : PreviewParameterProvider { buttonType = ButtonType.ICON( parentButtonType = ButtonType.QUATERNARY(), iconParameters = IconParameters( - image = R.drawable.ic_external_site, + image = drawable.ic_external_site, description = R.string.externalSite ) ), diff --git a/pages/src/main/res/drawable/ic_external_site.xml b/pages/src/main/res/drawable/ic_external_site.xml deleted file mode 100644 index 92f34e8..0000000 --- a/pages/src/main/res/drawable/ic_external_site.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/pages/src/main/res/drawable/ic_photo_camera.xml b/pages/src/main/res/drawable/ic_photo_camera.xml index 0ba9876..e0f8643 100644 --- a/pages/src/main/res/drawable/ic_photo_camera.xml +++ b/pages/src/main/res/drawable/ic_photo_camera.xml @@ -1,5 +1,10 @@ - - + + diff --git a/pages/src/main/res/drawable/ic_warning_icon.xml b/pages/src/main/res/drawable/ic_warning_icon.xml index 1d1aa09..b3db1d5 100644 --- a/pages/src/main/res/drawable/ic_warning_icon.xml +++ b/pages/src/main/res/drawable/ic_warning_icon.xml @@ -3,7 +3,7 @@ android:height="30dp" android:viewportWidth="30" android:viewportHeight="30"> - + diff --git a/pages/src/main/res/drawable/preview__brpinstructions.xml b/pages/src/main/res/drawable/preview__brpinstructions.xml deleted file mode 100644 index 5563b21..0000000 --- a/pages/src/main/res/drawable/preview__brpinstructions.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/theme/build.gradle.kts b/theme/build.gradle.kts index 7e2c998..61ce760 100644 --- a/theme/build.gradle.kts +++ b/theme/build.gradle.kts @@ -36,8 +36,8 @@ android { composeOptions { kotlinCompilerExtensionVersion = ( - rootProject.extra["composeKotlinCompilerVersion"] as String - ) + rootProject.extra["composeKotlinCompilerVersion"] as String + ) } buildTypes {