summaryrefslogtreecommitdiffhomepage
path: root/ui/src/main/res/layout/tunnel_editor_peer.xml
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-03-09 19:06:11 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-03-09 19:24:27 +0530
commit7d48bef70a56d4370856eedab619b1f83ac3d0d0 (patch)
tree76fd859578e499cd3a8fd2f402652530ea36a72d /ui/src/main/res/layout/tunnel_editor_peer.xml
parent6bc3e257f80a273d35d07099bd4ed99eb45163bf (diff)
Rename app module to ui
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'ui/src/main/res/layout/tunnel_editor_peer.xml')
-rw-r--r--ui/src/main/res/layout/tunnel_editor_peer.xml161
1 files changed, 161 insertions, 0 deletions
diff --git a/ui/src/main/res/layout/tunnel_editor_peer.xml b/ui/src/main/res/layout/tunnel_editor_peer.xml
new file mode 100644
index 00000000..cf5d6286
--- /dev/null
+++ b/ui/src/main/res/layout/tunnel_editor_peer.xml
@@ -0,0 +1,161 @@
+<?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>
+
+ <import type="android.view.View" />
+
+ <import type="com.wireguard.android.widget.KeyInputFilter" />
+
+ <variable
+ name="collection"
+ type="androidx.databinding.ObservableList&lt;com.wireguard.android.viewmodel.PeerProxy&gt;" />
+
+ <variable
+ name="item"
+ type="com.wireguard.android.viewmodel.PeerProxy" />
+ </data>
+
+ <androidx.cardview.widget.CardView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="4dp"
+ android:layout_marginEnd="8dp"
+ android:layout_marginStart="8dp"
+ android:layout_marginTop="4dp"
+ android:background="?attr/colorBackground"
+ app:cardCornerRadius="4dp"
+ app:cardElevation="2dp"
+ app:contentPadding="8dp">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@+id/peer_title"
+ style="?android:attr/textAppearanceMedium"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentTop="true"
+ android:layout_marginBottom="8dp"
+ android:layout_toStartOf="@+id/peer_action_delete"
+ android:text="@string/peer" />
+
+ <ImageButton
+ android:id="@+id/peer_action_delete"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentEnd="true"
+ android:layout_alignParentTop="true"
+ android:background="@null"
+ android:contentDescription="@string/delete"
+ android:onClick="@{() -> item.unbind()}"
+ android:src="@drawable/ic_action_delete" />
+
+ <TextView
+ android:id="@+id/public_key_label"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/peer_title"
+ android:labelFor="@+id/public_key_text"
+ android:text="@string/public_key" />
+
+ <EditText
+ android:id="@+id/public_key_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/public_key_label"
+ android:inputType="textNoSuggestions|textVisiblePassword"
+ android:text="@={item.publicKey}"
+ app:filter="@{KeyInputFilter.newInstance()}" />
+
+ <TextView
+ android:id="@+id/pre_shared_key_label"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/public_key_text"
+ android:labelFor="@+id/pre_shared_key_text"
+ android:text="@string/pre_shared_key" />
+
+ <EditText
+ android:id="@+id/pre_shared_key_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/pre_shared_key_label"
+ android:hint="@string/hint_optional"
+ android:inputType="textNoSuggestions|textVisiblePassword"
+ android:text="@={item.preSharedKey}" />
+
+ <TextView
+ android:id="@+id/allowed_ips_label"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/pre_shared_key_text"
+ android:layout_toStartOf="@+id/exclude_private_ips"
+ android:labelFor="@+id/allowed_ips_text"
+ android:text="@string/allowed_ips" />
+
+ <CheckBox
+ android:id="@+id/exclude_private_ips"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/allowed_ips_label"
+ android:layout_alignParentEnd="true"
+ android:checked="@={item.excludingPrivateIps}"
+ android:text="@string/exclude_private_ips"
+ android:visibility="@{item.ableToExcludePrivateIps ? View.VISIBLE : View.GONE}" />
+
+ <EditText
+ android:id="@+id/allowed_ips_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/allowed_ips_label"
+ android:inputType="textNoSuggestions|textVisiblePassword"
+ android:text="@={item.allowedIps}" />
+
+ <TextView
+ android:id="@+id/endpoint_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_below="@+id/allowed_ips_text"
+ android:layout_toStartOf="@+id/persistent_keepalive_label"
+ android:labelFor="@+id/endpoint_text"
+ android:text="@string/endpoint" />
+
+ <EditText
+ android:id="@+id/endpoint_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentStart="true"
+ android:layout_below="@+id/endpoint_label"
+ android:layout_toStartOf="@+id/persistent_keepalive_text"
+ android:inputType="textNoSuggestions|textVisiblePassword"
+ android:text="@={item.endpoint}" />
+
+ <TextView
+ android:id="@+id/persistent_keepalive_label"
+ android:layout_width="96dp"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/endpoint_label"
+ android:layout_alignParentEnd="true"
+ android:labelFor="@+id/persistent_keepalive_text"
+ android:text="@string/persistent_keepalive" />
+
+ <EditText
+ android:id="@+id/persistent_keepalive_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/endpoint_text"
+ android:layout_alignParentEnd="true"
+ android:layout_alignStart="@+id/persistent_keepalive_label"
+ android:hint="@string/hint_optional"
+ android:inputType="number"
+ android:text="@={item.persistentKeepalive}"
+ android:textAlignment="center" />
+ </RelativeLayout>
+ </androidx.cardview.widget.CardView>
+</layout>