Skip to content

Commit

Permalink
chore: Remove duplicate xml resources
Browse files Browse the repository at this point in the history
Delete duplicate drawable resources in pages
Auto-layout all drawable resources
(Small format change in build.gradle.kts)

Resolves: 10331
  • Loading branch information
ThomasIent committed Nov 15, 2024
1 parent 0afb6b2 commit f600cd9
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 69 deletions.
13 changes: 9 additions & 4 deletions components/src/main/res/drawable/baseline_today_24.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M19,3h-1L18,1h-2v2L8,3L8,1L6,1v2L5,3c-1.11,0 -1.99,0.9 -1.99,2L3,19c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM19,19L5,19L5,8h14v11zM7,10h5v5L7,15z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#000000"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M19,3h-1L18,1h-2v2L8,3L8,1L6,1v2L5,3c-1.11,0 -1.99,0.9 -1.99,2L3,19c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM19,19L5,19L5,8h14v11zM7,10h5v5L7,15z" />
</vector>
6 changes: 3 additions & 3 deletions components/src/main/res/drawable/ic_error.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:height="80dp"
android:viewportWidth="80"
android:viewportHeight="80">
<path
android:pathData="M37.3,44.7H43.3V19.4H37.3V44.7ZM40,60C40.933,60 41.717,59.683 42.35,59.05C42.983,58.417 43.3,57.633 43.3,56.7C43.3,55.767 42.983,54.983 42.35,54.35C41.717,53.717 40.933,53.4 40,53.4C39.067,53.4 38.283,53.717 37.65,54.35C37.017,54.983 36.7,55.767 36.7,56.7C36.7,57.633 37.017,58.417 37.65,59.05C38.283,59.683 39.067,60 40,60ZM40,80C34.333,80 29.067,78.983 24.2,76.95C19.333,74.917 15.1,72.1 11.5,68.5C7.9,64.9 5.083,60.667 3.05,55.8C1.017,50.933 0,45.667 0,40C0,34.4 1.017,29.167 3.05,24.3C5.083,19.433 7.9,15.2 11.5,11.6C15.1,8 19.333,5.167 24.2,3.1C29.067,1.033 34.333,0 40,0C45.6,0 50.833,1.033 55.7,3.1C60.567,5.167 64.8,8 68.4,11.6C72,15.2 74.833,19.433 76.9,24.3C78.967,29.167 80,34.4 80,40C80,45.667 78.967,50.933 76.9,55.8C74.833,60.667 72,64.9 68.4,68.5C64.8,72.1 60.567,74.917 55.7,76.95C50.833,78.983 45.6,80 40,80ZM40,74C49.333,74 57.333,70.667 64,64C70.667,57.333 74,49.333 74,40C74,30.667 70.667,22.667 64,16C57.333,9.333 49.333,6 40,6C30.667,6 22.667,9.333 16,16C9.333,22.667 6,30.667 6,40C6,49.333 9.333,57.333 16,64C22.667,70.667 30.667,74 40,74Z"
android:fillColor="#000000"/>
<path
android:fillColor="#000000"
android:pathData="M37.3,44.7H43.3V19.4H37.3V44.7ZM40,60C40.933,60 41.717,59.683 42.35,59.05C42.983,58.417 43.3,57.633 43.3,56.7C43.3,55.767 42.983,54.983 42.35,54.35C41.717,53.717 40.933,53.4 40,53.4C39.067,53.4 38.283,53.717 37.65,54.35C37.017,54.983 36.7,55.767 36.7,56.7C36.7,57.633 37.017,58.417 37.65,59.05C38.283,59.683 39.067,60 40,60ZM40,80C34.333,80 29.067,78.983 24.2,76.95C19.333,74.917 15.1,72.1 11.5,68.5C7.9,64.9 5.083,60.667 3.05,55.8C1.017,50.933 0,45.667 0,40C0,34.4 1.017,29.167 3.05,24.3C5.083,19.433 7.9,15.2 11.5,11.6C15.1,8 19.333,5.167 24.2,3.1C29.067,1.033 34.333,0 40,0C45.6,0 50.833,1.033 55.7,3.1C60.567,5.167 64.8,8 68.4,11.6C72,15.2 74.833,19.433 76.9,24.3C78.967,29.167 80,34.4 80,40C80,45.667 78.967,50.933 76.9,55.8C74.833,60.667 72,64.9 68.4,68.5C64.8,72.1 60.567,74.917 55.7,76.95C50.833,78.983 45.6,80 40,80ZM40,74C49.333,74 57.333,70.667 64,64C70.667,57.333 74,49.333 74,40C74,30.667 70.667,22.667 64,16C57.333,9.333 49.333,6 40,6C30.667,6 22.667,9.333 16,16C9.333,22.667 6,30.667 6,40C6,49.333 9.333,57.333 16,64C22.667,70.667 30.667,74 40,74Z" />
</vector>
6 changes: 3 additions & 3 deletions components/src/main/res/drawable/ic_external_site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:height="16sp"
android:viewportWidth="17"
android:viewportHeight="16">
<path
android:pathData="M16.5,8.467V14.667C16.5,15.022 16.367,15.333 16.1,15.6C15.833,15.867 15.522,16 15.167,16H1.833C1.478,16 1.167,15.867 0.9,15.6C0.633,15.333 0.5,15.022 0.5,14.667V1.333C0.5,0.978 0.633,0.667 0.9,0.4C1.167,0.133 1.478,0 1.833,0H8.033V1.333H1.833V14.667H15.167V8.467H16.5ZM6.322,11.133L5.389,10.178L14.233,1.333H9.367V0H16.5V7.133H15.167V2.289L6.322,11.133Z"
android:fillColor="#000000"/>
<path
android:fillColor="#000000"
android:pathData="M16.5,8.467V14.667C16.5,15.022 16.367,15.333 16.1,15.6C15.833,15.867 15.522,16 15.167,16H1.833C1.478,16 1.167,15.867 0.9,15.6C0.633,15.333 0.5,15.022 0.5,14.667V1.333C0.5,0.978 0.633,0.667 0.9,0.4C1.167,0.133 1.478,0 1.833,0H8.033V1.333H1.833V14.667H15.167V8.467H16.5ZM6.322,11.133L5.389,10.178L14.233,1.333H9.367V0H16.5V7.133H15.167V2.289L6.322,11.133Z" />
</vector>
6 changes: 3 additions & 3 deletions components/src/main/res/drawable/ic_warning_icon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:height="30dp"
android:viewportWidth="30"
android:viewportHeight="30">
<path
android:pathData="M14.885,29.58C6.969,29.58 0.447,23.059 0.447,15.129C0.447,7.213 6.955,0.691 14.885,0.691C22.801,0.691 29.322,7.213 29.322,15.129C29.322,23.059 22.815,29.58 14.885,29.58ZM14.898,17.18C15.842,17.18 16.389,16.646 16.443,15.662L16.662,9.77C16.717,8.744 15.965,8.033 14.885,8.033C13.791,8.033 13.053,8.73 13.107,9.77L13.326,15.676C13.367,16.646 13.928,17.18 14.898,17.18ZM14.898,22.115C15.979,22.115 16.813,21.432 16.813,20.379C16.813,19.354 15.992,18.656 14.898,18.656C13.805,18.656 12.957,19.354 12.957,20.379C12.957,21.432 13.805,22.115 14.898,22.115Z"
android:fillColor="#0B0C0C"/>
<path
android:fillColor="#0B0C0C"
android:pathData="M14.885,29.58C6.969,29.58 0.447,23.059 0.447,15.129C0.447,7.213 6.955,0.691 14.885,0.691C22.801,0.691 29.322,7.213 29.322,15.129C29.322,23.059 22.815,29.58 14.885,29.58ZM14.898,17.18C15.842,17.18 16.389,16.646 16.443,15.662L16.662,9.77C16.717,8.744 15.965,8.033 14.885,8.033C13.791,8.033 13.053,8.73 13.107,9.77L13.326,15.676C13.367,16.646 13.928,17.18 14.898,17.18ZM14.898,22.115C15.979,22.115 16.813,21.432 16.813,20.379C16.813,19.354 15.992,18.656 14.898,18.656C13.805,18.656 12.957,19.354 12.957,20.379C12.957,21.432 13.805,22.115 14.898,22.115Z" />
</vector>
12 changes: 6 additions & 6 deletions components/src/main/res/drawable/preview__gdsvectorimage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
android:height="125dp"
android:viewportWidth="375"
android:viewportHeight="250">
<path
android:pathData="M0,0h375v250h-375z"
android:fillColor="#999"/>
<path
android:fillColor="#FF000000"
android:pathData="m258.18,54.2v141.38L116.81,195.57L116.81,54.2h141.38m0,-20.2L116.81,34c-11.11,0 -20.2,9.09 -20.2,20.2v141.38c0,11.11 9.09,20.2 20.2,20.2h141.38c11.11,0 20.2,-9.09 20.2,-20.2L278.38,54.2c0,-11.11 -9.09,-20.2 -20.2,-20.2ZM209.1,123.47l-30.29,39.08 -21.61,-26.15 -30.29,38.98h121.18s-38.98,-51.9 -38.98,-51.9Z"/>
<path
android:fillColor="#999"
android:pathData="M0,0h375v250h-375z" />
<path
android:fillColor="#FF000000"
android:pathData="m258.18,54.2v141.38L116.81,195.57L116.81,54.2h141.38m0,-20.2L116.81,34c-11.11,0 -20.2,9.09 -20.2,20.2v141.38c0,11.11 9.09,20.2 20.2,20.2h141.38c11.11,0 20.2,-9.09 20.2,-20.2L278.38,54.2c0,-11.11 -9.09,-20.2 -20.2,-20.2ZM209.1,123.47l-30.29,39.08 -21.61,-26.15 -30.29,38.98h121.18s-38.98,-51.9 -38.98,-51.9Z" />
</vector>
24 changes: 12 additions & 12 deletions pages/src/main/java/uk/gov/android/ui/pages/brp/BrpInstructions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -205,23 +205,23 @@ data class BrpInstructionsParameters(
class BrpInstructionsProvider : PreviewParameterProvider<BrpInstructionsParameters> {
override val values: Sequence<BrpInstructionsParameters> = 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
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -188,7 +189,7 @@ class InstructionsProvider : PreviewParameterProvider<Instructions> {
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(
Expand All @@ -213,7 +214,7 @@ class InstructionsProvider : PreviewParameterProvider<Instructions> {
buttonType = ButtonType.ICON(
buttonType = ButtonType.SECONDARY(),
iconParameters = IconParameters(
image = R.drawable.ic_external_site,
image = drawable.ic_external_site,
description = R.string.externalSite
)
),
Expand All @@ -238,7 +239,7 @@ class InstructionsProvider : PreviewParameterProvider<Instructions> {
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(
Expand All @@ -263,7 +264,7 @@ class InstructionsProvider : PreviewParameterProvider<Instructions> {
buttonType = ButtonType.ICON(
buttonType = ButtonType.SECONDARY(),
iconParameters = IconParameters(
image = R.drawable.ic_external_site,
image = drawable.ic_external_site,
description = R.string.externalSite
)
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -187,7 +188,7 @@ class InstructionsProvider : PreviewParameterProvider<Instructions> {
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(
Expand All @@ -212,7 +213,7 @@ class InstructionsProvider : PreviewParameterProvider<Instructions> {
buttonType = ButtonType.ICON(
parentButtonType = ButtonType.QUATERNARY(),
iconParameters = IconParameters(
image = R.drawable.ic_external_site,
image = drawable.ic_external_site,
description = R.string.externalSite
)
),
Expand All @@ -237,7 +238,7 @@ class InstructionsProvider : PreviewParameterProvider<Instructions> {
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(
Expand All @@ -262,7 +263,7 @@ class InstructionsProvider : PreviewParameterProvider<Instructions> {
buttonType = ButtonType.ICON(
parentButtonType = ButtonType.QUATERNARY(),
iconParameters = IconParameters(
image = R.drawable.ic_external_site,
image = drawable.ic_external_site,
description = R.string.externalSite
)
),
Expand Down
9 changes: 0 additions & 9 deletions pages/src/main/res/drawable/ic_external_site.xml

This file was deleted.

13 changes: 9 additions & 4 deletions pages/src/main/res/drawable/ic_photo_camera.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<vector android:height="48dp" android:tint="#00703C"
android:viewportHeight="24" android:viewportWidth="24"
android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M14.12,4l1.83,2L20,6v12L4,18L4,6h4.05l1.83,-2h4.24M15,2L9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2zM12,9c1.65,0 3,1.35 3,3s-1.35,3 -3,3 -3,-1.35 -3,-3 1.35,-3 3,-3m0,-2c-2.76,0 -5,2.24 -5,5s2.24,5 5,5 5,-2.24 5,-5 -2.24,-5 -5,-5z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:tint="#00703C"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M14.12,4l1.83,2L20,6v12L4,18L4,6h4.05l1.83,-2h4.24M15,2L9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2zM12,9c1.65,0 3,1.35 3,3s-1.35,3 -3,3 -3,-1.35 -3,-3 1.35,-3 3,-3m0,-2c-2.76,0 -5,2.24 -5,5s2.24,5 5,5 5,-2.24 5,-5 -2.24,-5 -5,-5z" />
</vector>
6 changes: 3 additions & 3 deletions pages/src/main/res/drawable/ic_warning_icon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:height="30dp"
android:viewportWidth="30"
android:viewportHeight="30">
<path
android:pathData="M14.885,29.58C6.969,29.58 0.447,23.059 0.447,15.129C0.447,7.213 6.955,0.691 14.885,0.691C22.801,0.691 29.322,7.213 29.322,15.129C29.322,23.059 22.815,29.58 14.885,29.58ZM14.898,17.18C15.842,17.18 16.389,16.646 16.443,15.662L16.662,9.77C16.717,8.744 15.965,8.033 14.885,8.033C13.791,8.033 13.053,8.73 13.107,9.77L13.326,15.676C13.367,16.646 13.928,17.18 14.898,17.18ZM14.898,22.115C15.979,22.115 16.813,21.432 16.813,20.379C16.813,19.354 15.992,18.656 14.898,18.656C13.805,18.656 12.957,19.354 12.957,20.379C12.957,21.432 13.805,22.115 14.898,22.115Z"
android:fillColor="#0B0C0C"/>
<path
android:fillColor="#0B0C0C"
android:pathData="M14.885,29.58C6.969,29.58 0.447,23.059 0.447,15.129C0.447,7.213 6.955,0.691 14.885,0.691C22.801,0.691 29.322,7.213 29.322,15.129C29.322,23.059 22.815,29.58 14.885,29.58ZM14.898,17.18C15.842,17.18 16.389,16.646 16.443,15.662L16.662,9.77C16.717,8.744 15.965,8.033 14.885,8.033C13.791,8.033 13.053,8.73 13.107,9.77L13.326,15.676C13.367,16.646 13.928,17.18 14.898,17.18ZM14.898,22.115C15.979,22.115 16.813,21.432 16.813,20.379C16.813,19.354 15.992,18.656 14.898,18.656C13.805,18.656 12.957,19.354 12.957,20.379C12.957,21.432 13.805,22.115 14.898,22.115Z" />
</vector>
12 changes: 0 additions & 12 deletions pages/src/main/res/drawable/preview__brpinstructions.xml

This file was deleted.

4 changes: 2 additions & 2 deletions theme/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ android {

composeOptions {
kotlinCompilerExtensionVersion = (
rootProject.extra["composeKotlinCompilerVersion"] as String
)
rootProject.extra["composeKotlinCompilerVersion"] as String
)
}

buildTypes {
Expand Down

0 comments on commit f600cd9

Please sign in to comment.