Skip to content

Commit 66daa80

Browse files
authored
Made InformationMessageCardView headline background colours customisable (#11)
1 parent 86d2521 commit 66daa80

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Allowed headings:
1919
### Added
2020
* screenshot tests
2121

22+
### Changed
23+
* Made `InformationMessageCardView` headline background colours customisable
24+
2225
## [3.4.9] - 2020-11-06
2326

2427
### Added

components/src/main/java/uk/gov/hmrc/components/organism/information/InformationMessageCardView.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ class InformationMessageCardView @JvmOverloads constructor(
135135
}
136136

137137
enum class Type(val headlineBackgroundColor: Int, val headlineTint: Int) {
138-
WARNING(R.color.hmrc_yellow, R.color.hmrc_always_black),
139-
INFO(R.color.hmrc_blue, R.color.hmrc_white),
140-
URGENT(R.color.hmrc_red, R.color.hmrc_white),
141-
NOTICE(R.color.hmrc_black, R.color.hmrc_white)
138+
WARNING(R.color.hmrc_information_message_warning_headline_background, R.color.hmrc_always_black),
139+
INFO(R.color.hmrc_information_message_info_headline_background, R.color.hmrc_white),
140+
URGENT(R.color.hmrc_information_message_urgent_headline_background, R.color.hmrc_white),
141+
NOTICE(R.color.hmrc_information_message_notice_headline_background, R.color.hmrc_white)
142142
}
143143
}

components/src/main/res/values/colors.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,9 @@
4343
<color name="hmrc_divider">@color/hmrc_grey_2</color>
4444
<color name="hmrc_inset_bar">@color/hmrc_grey_2</color>
4545

46+
<color name="hmrc_information_message_warning_headline_background">@color/hmrc_yellow</color>
47+
<color name="hmrc_information_message_info_headline_background">@color/hmrc_blue</color>
48+
<color name="hmrc_information_message_urgent_headline_background">@color/hmrc_red</color>
49+
<color name="hmrc_information_message_notice_headline_background">@color/hmrc_black</color>
50+
4651
</resources>

components/src/main/res/values/public.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
<public name="hmrc_card_background" type="color" />
2121
<public name="hmrc_divider" type="color" />
2222
<public name="hmrc_dark_text" type="color" />
23+
<public name="hmrc_information_message_warning_headline_background" />
24+
<public name="hmrc_information_message_info_headline_background" />
25+
<public name="hmrc_information_message_urgent_headline_background" />
26+
<public name="hmrc_information_message_notice_headline_background" />
2327

2428
<!-- Styles -->
2529
<public name="MaterialTextButtonNoInset" type="style" />

0 commit comments

Comments
 (0)