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/UrlButton.kt11
-rw-r--r--android/src/main/res/values/attrs.xml4
2 files changed, 11 insertions, 4 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/UrlButton.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/UrlButton.kt
index 36b77ce134..ddef67c634 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/UrlButton.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/UrlButton.kt
@@ -78,11 +78,16 @@ open class UrlButton : Button {
}
private fun loadAttributes(attributes: AttributeSet) {
- val styleableId = R.styleable.UrlButton
+ context.theme.obtainStyledAttributes(attributes, R.styleable.Url, 0, 0).apply {
+ try {
+ url = getString(R.styleable.Url_url)
+ } finally {
+ recycle()
+ }
+ }
- context.theme.obtainStyledAttributes(attributes, styleableId, 0, 0).apply {
+ context.theme.obtainStyledAttributes(attributes, R.styleable.UrlButton, 0, 0).apply {
try {
- url = getString(R.styleable.UrlButton_url)
withToken = getBoolean(R.styleable.UrlButton_withToken, false)
} finally {
recycle()
diff --git a/android/src/main/res/values/attrs.xml b/android/src/main/res/values/attrs.xml
index f0f573d138..21db41e41c 100644
--- a/android/src/main/res/values/attrs.xml
+++ b/android/src/main/res/values/attrs.xml
@@ -47,9 +47,11 @@
<attr name="text"
format="reference|string" />
</declare-styleable>
- <declare-styleable name="UrlButton">
+ <declare-styleable name="Url">
<attr name="url"
format="reference|string" />
+ </declare-styleable>
+ <declare-styleable name="UrlButton">
<attr name="withToken"
format="boolean" />
</declare-styleable>