From 75252cf9d54279af16eb4057c045450b32788c7b Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 28 Mar 2020 14:45:28 -0600 Subject: [PATCH] TunnelEditor: move hint to label and add discouraged optional Signed-off-by: Jason A. Donenfeld --- ui/src/main/res/layout/tunnel_editor_fragment.xml | 8 ++++---- ui/src/main/res/layout/tunnel_editor_peer.xml | 8 ++++---- ui/src/main/res/values/strings.xml | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ui/src/main/res/layout/tunnel_editor_fragment.xml b/ui/src/main/res/layout/tunnel_editor_fragment.xml index 214f3b5a..b8c6a5a1 100644 --- a/ui/src/main/res/layout/tunnel_editor_fragment.xml +++ b/ui/src/main/res/layout/tunnel_editor_fragment.xml @@ -72,6 +72,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_margin="4dp" + android:hint="@string/name" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/interface_title"> @@ -80,7 +81,6 @@ android:id="@+id/interface_name_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/name" android:inputType="textNoSuggestions|textVisiblePassword" android:text="@={name}" app:filter="@{NameInputFilter.newInstance()}" /> @@ -92,6 +92,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_margin="4dp" + android:hint="@string/private_key" app:layout_constraintEnd_toStartOf="@id/generate_private_key_button" app:layout_constraintHorizontal_chainStyle="spread" app:layout_constraintHorizontal_weight="0.7" @@ -102,7 +103,6 @@ android:id="@+id/private_key_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/private_key" android:inputType="textNoSuggestions|textVisiblePassword" android:text="@={config.interface.privateKey}" app:filter="@{KeyInputFilter.newInstance()}" /> @@ -153,6 +153,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_margin="4dp" + android:hint="@string/addresses" app:layout_constraintEnd_toStartOf="@id/listen_port_label_layout" app:layout_constraintHorizontal_chainStyle="spread" app:layout_constraintHorizontal_weight="0.7" @@ -163,7 +164,6 @@ android:id="@+id/addresses_label_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/addresses" android:inputType="textNoSuggestions|textVisiblePassword" android:text="@={config.interface.addresses}" /> @@ -196,6 +196,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_margin="4dp" + android:hint="@string/dns_servers" app:layout_constraintEnd_toStartOf="@id/mtu_label_layout" app:layout_constraintHorizontal_chainStyle="spread" app:layout_constraintHorizontal_weight="0.7" @@ -206,7 +207,6 @@ android:id="@+id/dns_servers_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/dns_servers" android:inputType="textNoSuggestions|textVisiblePassword" android:text="@={config.interface.dnsServers}" /> diff --git a/ui/src/main/res/layout/tunnel_editor_peer.xml b/ui/src/main/res/layout/tunnel_editor_peer.xml index 57b04f48..cac20e30 100644 --- a/ui/src/main/res/layout/tunnel_editor_peer.xml +++ b/ui/src/main/res/layout/tunnel_editor_peer.xml @@ -62,6 +62,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_margin="4dp" + android:hint="@string/public_key" app:layout_constraintBottom_toTopOf="@+id/pre_shared_key_label_layout" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -71,7 +72,6 @@ android:id="@+id/public_key_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/public_key" android:inputType="textNoSuggestions|textVisiblePassword" android:text="@={item.publicKey}" app:filter="@{KeyInputFilter.newInstance()}" /> @@ -112,7 +112,7 @@ android:id="@+id/persistent_keepalive_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/hint_optional" + android:hint="@string/hint_optional_discouraged" android:inputType="number" android:text="@={item.persistentKeepalive}" /> @@ -123,6 +123,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="4dp" + android:hint="@string/endpoint" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/persistent_keepalive_label_layout"> @@ -131,7 +132,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentStart="true" - android:hint="@string/endpoint" android:inputType="textNoSuggestions|textVisiblePassword" android:text="@={item.endpoint}" /> @@ -144,6 +144,7 @@ android:layout_marginStart="4dp" android:layout_marginTop="4dp" android:layout_marginEnd="4dp" + android:hint="@string/allowed_ips" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/endpoint_label_layout"> @@ -152,7 +153,6 @@ android:id="@+id/allowed_ips_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:hint="@string/allowed_ips" android:inputType="textNoSuggestions|textVisiblePassword" android:text="@={item.allowedIps}" /> diff --git a/ui/src/main/res/values/strings.xml b/ui/src/main/res/values/strings.xml index 9d855bda..04582606 100644 --- a/ui/src/main/res/values/strings.xml +++ b/ui/src/main/res/values/strings.xml @@ -82,6 +82,7 @@ (auto) (generated) (optional) + (optional, not recommended) (random) Illegal file name ā€œ%sā€ Unable to import tunnel: %s