]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Fix restoring of the current page on restart. https://redmine.stoutner.com/issues...
authorSoren Stoutner <soren@stoutner.com>
Tue, 6 Jun 2023 20:37:26 +0000 (13:37 -0700)
committerSoren Stoutner <soren@stoutner.com>
Tue, 6 Jun 2023 20:37:26 +0000 (13:37 -0700)
app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.kt
app/src/main/res/values-es/strings.xml

index 8614ec7b8969eeb049b0227d2a4c7a17c37a78eb..0dab90f19e458e0414bb153bf1eeaf182930867e 100644 (file)
@@ -3968,8 +3968,17 @@ class MainWebViewActivity : AppCompatActivity(), CreateBookmarkDialog.CreateBook
                 // Set the first page as the current WebView.
                 setCurrentWebView(0)
             } else {  // The first tab is not selected.
-                // Move to the selected tab.
-                webViewViewPager2.currentItem = savedTabPosition
+                // Create a handler move to the page.
+                val setCurrentPageHandler = Handler(Looper.getMainLooper())
+
+                // Create a runnable to move to the page.
+                val setCurrentPageRunnable = Runnable {
+                    // Move to the page.
+                    webViewViewPager2.currentItem = savedTabPosition
+                }
+
+                // Move to the page after 50 milliseconds, which should be enough time to for the WebView state adapter to populate the restored pages.
+                setCurrentPageHandler.postDelayed(setCurrentPageRunnable, 50)
             }
 
             // Get the intent that started the app.
index aeafdde697af1cb025354318eedef71f6a9f0651..fa21f36f65f3486834c544509cc098cec6f0617f 100644 (file)
         <string name="sorted_by_database_id">Ordenados por ID de base de datos.</string>
         <string name="sorted_by_display_order">Ordenados por orden de visualización.</string>
     <string name="database_id">ID de base de datos:</string>
+    <string name="folder_id">ID de carpeta:</string>
+    <string name="folder_id_separator">\u0020 â€“ %1$d</string>
     <string name="folder">Carpeta:</string>
     <string name="parent_folder">Carpeta superior:</string>
     <string name="display_order">Mostrar orden:</string>