summaryrefslogtreecommitdiffhomepage
path: root/ui/src/main/res/layout
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2020-09-20 13:32:31 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-09-20 13:33:48 +0530
commit7cff4367d7026b5ed2c93fb97735e2146dcecbc1 (patch)
tree9bb0b487bf25182c79204c643d66ba7e9fc17d06 /ui/src/main/res/layout
parent9eaed5e74592c430d4b680df8d9a67fe5fda32f2 (diff)
ui: add navigation hints for D-Pad and IME
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'ui/src/main/res/layout')
-rw-r--r--ui/src/main/res/layout/add_tunnels_bottom_sheet.xml6
-rw-r--r--ui/src/main/res/layout/config_naming_dialog_fragment.xml1
-rw-r--r--ui/src/main/res/layout/tunnel_detail_fragment.xml24
-rw-r--r--ui/src/main/res/layout/tunnel_detail_peer.xml15
-rw-r--r--ui/src/main/res/layout/tunnel_editor_fragment.xml33
-rw-r--r--ui/src/main/res/layout/tunnel_editor_peer.xml24
-rw-r--r--ui/src/main/res/layout/tunnel_list_fragment.xml3
7 files changed, 106 insertions, 0 deletions
diff --git a/ui/src/main/res/layout/add_tunnels_bottom_sheet.xml b/ui/src/main/res/layout/add_tunnels_bottom_sheet.xml
index 41cfe8bd..68f186b6 100644
--- a/ui/src/main/res/layout/add_tunnels_bottom_sheet.xml
+++ b/ui/src/main/res/layout/add_tunnels_bottom_sheet.xml
@@ -15,6 +15,8 @@
android:layout_marginLeft="@dimen/normal_margin"
android:layout_marginEnd="@dimen/normal_margin"
android:layout_marginRight="@dimen/normal_margin"
+ android:nextFocusDown="@id/create_from_qrcode"
+ android:nextFocusForward="@id/create_from_qrcode"
android:text="@string/create_from_file"
android:textAlignment="viewStart"
android:textColor="?attr/colorOnSurface"
@@ -36,6 +38,9 @@
android:layout_marginLeft="@dimen/normal_margin"
android:layout_marginEnd="@dimen/normal_margin"
android:layout_marginRight="@dimen/normal_margin"
+ android:nextFocusUp="@id/create_from_file"
+ android:nextFocusDown="@id/create_empty"
+ android:nextFocusForward="@id/create_empty"
android:text="@string/create_from_qr_code"
android:textAlignment="viewStart"
android:textColor="?attr/colorOnSurface"
@@ -57,6 +62,7 @@
android:layout_marginLeft="@dimen/normal_margin"
android:layout_marginEnd="@dimen/normal_margin"
android:layout_marginRight="@dimen/normal_margin"
+ android:nextFocusUp="@id/create_from_qrcode"
android:text="@string/create_empty"
android:textAlignment="viewStart"
android:textColor="?attr/colorOnSurface"
diff --git a/ui/src/main/res/layout/config_naming_dialog_fragment.xml b/ui/src/main/res/layout/config_naming_dialog_fragment.xml
index 60a904b6..0fd88c6c 100644
--- a/ui/src/main/res/layout/config_naming_dialog_fragment.xml
+++ b/ui/src/main/res/layout/config_naming_dialog_fragment.xml
@@ -22,6 +22,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/tunnel_name"
+ android:imeOptions="actionDone"
android:inputType="textNoSuggestions|textVisiblePassword"
app:filter="@{NameInputFilter.newInstance()}" />
diff --git a/ui/src/main/res/layout/tunnel_detail_fragment.xml b/ui/src/main/res/layout/tunnel_detail_fragment.xml
index ce33c5c5..16bc2ddb 100644
--- a/ui/src/main/res/layout/tunnel_detail_fragment.xml
+++ b/ui/src/main/res/layout/tunnel_detail_fragment.xml
@@ -62,6 +62,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
+ android:nextFocusDown="@id/interface_name_text"
+ android:nextFocusForward="@id/interface_name_text"
app:checked="@{tunnel.state == State.UP}"
app:layout_constraintBaseline_toBaselineOf="@+id/interface_title"
app:layout_constraintEnd_toEndOf="parent"
@@ -83,6 +85,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/name"
+ android:nextFocusUp="@id/tunnel_switch"
+ android:nextFocusDown="@id/public_key_text"
+ android:nextFocusForward="@id/public_key_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:text="@{tunnel.name}"
app:layout_constraintStart_toStartOf="parent"
@@ -107,6 +112,9 @@
android:contentDescription="@string/public_key"
android:ellipsize="end"
android:maxLines="1"
+ android:nextFocusUp="@id/interface_name_text"
+ android:nextFocusDown="@id/addresses_text"
+ android:nextFocusForward="@id/addresses_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:singleLine="true"
android:text="@{config.interface.keyPair.publicKey.toBase64}"
@@ -131,6 +139,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/addresses"
+ android:nextFocusUp="@id/public_key_text"
+ android:nextFocusDown="@id/dns_servers_text"
+ android:nextFocusForward="@id/dns_servers_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:text="@{config.interface.addresses}"
android:visibility="@{config.interface.addresses.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}"
@@ -155,6 +166,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/dns_servers"
+ android:nextFocusUp="@id/addresses_text"
+ android:nextFocusDown="@id/listen_port_text"
+ android:nextFocusForward="@id/listen_port_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:text="@{config.interface.dnsServers}"
android:visibility="@{config.interface.dnsServers.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}"
@@ -181,6 +195,10 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:contentDescription="@string/listen_port"
+ android:nextFocusRight="@id/mtu_text"
+ android:nextFocusUp="@id/dns_servers_text"
+ android:nextFocusDown="@id/applications_text"
+ android:nextFocusForward="@id/mtu_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:text="@{config.interface.listenPort}"
android:visibility="@{!config.interface.listenPort.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
@@ -210,6 +228,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:contentDescription="@string/mtu"
+ android:nextFocusLeft="@id/listen_port_text"
+ android:nextFocusUp="@id/dns_servers_text"
+ android:nextFocusForward="@id/applications_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:text="@{config.interface.mtu}"
android:visibility="@{!config.interface.mtu.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
@@ -237,6 +258,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/applications"
+ android:nextFocusUp="@id/mtu_text"
+ android:nextFocusDown="@id/peers_layout"
+ android:nextFocusForward="@id/peers_layout"
android:onClick="@{ClipboardUtils::copyTextView}"
android:text="@{config.interface.includedApplications.isEmpty() ? @plurals/n_excluded_applications(config.interface.excludedApplications.size(), config.interface.excludedApplications.size()) : @plurals/n_included_applications(config.interface.includedApplications.size(), config.interface.includedApplications.size())}"
android:visibility="@{config.interface.includedApplications.isEmpty() &amp;&amp; config.interface.excludedApplications.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}"
diff --git a/ui/src/main/res/layout/tunnel_detail_peer.xml b/ui/src/main/res/layout/tunnel_detail_peer.xml
index d0836536..0fbee8f1 100644
--- a/ui/src/main/res/layout/tunnel_detail_peer.xml
+++ b/ui/src/main/res/layout/tunnel_detail_peer.xml
@@ -48,6 +48,8 @@
android:contentDescription="@string/public_key"
android:ellipsize="end"
android:maxLines="1"
+ android:nextFocusDown="@id/pre_shared_key_text"
+ android:nextFocusForward="@id/pre_shared_key_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:singleLine="true"
android:text="@{item.publicKey.toBase64}"
@@ -74,6 +76,9 @@
android:contentDescription="@string/pre_shared_key"
android:ellipsize="end"
android:maxLines="1"
+ android:nextFocusUp="@id/public_key_text"
+ android:nextFocusDown="@id/allowed_ips_text"
+ android:nextFocusForward="@id/allowed_ips_text"
android:singleLine="true"
android:text="@string/pre_shared_key_enabled"
android:visibility="@{!item.preSharedKey.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
@@ -98,6 +103,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/allowed_ips"
+ android:nextFocusUp="@id/pre_shared_key_text"
+ android:nextFocusDown="@id/endpoint_text"
+ android:nextFocusForward="@id/endpoint_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:text="@{item.allowedIps}"
android:visibility="@{item.allowedIps.isEmpty() ? android.view.View.GONE : android.view.View.VISIBLE}"
@@ -122,6 +130,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/endpoint"
+ android:nextFocusUp="@id/allowed_ips_text"
+ android:nextFocusDown="@id/persistent_keepalive_text"
+ android:nextFocusForward="@id/persistent_keepalive_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:text="@{item.endpoint}"
android:visibility="@{!item.endpoint.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
@@ -146,6 +157,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/persistent_keepalive"
+ android:nextFocusUp="@id/endpoint_text"
+ android:nextFocusDown="@id/transfer_text"
+ android:nextFocusForward="@id/transfer_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:text="@{@plurals/persistent_keepalive_seconds_unit(item.persistentKeepalive.orElse(0), item.persistentKeepalive.orElse(0))}"
android:visibility="@{!item.persistentKeepalive.isPresent() ? android.view.View.GONE : android.view.View.VISIBLE}"
@@ -173,6 +187,7 @@
android:layout_height="wrap_content"
android:layout_below="@+id/transfer_label"
android:contentDescription="@string/transfer"
+ android:nextFocusUp="@id/persistent_keepalive_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
diff --git a/ui/src/main/res/layout/tunnel_editor_fragment.xml b/ui/src/main/res/layout/tunnel_editor_fragment.xml
index 8b2ff2ec..34f52d03 100644
--- a/ui/src/main/res/layout/tunnel_editor_fragment.xml
+++ b/ui/src/main/res/layout/tunnel_editor_fragment.xml
@@ -76,7 +76,10 @@
android:id="@+id/interface_name_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:imeOptions="actionNext"
android:inputType="textNoSuggestions|textVisiblePassword"
+ android:nextFocusDown="@id/private_key_text"
+ android:nextFocusForward="@id/private_key_text"
android:text="@={name}"
app:filter="@{NameInputFilter.newInstance()}" />
</com.google.android.material.textfield.TextInputLayout>
@@ -98,7 +101,11 @@
android:id="@+id/private_key_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:imeOptions="actionNext"
android:inputType="textNoSuggestions|textPassword"
+ android:nextFocusUp="@id/interface_name_text"
+ android:nextFocusDown="@id/public_key_text"
+ android:nextFocusForward="@id/public_key_text"
android:onClick="@{fragment::onKeyClick}"
android:text="@={config.interface.privateKey}"
app:filter="@{KeyInputFilter.newInstance()}"
@@ -124,6 +131,10 @@
android:ellipsize="end"
android:focusable="false"
android:hint="@string/hint_generated"
+ android:imeOptions="actionNext"
+ android:nextFocusUp="@id/private_key_text"
+ android:nextFocusDown="@id/addresses_label_text"
+ android:nextFocusForward="@id/addresses_label_text"
android:onClick="@{ClipboardUtils::copyTextView}"
android:singleLine="true"
android:text="@{config.interface.publicKey}" />
@@ -145,7 +156,11 @@
android:id="@+id/addresses_label_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:imeOptions="actionNext"
android:inputType="textNoSuggestions|textVisiblePassword"
+ android:nextFocusUp="@id/public_key_text"
+ android:nextFocusDown="@id/dns_servers_text"
+ android:nextFocusForward="@id/listen_port_text"
android:text="@={config.interface.addresses}" />
</com.google.android.material.textfield.TextInputLayout>
@@ -162,10 +177,15 @@
app:layout_constraintTop_toBottomOf="@id/public_key_label_layout">
<com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/listen_port_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_random"
+ android:imeOptions="actionNext"
android:inputType="number"
+ android:nextFocusUp="@id/public_key_text"
+ android:nextFocusDown="@id/mtu_text"
+ android:nextFocusForward="@id/dns_servers_text"
android:text="@={config.interface.listenPort}"
android:textAlignment="center" />
</com.google.android.material.textfield.TextInputLayout>
@@ -187,7 +207,11 @@
android:id="@+id/dns_servers_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:imeOptions="actionNext"
android:inputType="textNoSuggestions|textVisiblePassword"
+ android:nextFocusUp="@id/addresses_label_text"
+ android:nextFocusDown="@id/set_excluded_applications"
+ android:nextFocusForward="@id/mtu_text"
android:text="@={config.interface.dnsServers}" />
</com.google.android.material.textfield.TextInputLayout>
@@ -208,7 +232,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_automatic"
+ android:imeOptions="actionDone"
android:inputType="number"
+ android:nextFocusUp="@id/listen_port_text"
+ android:nextFocusDown="@id/set_excluded_applications"
+ android:nextFocusForward="@id/set_excluded_applications"
android:text="@={config.interface.mtu}"
android:textAlignment="center" />
</com.google.android.material.textfield.TextInputLayout>
@@ -219,6 +247,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
+ android:nextFocusUp="@id/dns_servers_text"
+ android:nextFocusDown="@id/peers_layout"
+ android:nextFocusForward="@id/peers_layout"
android:onClick="@{fragment::onRequestSetExcludedIncludedApplications}"
android:text="@{config.interface.includedApplications.size > 0 ? @plurals/set_included_applications(config.interface.includedApplications.size, config.interface.includedApplications.size) : config.interface.excludedApplications.size > 0 ? @plurals/set_excluded_applications(config.interface.excludedApplications.size, config.interface.excludedApplications.size) : @string/all_applications}"
android:textColor="?attr/colorSecondary"
@@ -231,6 +262,7 @@
</com.google.android.material.card.MaterialCardView>
<LinearLayout
+ android:id="@+id/peers_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@null"
@@ -241,6 +273,7 @@
tools:ignore="UselessLeaf" />
<com.google.android.material.button.MaterialButton
+ android:id="@+id/add_peer_button"
style="@style/Widget.MaterialComponents.Button.TextButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/ui/src/main/res/layout/tunnel_editor_peer.xml b/ui/src/main/res/layout/tunnel_editor_peer.xml
index 76aaa1cd..27a6d125 100644
--- a/ui/src/main/res/layout/tunnel_editor_peer.xml
+++ b/ui/src/main/res/layout/tunnel_editor_peer.xml
@@ -51,6 +51,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@null"
+ android:nextFocusDown="@id/public_key_text"
+ android:nextFocusForward="@id/public_key_text"
android:onClick="@{() -> item.unbind()}"
android:padding="8dp"
android:src="@drawable/ic_action_delete"
@@ -73,7 +75,11 @@
android:id="@+id/public_key_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:imeOptions="actionNext"
android:inputType="textNoSuggestions|textVisiblePassword"
+ android:nextFocusUp="@id/delete"
+ android:nextFocusDown="@id/pre_shared_key_text"
+ android:nextFocusForward="@id/pre_shared_key_text"
android:text="@={item.publicKey}"
app:filter="@{KeyInputFilter.newInstance()}" />
</com.google.android.material.textfield.TextInputLayout>
@@ -94,7 +100,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_optional"
+ android:imeOptions="actionNext"
android:inputType="textNoSuggestions|textPassword"
+ android:nextFocusUp="@id/public_key_text"
+ android:nextFocusDown="@id/persistent_keepalive_text"
+ android:nextFocusForward="@id/persistent_keepalive_text"
android:onClick="@{fragment::onKeyClick}"
android:text="@={item.preSharedKey}"
app:filter="@{KeyInputFilter.newInstance()}"
@@ -118,7 +128,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_optional_discouraged"
+ android:imeOptions="actionNext"
android:inputType="number"
+ android:nextFocusUp="@id/persistent_keepalive_text"
+ android:nextFocusDown="@id/endpoint_text"
+ android:nextFocusForward="@id/endpoint_text"
android:text="@={item.persistentKeepalive}" />
</com.google.android.material.textfield.TextInputLayout>
@@ -136,7 +150,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
+ android:imeOptions="actionNext"
android:inputType="textNoSuggestions|textVisiblePassword"
+ android:nextFocusUp="@id/persistent_keepalive_text"
+ android:nextFocusDown="@id/allowed_ips_text"
+ android:nextFocusForward="@id/allowed_ips_text"
android:text="@={item.endpoint}" />
</com.google.android.material.textfield.TextInputLayout>
@@ -155,7 +173,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
+ android:imeOptions="actionDone"
android:inputType="textNoSuggestions|textVisiblePassword"
+ android:nextFocusUp="@id/endpoint_text"
+ android:nextFocusDown="@id/selected_checkbox"
+ android:nextFocusForward="@id/selected_checkbox"
android:text="@={item.allowedIps}" />
</com.google.android.material.textfield.TextInputLayout>
@@ -166,6 +188,8 @@
android:layout_marginStart="4dp"
android:layout_marginTop="0dp"
android:checked="@={item.excludingPrivateIps}"
+ android:nextFocusDown="@id/add_peer_button"
+ android:nextFocusForward="@id/add_peer_button"
android:text="@string/exclude_private_ips"
android:visibility="@{item.ableToExcludePrivateIps ? View.VISIBLE : View.GONE}"
app:layout_constraintEnd_toEndOf="parent"
diff --git a/ui/src/main/res/layout/tunnel_list_fragment.xml b/ui/src/main/res/layout/tunnel_list_fragment.xml
index 277ecd01..5d39d3a3 100644
--- a/ui/src/main/res/layout/tunnel_list_fragment.xml
+++ b/ui/src/main/res/layout/tunnel_list_fragment.xml
@@ -33,6 +33,8 @@
android:layout_height="match_parent"
android:choiceMode="multipleChoiceModal"
android:clipToPadding="false"
+ android:nextFocusDown="@id/create_fab"
+ android:nextFocusForward="@id/create_fab"
android:paddingBottom="@{@dimen/design_fab_size_normal * 1.1f}"
android:visibility="@{tunnels.size() > 0 ? android.view.View.VISIBLE : android.view.View.GONE}"
app:configurationHandler="@{rowConfigurationHandler}"
@@ -72,6 +74,7 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
+ android:nextFocusUp="@id/tunnel_list"
app:srcCompat="@drawable/ic_action_add_white" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>