summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/res/layout
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r--app/src/main/res/layout/config_activity.xml (renamed from app/src/main/res/layout/profile_list_activity.xml)2
-rw-r--r--app/src/main/res/layout/config_detail_fragment.xml (renamed from app/src/main/res/layout/profile_detail_fragment.xml)35
-rw-r--r--app/src/main/res/layout/config_edit_fragment.xml164
-rw-r--r--app/src/main/res/layout/config_list_fragment.xml (renamed from app/src/main/res/layout/profile_list_fragment.xml)11
-rw-r--r--app/src/main/res/layout/config_list_item.xml (renamed from app/src/main/res/layout/profile_list_item.xml)11
-rw-r--r--app/src/main/res/layout/profile_detail_activity.xml6
-rw-r--r--app/src/main/res/layout/profile_edit_activity.xml6
-rw-r--r--app/src/main/res/layout/profile_edit_fragment.xml38
8 files changed, 196 insertions, 77 deletions
diff --git a/app/src/main/res/layout/profile_list_activity.xml b/app/src/main/res/layout/config_activity.xml
index 41d772a7..d67e64bc 100644
--- a/app/src/main/res/layout/profile_list_activity.xml
+++ b/app/src/main/res/layout/config_activity.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/list_container"
+ android:id="@+id/master_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
diff --git a/app/src/main/res/layout/profile_detail_fragment.xml b/app/src/main/res/layout/config_detail_fragment.xml
index c08236ce..1bae0450 100644
--- a/app/src/main/res/layout/profile_detail_fragment.xml
+++ b/app/src/main/res/layout/config_detail_fragment.xml
@@ -1,44 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
-<layout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
+<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
- name="profile"
- type="com.wireguard.config.Profile" />
+ name="config"
+ type="com.wireguard.config.Config" />
</data>
<ScrollView
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:padding="16dp">
+ android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:padding="16dp">
<TextView
- android:id="@+id/profile_name_label"
+ android:id="@+id/config_name_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
- android:labelFor="@+id/profile_name_text"
- android:text="@string/profile_name" />
+ android:labelFor="@+id/config_name_text"
+ android:text="@string/config_name" />
<TextView
- android:id="@+id/profile_name_text"
+ android:id="@+id/config_name_text"
style="?android:attr/textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_below="@+id/profile_name_label"
- android:text="@{profile.name}" />
+ android:layout_below="@+id/config_name_label"
+ android:text="@{config.name}" />
<TextView
android:id="@+id/public_key_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_below="@+id/profile_name_text"
+ android:layout_below="@+id/config_name_text"
android:labelFor="@+id/public_key_text"
android:text="@string/public_key" />
@@ -50,7 +49,13 @@
android:layout_below="@+id/public_key_label"
android:ellipsize="end"
android:maxLines="1"
- android:text="@{profile.interface.publicKey}" />
+ android:text="@{config.interface.publicKey}" />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/public_key_text"
+ android:text="@{config.toString()}" />
</RelativeLayout>
</ScrollView>
</layout>
diff --git a/app/src/main/res/layout/config_edit_fragment.xml b/app/src/main/res/layout/config_edit_fragment.xml
new file mode 100644
index 00000000..3351c008
--- /dev/null
+++ b/app/src/main/res/layout/config_edit_fragment.xml
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <data>
+
+ <variable
+ name="config"
+ type="com.wireguard.config.Config" />
+ </data>
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:padding="16dp">
+
+ <TextView
+ android:id="@+id/config_name_label"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:labelFor="@+id/config_name_text"
+ android:text="@string/config_name" />
+
+ <EditText
+ android:id="@+id/config_name_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/config_name_label"
+ android:inputType="textCapWords"
+ android:text="@={config.name}" />
+
+ <TextView
+ android:id="@+id/private_key_label"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/config_name_text"
+ android:labelFor="@+id/private_key_text"
+ android:text="@string/private_key" />
+
+ <EditText
+ android:id="@+id/private_key_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_below="@+id/private_key_label"
+ android:layout_toStartOf="@+id/generate_private_key_button"
+ android:inputType="textVisiblePassword"
+ android:text="@={config.interface.privateKey}" />
+
+ <Button
+ android:id="@+id/generate_private_key_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignBottom="@id/private_key_text"
+ android:layout_alignParentEnd="true"
+ android:layout_below="@+id/private_key_label"
+ android:onClick="@{() -> config.interface.generateKeypair()}"
+ android:text="@string/generate" />
+
+ <TextView
+ android:id="@+id/public_key_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_below="@+id/private_key_text"
+ android:layout_toStartOf="@+id/listen_port_label"
+ android:labelFor="@+id/public_key_text"
+ android:text="@string/public_key" />
+
+ <TextView
+ android:id="@+id/public_key_text"
+ style="@android:style/Widget.EditText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_below="@+id/public_key_label"
+ android:layout_toStartOf="@+id/listen_port_text"
+ android:ellipsize="end"
+ android:focusable="false"
+ android:hint="@string/hint_generated"
+ android:maxLines="1"
+ android:text="@{config.interface.publicKey}" />
+
+ <TextView
+ android:id="@+id/listen_port_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/public_key_label"
+ android:layout_alignParentEnd="true"
+ android:layout_alignStart="@+id/generate_private_key_button"
+ android:layout_below="@+id/generate_private_key_button"
+ android:labelFor="@+id/listen_port_text"
+ android:text="@string/listen_port" />
+
+ <EditText
+ android:id="@+id/listen_port_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/public_key_text"
+ android:layout_alignParentEnd="true"
+ android:layout_alignStart="@+id/generate_private_key_button"
+ android:layout_below="@+id/listen_port_label"
+ android:hint="@string/hint_random"
+ android:inputType="number"
+ android:text="@={config.interface.listenPort}"
+ android:textAlignment="center" />
+
+ <TextView
+ android:id="@+id/dns_server_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_below="@+id/public_key_text"
+ android:layout_toStartOf="@+id/mtu_label"
+ android:labelFor="@+id/dns_server_text"
+ android:text="@string/dns_servers" />
+
+ <EditText
+ android:id="@+id/dns_server_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_below="@+id/dns_server_label"
+ android:layout_toStartOf="@+id/mtu_text"
+ android:hint="@string/hint_optional"
+ android:inputType="text"
+ android:text="@={config.interface.dns}" />
+
+ <TextView
+ android:id="@+id/mtu_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/dns_server_label"
+ android:layout_alignParentEnd="true"
+ android:layout_alignStart="@+id/generate_private_key_button"
+ android:layout_below="@+id/listen_port_text"
+ android:labelFor="@+id/mtu_text"
+ android:text="@string/mtu" />
+
+ <EditText
+ android:id="@+id/mtu_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/dns_server_text"
+ android:layout_alignParentEnd="true"
+ android:layout_alignStart="@+id/generate_private_key_button"
+ android:layout_below="@+id/mtu_label"
+ android:hint="@string/hint_automatic"
+ android:inputType="number"
+ android:text="@={config.interface.mtu}"
+ android:textAlignment="center" />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/dns_server_text"
+ android:text="@{config.toString()}" />
+ </RelativeLayout>
+ </ScrollView>
+</layout>
diff --git a/app/src/main/res/layout/profile_list_fragment.xml b/app/src/main/res/layout/config_list_fragment.xml
index f5954092..155e708a 100644
--- a/app/src/main/res/layout/profile_list_fragment.xml
+++ b/app/src/main/res/layout/config_list_fragment.xml
@@ -6,14 +6,15 @@
<!--suppress AndroidDomInspection -->
<variable
- name="profiles"
- type="android.databinding.ObservableArrayMap&lt;String, com.wireguard.config.Profile&gt;" />
+ name="configs"
+ type="android.databinding.ObservableArrayMap&lt;String, com.wireguard.config.Config&gt;" />
</data>
<ListView
- android:id="@+id/profile_list"
+ android:id="@+id/config_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
- app:items="@{profiles}"
- app:layout="@{@layout/profile_list_item}" />
+ android:choiceMode="singleChoice"
+ app:items="@{configs}"
+ app:layout="@{@layout/config_list_item}" />
</layout>
diff --git a/app/src/main/res/layout/profile_list_item.xml b/app/src/main/res/layout/config_list_item.xml
index 22e93f5c..33f447c8 100644
--- a/app/src/main/res/layout/profile_list_item.xml
+++ b/app/src/main/res/layout/config_list_item.xml
@@ -5,17 +5,16 @@
<variable
name="item"
- type="com.wireguard.config.Profile" />
+ type="com.wireguard.config.Config" />
</data>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="?android:attr/activatedBackgroundIndicator"
android:padding="16dp">
<TextView
- android:id="@+id/profile_name"
+ android:id="@+id/config_name"
style="?android:attr/textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -26,9 +25,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
- android:layout_toEndOf="@+id/profile_name"
- android:text="@{item.isConnected ? @string/connected : @string/disconnected}"
+ android:layout_toEndOf="@+id/config_name"
+ android:text="@{item.isEnabled ? @string/connected : @string/disconnected}"
android:textAlignment="textEnd"
- android:textColor="@{item.isConnected ? @android:color/holo_green_dark : @android:color/holo_red_dark}" />
+ android:textColor="@{item.isEnabled ? @android:color/holo_green_dark : @android:color/holo_red_dark}" />
</RelativeLayout>
</layout>
diff --git a/app/src/main/res/layout/profile_detail_activity.xml b/app/src/main/res/layout/profile_detail_activity.xml
deleted file mode 100644
index 0be8d4bd..00000000
--- a/app/src/main/res/layout/profile_detail_activity.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<fragment xmlns:android="http://schemas.android.com/apk/res/android"
- android:name="com.wireguard.android.ProfileDetailFragment"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:tag="detail" />
diff --git a/app/src/main/res/layout/profile_edit_activity.xml b/app/src/main/res/layout/profile_edit_activity.xml
deleted file mode 100644
index aee54638..00000000
--- a/app/src/main/res/layout/profile_edit_activity.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<fragment xmlns:android="http://schemas.android.com/apk/res/android"
- android:name="com.wireguard.android.ProfileEditFragment"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:tag="edit" />
diff --git a/app/src/main/res/layout/profile_edit_fragment.xml b/app/src/main/res/layout/profile_edit_fragment.xml
deleted file mode 100644
index 2c25257b..00000000
--- a/app/src/main/res/layout/profile_edit_fragment.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
-
- <data>
-
- <variable
- name="profile"
- type="com.wireguard.config.Profile" />
- </data>
-
- <ScrollView
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:padding="16dp">
-
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <TextView
- android:id="@+id/profile_name_label"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:labelFor="@+id/profile_name_text"
- android:text="@string/profile_name" />
-
- <EditText
- android:id="@+id/profile_name_text"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/profile_name_label"
- android:inputType="textCapWords"
- android:text="@={profile.name}" />
- </RelativeLayout>
- </ScrollView>
-</layout>