]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Always close the drawers when opening a new intent. https://redmine.stoutner.com...
authorSoren Stoutner <soren@stoutner.com>
Thu, 19 Oct 2023 16:21:33 +0000 (09:21 -0700)
committerSoren Stoutner <soren@stoutner.com>
Thu, 19 Oct 2023 16:21:33 +0000 (09:21 -0700)
app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.kt

index 27a3d462eb5ec727ad2321b799b00f322d79c431..2c7560d6c459a90370f0bed7f6f77a2fdefa81ec 100644 (file)
@@ -726,6 +726,14 @@ class MainWebViewActivity : AppCompatActivity(), CreateBookmarkDialog.CreateBook
         // Run the default commands.
         super.onNewIntent(intent)
 
+        // Close the navigation drawer if it is open.
+        if (drawerLayout.isDrawerVisible(GravityCompat.START))
+            drawerLayout.closeDrawer(GravityCompat.START)
+
+        // Close the bookmarks drawer if it is open.
+        if (drawerLayout.isDrawerVisible(GravityCompat.END))
+            drawerLayout.closeDrawer(GravityCompat.END)
+
         // Get the information from the intent.
         val intentAction = intent.action
         val intentUriData = intent.data
@@ -773,14 +781,6 @@ class MainWebViewActivity : AppCompatActivity(), CreateBookmarkDialog.CreateBook
                     // Make it so.
                     loadUrl(currentWebView!!, url!!)
                 }
-
-                // Close the navigation drawer if it is open.
-                if (drawerLayout.isDrawerVisible(GravityCompat.START))
-                    drawerLayout.closeDrawer(GravityCompat.START)
-
-                // Close the bookmarks drawer if it is open.
-                if (drawerLayout.isDrawerVisible(GravityCompat.END))
-                    drawerLayout.closeDrawer(GravityCompat.END)
             }
         } else {  // The app has been restarted.
             // If the new intent will open a new tab, set the saved tab position to be the size of the saved state array list.