aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/src/main/java
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/src/main/java
parenttv: select first item after toggling deletion mode (diff)
downloadwireguard-android-7bec539722b670f8e101c65914e0a8e59be90dd7.tar.xz
wireguard-android-7bec539722b670f8e101c65914e0a8e59be90dd7.zip
tv: escape deletion view with back button
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/java')
-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 ad86f12..fd9f31b 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)