summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2023-03-30 15:15:39 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2023-03-30 15:15:39 +0200
commit58c19385a384585911f7089dcc15ec26a6cebc3b (patch)
tree5291e0a5eeb456659aef65a4d7ade6806e9fc94c
parent354e1c0ed93f0c90aa83b1789daa9d861c8b7cca (diff)
ui: do not allow double clicking fab to show menu twice
Exception java.lang.IllegalStateException: at androidx.fragment.app.FragmentStore.addFragment (FragmentStore.java:92) at androidx.fragment.app.FragmentManager.addFragment (FragmentManager.java:1481) at androidx.fragment.app.BackStackRecord.executeOps (BackStackRecord.java:387) at androidx.fragment.app.FragmentManager.executeOps (FragmentManager.java:1965) at androidx.fragment.app.FragmentManager.executeOpsTogether (FragmentManager.java:1873) at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute (FragmentManager.java:1823) at androidx.fragment.app.FragmentManager.execPendingActions (FragmentManager.java:1760) at androidx.fragment.app.FragmentManager$5.run (FragmentManager.java:547) at android.os.Handler.handleCallback (Handler.java:938) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loop (Looper.java:268) at android.app.ActivityThread.main (ActivityThread.java:8101) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:627) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:997) Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt2
1 files changed, 2 insertions, 0 deletions
diff --git a/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt b/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt
index e6270d0e..1c531dbf 100644
--- a/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt
+++ b/ui/src/main/java/com/wireguard/android/fragment/TunnelListFragment.kt
@@ -97,6 +97,8 @@ class TunnelListFragment : BaseFragment() {
val bottomSheet = AddTunnelsSheet()
binding?.apply {
createFab.setOnClickListener {
+ if (childFragmentManager.findFragmentByTag("BOTTOM_SHEET") != null)
+ return@setOnClickListener
childFragmentManager.setFragmentResultListener(AddTunnelsSheet.REQUEST_KEY_NEW_TUNNEL, viewLifecycleOwner) { _, bundle ->
when (bundle.getString(AddTunnelsSheet.REQUEST_METHOD)) {
AddTunnelsSheet.REQUEST_CREATE -> {