diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-04-04 14:15:05 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-04-27 16:21:52 +0000 |
| commit | 40f65b316ec342a7f1b8c8f7bdebe4dcc26e344e (patch) | |
| tree | 75f5b962ed1cfa15c5290c02dd1e364ec065482a | |
| parent | f372ebc85e455740751daa6b409b0c1221eb4c6c (diff) | |
| download | mullvadvpn-40f65b316ec342a7f1b8c8f7bdebe4dcc26e344e.tar.xz mullvadvpn-40f65b316ec342a7f1b8c8f7bdebe4dcc26e344e.zip | |
Allow changing the information text color
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/InformationView.kt | 13 | ||||
| -rw-r--r-- | android/src/main/res/values/attrs.xml | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/InformationView.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/InformationView.kt index fed5ab8c28..934c2efa25 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/InformationView.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/InformationView.kt @@ -54,6 +54,13 @@ open class InformationView : LinearLayout { updateStatus() } + var informationColor = context.resources.getColor(R.color.white) + set(value) { + field = value + informationDisplay.setTextColor(value) + updateStatus() + } + var whenMissing = WhenMissing.Nothing set(value) { field = value @@ -101,6 +108,12 @@ open class InformationView : LinearLayout { context.theme.obtainStyledAttributes(attributes, styleableId, 0, 0).apply { try { description.text = getString(R.styleable.InformationView_description) ?: "" + + informationColor = getInteger( + R.styleable.InformationView_informationColor, + informationColor + ) + whenMissing = WhenMissing.fromCode( getInteger(R.styleable.InformationView_whenMissing, 0) ) diff --git a/android/src/main/res/values/attrs.xml b/android/src/main/res/values/attrs.xml index bda6c3b9b6..f44c4e8e4e 100644 --- a/android/src/main/res/values/attrs.xml +++ b/android/src/main/res/values/attrs.xml @@ -14,6 +14,7 @@ </declare-styleable> <declare-styleable name="InformationView"> <attr name="description" format="reference|string"/> + <attr name="informationColor" format="reference|color"/> <attr name="whenMissing" format="enum"> <enum name="nothing" value="0"/> <enum name="hide" value="1"/> |
