From fb3fec299f57408b0b3b10387561b6fc9fceac9f Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 28 Mar 2020 02:52:14 +0530 Subject: TunnelEditor: replace tunnel detail view with ConstraintLayout implementation Signed-off-by: Harsh Shandilya --- ui/src/main/res/layout/tunnel_detail_fragment.xml | 224 +++++++------ ui/src/main/res/layout/tunnel_detail_peer.xml | 81 +++-- ui/src/main/res/layout/tunnel_editor_fragment.xml | 378 +++++++++++----------- ui/src/main/res/layout/tunnel_editor_peer.xml | 245 +++++++------- 4 files changed, 492 insertions(+), 436 deletions(-) (limited to 'ui/src/main/res/layout') diff --git a/ui/src/main/res/layout/tunnel_detail_fragment.xml b/ui/src/main/res/layout/tunnel_detail_fragment.xml index 134b61e5..8e2b8e20 100644 --- a/ui/src/main/res/layout/tunnel_detail_fragment.xml +++ b/ui/src/main/res/layout/tunnel_detail_fragment.xml @@ -22,118 +22,130 @@ type="com.wireguard.config.Config" /> - - - - + + - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:labelFor="@+id/interface_name_text" + android:text="@string/name" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/interface_title"/> + + + + + + + + + + + + + + + diff --git a/ui/src/main/res/layout/tunnel_detail_peer.xml b/ui/src/main/res/layout/tunnel_detail_peer.xml index 79a48f38..ac1a9660 100644 --- a/ui/src/main/res/layout/tunnel_detail_peer.xml +++ b/ui/src/main/res/layout/tunnel_detail_peer.xml @@ -1,6 +1,7 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools"> @@ -11,84 +12,91 @@ type="com.wireguard.config.Peer" /> - - - + android:text="@string/peer" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent"/> + android:text="@string/public_key" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/peer_title"/> + android:text="@{item.publicKey.toBase64}" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/public_key_label" + tools:text="wOs2eguFEohqIZxlSJ1CAT9584tc6ejj9hfGFsoBVkA="/> + android:text="@string/allowed_ips" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/public_key_text"/> + android:text="@{item.allowedIps}" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/allowed_ips_label" + tools:text="0.0.0.0/5, 8.0.0.0/7, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3"/> + android:text="@string/endpoint" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/allowed_ips_text"/> + android:text="@{item.endpoint}" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/endpoint_label" + tools:text="192.168.0.1:51820" /> + android:visibility="gone" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/endpoint_text" + tools:visibility="visible" /> - - + android:visibility="gone" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/transfer_label" + tools:visibility="visible" + tools:text="1024 MB" /> + + diff --git a/ui/src/main/res/layout/tunnel_editor_fragment.xml b/ui/src/main/res/layout/tunnel_editor_fragment.xml index 1d9d21de..bef3fb25 100644 --- a/ui/src/main/res/layout/tunnel_editor_fragment.xml +++ b/ui/src/main/res/layout/tunnel_editor_fragment.xml @@ -25,230 +25,248 @@ + android:id="@+id/main_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="?attr/colorBackground"> + android:layout_height="wrap_content"> - - - + android:layout_margin="8dp" + android:layout_marginTop="32dp" + android:text="@string/interface_title" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - - - - - + android:layout_margin="4dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/interface_title"> - + + + - -