summaryrefslogtreecommitdiffhomepage
path: root/android/src
diff options
context:
space:
mode:
Diffstat (limited to 'android/src')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/Button.kt9
-rw-r--r--android/src/main/res/values/attrs.xml6
2 files changed, 12 insertions, 3 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/Button.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/Button.kt
index 9c2573664f..791b8caaa5 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/Button.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/Button.kt
@@ -142,7 +142,6 @@ open class Button : FrameLayout {
context.theme.obtainStyledAttributes(attributes, styleableId, 0, 0).apply {
try {
- button.text = getString(R.styleable.Button_text) ?: ""
buttonColor = ButtonColor.fromCode(getInteger(R.styleable.Button_buttonColor, 0))
detailImage = getDrawable(R.styleable.Button_detailImage)
showSpinner = getBoolean(R.styleable.Button_showSpinner, false)
@@ -150,5 +149,13 @@ open class Button : FrameLayout {
recycle()
}
}
+
+ context.theme.obtainStyledAttributes(attributes, R.styleable.TextAttribute, 0, 0).apply {
+ try {
+ button.text = getString(R.styleable.TextAttribute_text) ?: ""
+ } finally {
+ recycle()
+ }
+ }
}
}
diff --git a/android/src/main/res/values/attrs.xml b/android/src/main/res/values/attrs.xml
index 449db0efd7..1ddae37ee7 100644
--- a/android/src/main/res/values/attrs.xml
+++ b/android/src/main/res/values/attrs.xml
@@ -13,8 +13,6 @@
format="reference" />
<attr name="showSpinner"
format="boolean" />
- <attr name="text"
- format="reference|string" />
</declare-styleable>
<declare-styleable name="CopyableInformationView">
<attr name="clipboardLabel"
@@ -41,6 +39,10 @@
value="2" />
</attr>
</declare-styleable>
+ <declare-styleable name="TextAttribute">
+ <attr name="text"
+ format="reference|string" />
+ </declare-styleable>
<declare-styleable name="UrlButton">
<attr name="url"
format="reference|string" />