summaryrefslogtreecommitdiffhomepage
path: root/ui/src/main/res
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2023-04-24 18:07:03 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2023-04-24 18:07:03 +0200
commitb1b08ce716301d53701f14557f7d3edf0214ab26 (patch)
treed31551784d124053683a370b97a30cc97d7933fc /ui/src/main/res
parent20480992c4514325b4233c7ae8efd3e806b46081 (diff)
ui: display latest handshake time
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/res')
-rw-r--r--ui/src/main/res/layout/tunnel_detail_peer.xml30
-rw-r--r--ui/src/main/res/values/strings.xml2
2 files changed, 31 insertions, 1 deletions
diff --git a/ui/src/main/res/layout/tunnel_detail_peer.xml b/ui/src/main/res/layout/tunnel_detail_peer.xml
index ccbf27ef..25081cea 100644
--- a/ui/src/main/res/layout/tunnel_detail_peer.xml
+++ b/ui/src/main/res/layout/tunnel_detail_peer.xml
@@ -171,7 +171,7 @@
android:id="@+id/transfer_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_below="@+id/endpoint_text"
+ android:layout_below="@+id/persistent_keepalive_text"
android:layout_marginTop="8dp"
android:labelFor="@+id/transfer_text"
android:text="@string/transfer"
@@ -194,6 +194,34 @@
app:layout_constraintTop_toBottomOf="@+id/transfer_label"
tools:text="1024 MB"
tools:visibility="visible" />
+
+ <TextView
+ android:id="@+id/latest_handshake_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/transfer_text"
+ android:layout_marginTop="8dp"
+ android:labelFor="@+id/latest_handshake_text"
+ android:text="@string/latest_handshake"
+ android:visibility="gone"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/transfer_text"
+ tools:visibility="visible" />
+
+ <TextView
+ android:id="@+id/latest_handshake_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/latest_handshake_label"
+ android:contentDescription="@string/latest_handshake"
+ android:nextFocusUp="@id/transfer_text"
+ android:onClick="@{ClipboardUtils::copyTextView}"
+ android:textAppearance="?attr/textAppearanceBodyLarge"
+ android:visibility="gone"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/latest_handshake_label"
+ tools:text="4 minutes, 27 seconds ago"
+ tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</layout>
diff --git a/ui/src/main/res/values/strings.xml b/ui/src/main/res/values/strings.xml
index bc85bdbf..e842a393 100644
--- a/ui/src/main/res/values/strings.xml
+++ b/ui/src/main/res/values/strings.xml
@@ -140,6 +140,8 @@
<string name="key_length_explanation_base64">: WireGuard base64 keys must be 44 characters (32 bytes)</string>
<string name="key_length_explanation_binary">: WireGuard keys must be 32 bytes</string>
<string name="key_length_explanation_hex">: WireGuard hex keys must be 64 characters (32 bytes)</string>
+ <string name="latest_handshake">Latest handshake</string>
+ <string name="latest_handshake_ago">%s ago</string>
<string name="listen_port">Listen port</string>
<string name="log_export_error">Unable to export log: %s</string>
<string name="log_export_subject">WireGuard Android Log File</string>