From 03189e7b20b326b83ab484c436214f1610334c73 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 22 Sep 2020 20:37:41 +0200 Subject: tv: add text when there are no tunnels Signed-off-by: Jason A. Donenfeld --- .../com/wireguard/android/activity/TvMainActivity.kt | 2 ++ ui/src/main/res/layout/tv_activity.xml | 16 +++++++++++++++- ui/src/main/res/values/strings.xml | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) (limited to 'ui/src') diff --git a/ui/src/main/java/com/wireguard/android/activity/TvMainActivity.kt b/ui/src/main/java/com/wireguard/android/activity/TvMainActivity.kt index d6840993..2b12d545 100644 --- a/ui/src/main/java/com/wireguard/android/activity/TvMainActivity.kt +++ b/ui/src/main/java/com/wireguard/android/activity/TvMainActivity.kt @@ -84,6 +84,8 @@ class TvMainActivity : AppCompatActivity() { if (isDeleting.get()) { try { item.deleteAsync() + if (this@TvMainActivity.binding.tunnels?.isEmpty() != false) + isDeleting.set(false) } catch (e: Throwable) { val error = ErrorMessages[e] val message = getString(R.string.config_delete_error, error) diff --git a/ui/src/main/res/layout/tv_activity.xml b/ui/src/main/res/layout/tv_activity.xml index 75fe6490..5e29ed5f 100644 --- a/ui/src/main/res/layout/tv_activity.xml +++ b/ui/src/main/res/layout/tv_activity.xml @@ -35,8 +35,8 @@ android:layout_marginTop="5dp" app:cardElevation="2dp" app:contentPadding="0dp" - app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> + + Delete Select tunnel to delete Your TV does not have a file picker + Add a tunnel to get started Disable config exporting Disabling config exporting makes private keys less accessible DNS servers -- cgit v1.2.3