summaryrefslogtreecommitdiffhomepage
path: root/ui
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-09-23 10:08:28 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2020-09-23 17:56:37 +0200
commit7bec539722b670f8e101c65914e0a8e59be90dd7 (patch)
tree2ef8346d9cd993c339ca0c524a268f5f0de1c36e /ui
parenta8dfebb0862a4ebccf2f1b72724fd8219c2d2777 (diff)
tv: escape deletion view with back button
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/src/main/java/com/wireguard/android/activity/TvMainActivity.kt7
1 files changed, 7 insertions, 0 deletions
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 ad86f12d..fd9f31b5 100644
--- a/ui/src/main/java/com/wireguard/android/activity/TvMainActivity.kt
+++ b/ui/src/main/java/com/wireguard/android/activity/TvMainActivity.kt
@@ -135,6 +135,13 @@ class TvMainActivity : AppCompatActivity() {
}
}
+ override fun onBackPressed() {
+ if (isDeleting.get())
+ isDeleting.set(false)
+ else
+ super.onBackPressed()
+ }
+
private suspend fun updateStats() {
binding.tunnelList.forEach { viewItem ->
val listItem = DataBindingUtil.findBinding<TvTunnelListItemBinding>(viewItem)