summaryrefslogtreecommitdiffhomepage
path: root/android/src/main/res
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-04-03 20:33:34 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-04-27 16:21:52 +0000
commited6145f9affc8d8d443ea5d553824f44e6a408c6 (patch)
tree2ed591a726dba9451109f607e55b475fbe73b71f /android/src/main/res
parente70831b7fa9e020977f9c882c1391c1e508b57fe (diff)
downloadmullvadvpn-ed6145f9affc8d8d443ea5d553824f44e6a408c6.tar.xz
mullvadvpn-ed6145f9affc8d8d443ea5d553824f44e6a408c6.zip
Change `Button` to support showing a spinner
Diffstat (limited to 'android/src/main/res')
-rw-r--r--android/src/main/res/layout/button.xml16
-rw-r--r--android/src/main/res/values/attrs.xml8
-rw-r--r--android/src/main/res/values/styles.xml1
3 files changed, 25 insertions, 0 deletions
diff --git a/android/src/main/res/layout/button.xml b/android/src/main/res/layout/button.xml
new file mode 100644
index 0000000000..1f7cb39130
--- /dev/null
+++ b/android/src/main/res/layout/button.xml
@@ -0,0 +1,16 @@
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <Button android:id="@+id/button"
+ android:gravity="center"
+ android:text=""
+ style="@style/Button" />
+ <ProgressBar android:id="@+id/spinner"
+ android:layout_width="20dp"
+ android:layout_height="20dp"
+ android:layout_marginHorizontal="9dp"
+ android:layout_gravity="right|center_vertical"
+ android:indeterminate="true"
+ android:indeterminateOnly="true"
+ android:indeterminateDuration="600"
+ android:indeterminateDrawable="@drawable/icon_spinner"
+ android:visibility="gone" />
+</merge>
diff --git a/android/src/main/res/values/attrs.xml b/android/src/main/res/values/attrs.xml
index e97d6cd591..8ffa0ef8df 100644
--- a/android/src/main/res/values/attrs.xml
+++ b/android/src/main/res/values/attrs.xml
@@ -1,4 +1,12 @@
<resources>
+ <declare-styleable name="Button">
+ <attr name="buttonColor" format="enum">
+ <enum name="blue" value="0"/>
+ <enum name="green" value="1"/>
+ </attr>
+ <attr name="showSpinner" format="boolean"/>
+ <attr name="text" format="reference|string"/>
+ </declare-styleable>
<declare-styleable name="CopyableInformationView">
<attr name="clipboardLabel" format="reference|string"/>
<attr name="copiedToast" format="reference|string"/>
diff --git a/android/src/main/res/values/styles.xml b/android/src/main/res/values/styles.xml
index d20f758ad9..c380a2f51c 100644
--- a/android/src/main/res/values/styles.xml
+++ b/android/src/main/res/values/styles.xml
@@ -20,6 +20,7 @@
<item name="android:layout_height">
@dimen/normal_button_height</item>
<item name="android:layout_width">match_parent</item>
+ <item name="android:padding">0dp</item>
<item name="android:textAllCaps">false</item>
<item name="android:textColor">@color/white</item>
<item name="android:textSize">20sp</item>