summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLogin.kt31
-rw-r--r--android/src/main/res/layout/account_login.xml12
-rw-r--r--android/src/main/res/layout/login.xml12
3 files changed, 46 insertions, 9 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLogin.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLogin.kt
new file mode 100644
index 0000000000..2d60730d0e
--- /dev/null
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/ui/widget/AccountLogin.kt
@@ -0,0 +1,31 @@
+package net.mullvad.mullvadvpn.ui.widget
+
+import android.content.Context
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.widget.RelativeLayout
+import net.mullvad.mullvadvpn.R
+
+class AccountLogin : RelativeLayout {
+ private val container =
+ context.getSystemService(Context.LAYOUT_INFLATER_SERVICE).let { service ->
+ val inflater = service as LayoutInflater
+
+ inflater.inflate(R.layout.account_login, this)
+ }
+
+ constructor(context: Context) : super(context) {}
+
+ constructor(context: Context, attributes: AttributeSet) : super(context, attributes) {}
+
+ constructor(context: Context, attributes: AttributeSet, defaultStyleAttribute: Int) :
+ super(context, attributes, defaultStyleAttribute) {}
+
+ constructor(
+ context: Context,
+ attributes: AttributeSet,
+ defaultStyleAttribute: Int,
+ defaultStyleResource: Int
+ ) : super(context, attributes, defaultStyleAttribute, defaultStyleResource) {
+ }
+}
diff --git a/android/src/main/res/layout/account_login.xml b/android/src/main/res/layout/account_login.xml
new file mode 100644
index 0000000000..ca00822354
--- /dev/null
+++ b/android/src/main/res/layout/account_login.xml
@@ -0,0 +1,12 @@
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <net.mullvad.mullvadvpn.ui.widget.AccountLoginBorder android:id="@+id/account_input_container"
+ android:layout_width="match_parent"
+ android:layout_height="48dp"
+ android:layout_alignParentTop="true">
+ <net.mullvad.mullvadvpn.ui.widget.AccountInput android:id="@+id/account_input"
+ android:layout_width="match_parent"
+ android:layout_height="48dp"
+ android:layout_alignParentTop="true"
+ android:orientation="horizontal" />
+ </net.mullvad.mullvadvpn.ui.widget.AccountLoginBorder>
+</merge>
diff --git a/android/src/main/res/layout/login.xml b/android/src/main/res/layout/login.xml
index 37882d8958..c1224e1d9c 100644
--- a/android/src/main/res/layout/login.xml
+++ b/android/src/main/res/layout/login.xml
@@ -64,15 +64,9 @@
android:textColor="@color/white80"
android:textSize="@dimen/text_small"
android:text="@string/login_description" />
- <net.mullvad.mullvadvpn.ui.widget.AccountLoginBorder android:id="@+id/account_input_container"
- android:layout_width="match_parent"
- android:layout_height="48dp">
- <net.mullvad.mullvadvpn.ui.widget.AccountInput android:id="@+id/account_input"
- android:layout_width="match_parent"
- android:layout_height="48dp"
- android:layout_alignParentTop="true"
- android:orientation="horizontal" />
- </net.mullvad.mullvadvpn.ui.widget.AccountLoginBorder>
+ <net.mullvad.mullvadvpn.ui.widget.AccountLogin android:id="@+id/account_login"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
<ListView android:id="@+id/account_history_list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"