Fix problems with audio still playing after a tab is closed. https://redmine.stoutne...
authorSoren Stoutner <soren@stoutner.com>
Fri, 9 Oct 2020 23:42:42 +0000 (16:42 -0700)
committerSoren Stoutner <soren@stoutner.com>
Fri, 9 Oct 2020 23:42:42 +0000 (16:42 -0700)
17 files changed:
app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
app/src/main/res/layout/about_coordinatorlayout.xml
app/src/main/res/layout/bookmarks_coordinatorlayout.xml
app/src/main/res/layout/bookmarks_databaseview_coordinatorlayout.xml
app/src/main/res/layout/domains_coordinatorlayout.xml
app/src/main/res/layout/guide_coordinatorlayout.xml
app/src/main/res/layout/import_export_coordinatorlayout.xml
app/src/main/res/layout/logcat_coordinatorlayout.xml
app/src/main/res/layout/main_framelayout.xml
app/src/main/res/layout/requests_coordinatorlayout.xml
app/src/main/res/layout/view_source_coordinatorlayout.xml
app/src/main/res/values-night-v23/styles.xml
app/src/main/res/values-night-v27/styles.xml
app/src/main/res/values-night/styles.xml
app/src/main/res/values-v23/styles.xml
app/src/main/res/values-v27/styles.xml
app/src/main/res/values/styles.xml

index c49c14caacd5981eb6edc52c9f42c4cd7c440584..cdb2c9fb105b737c6f4931df2091689a020d3948 100644 (file)
@@ -4845,6 +4845,12 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
     }
 
     private void closeCurrentTab() {
+        // Pause the current WebView.
+        currentWebView.onPause();
+
+        // Pause the current WebView JavaScript timers.
+        currentWebView.pauseTimers();
+
         // Get the current tab number.
         int currentTabNumber = tabLayout.getSelectedTabPosition();
 
index b9c6dc06a4f49c849d1f5934422c0b486b795537..c4dce55209f34f187a9ed07eee1feb5e367735ad 100644 (file)
@@ -37,7 +37,7 @@
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:background="?android:attr/colorBackground"
-            android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" >
+            android:theme="@style/PrivacyBrowserAppBar" >
 
             <androidx.appcompat.widget.Toolbar
                 android:id="@+id/about_toolbar"
index 20a88a0ea5558164c1be3e967ae0b6b8fd5d1315..555e1853fb5571caceb09c119b8244dba705c6ba 100644 (file)
@@ -36,7 +36,7 @@
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:background="?android:attr/colorBackground"
-            android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" >
+            android:theme="@style/PrivacyBrowserAppBar" >
 
             <androidx.appcompat.widget.Toolbar
                 android:id="@+id/bookmarks_toolbar"
index 49a913f365e44a1233b31562b4f501db9a14b2a6..f6474bb13d0363fe19af4757e904b093b0e6386f 100644 (file)
@@ -36,7 +36,7 @@
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:background="?android:attr/colorBackground"
-            android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" >
+            android:theme="@style/PrivacyBrowserAppBar" >
 
             <androidx.appcompat.widget.Toolbar
                 android:id="@+id/bookmarks_databaseview_toolbar"
index 3fb0072090211c3238abc39a26048974c0f04b57..60d14cb87b9f73cd7184d96948524cfc04a983d2 100644 (file)
@@ -36,7 +36,7 @@
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:background="?android:attr/colorBackground"
-            android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" >
+            android:theme="@style/PrivacyBrowserAppBar" >
 
             <androidx.appcompat.widget.Toolbar
                 android:id="@+id/domains_toolbar"
index 5140dcc025d3a735b71aa350b11a87a031b37c1d..d3ac643c0be68f2e4a102495710b75fa165fc983 100644 (file)
@@ -37,7 +37,7 @@
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:background="?android:attr/colorBackground"
-            android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" >
+            android:theme="@style/PrivacyBrowserAppBar" >
 
             <androidx.appcompat.widget.Toolbar
                 android:id="@+id/guide_toolbar"
index 5803328693752d4c4477f97a041ad6d1bf78a207..f5bcfe5818e39447b54b375aee6cecc6635793de 100644 (file)
@@ -37,7 +37,7 @@
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:background="?android:attr/colorBackground"
-            android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" >
+            android:theme="@style/PrivacyBrowserAppBar" >
 
             <androidx.appcompat.widget.Toolbar
                 android:id="@+id/import_export_toolbar"
index 12345a767535962cd68ca4660ae0e6db3b07f85b..2c605a336ab8d77d73356593900b68826db4a325 100644 (file)
@@ -36,7 +36,7 @@
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:background="?android:attr/colorBackground"
-            android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" >
+            android:theme="@style/PrivacyBrowserAppBar" >
 
             <androidx.appcompat.widget.Toolbar
                 android:id="@+id/logcat_toolbar"
index 3711e7245a7d6913d08dba60639dee543f8d9df1..f912025de1da27d4800cd99316370ffcb9bedb78 100644 (file)
@@ -53,7 +53,7 @@
                     android:id="@+id/appbar_layout"
                     android:layout_height="wrap_content"
                     android:layout_width="match_parent"
-                    android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" >
+                    android:theme="@style/PrivacyBrowserAppBar" >
 
                     <!-- The toolbar.  It is initially `visibility="gone"` so it doesn't display while the blocklists are loading. -->
                     <androidx.appcompat.widget.Toolbar
index 8df713104582ddebeff4f1125a97778d2e7ef165..7ca548f94b74356dda93602cff213b9f60f26ca8 100644 (file)
@@ -36,7 +36,7 @@
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:background="?android:attr/colorBackground"
-            android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" >
+            android:theme="@style/PrivacyBrowserAppBar" >
 
             <androidx.appcompat.widget.Toolbar
                 android:id="@+id/requests_toolbar"
index 603c1784e163da144aedd4eacd329977885eb44f..f8c1c8b6b01d53b4dd1d1ce03fca03b39d0c735e 100644 (file)
@@ -39,7 +39,7 @@
             android:layout_height="wrap_content"
             android:layout_width="match_parent"
             android:background="?android:attr/colorBackground"
-            android:theme="@style/ThemeOverlay.AppCompat.DayNight.ActionBar" >
+            android:theme="@style/PrivacyBrowserAppBar" >
 
             <!-- The frame layout allows the toolbar and the progress bar to occupy the same space. -->
             <FrameLayout
index 2d2f1ec055d3926a346559926152c8f31198339e..fbc06cc09f6d9756dd5da82812084a1c3a2a7ed3 100644 (file)
         <item name="lockBlueIcon">@drawable/lock_night</item>
     </style>
 
+    <style name="PrivacyBrowserAppBar" parent="ThemeOverlay.AppCompat.DayNight.ActionBar" >
+        <item name="android:textColorHighlight">@color/violet_700</item>
+    </style>
+
     <style name="PrivacyBrowserSettings" parent="Theme.AppCompat.DayNight" >
         <!-- Main Items. -->
         <item name="android:statusBarColor">?android:attr/colorBackground</item>
index 00b22081d1732df8caac459163c9109552b142fa..42e31ec8d5cf57d9951b813d192b13c63e3cce57 100644 (file)
         <item name="lockBlueIcon">@drawable/lock_night</item>
     </style>
 
+    <style name="PrivacyBrowserAppBar" parent="ThemeOverlay.AppCompat.DayNight.ActionBar" >
+        <item name="android:textColorHighlight">@color/violet_700</item>
+    </style>
+
     <style name="PrivacyBrowserSettings" parent="Theme.AppCompat.DayNight" >
         <!-- Main Items. -->
         <item name="android:navigationBarColor">?android:attr/colorBackground</item>
index ba21706c45ba908f778c8ea65c2ba4bd99a72c63..0dbf04fa00b8be2d4dc9197481cb466fb8ae8cf4 100644 (file)
         <item name="lockBlueIcon">@drawable/lock_night</item>
     </style>
 
+    <style name="PrivacyBrowserAppBar" parent="ThemeOverlay.AppCompat.DayNight.ActionBar" >
+        <item name="android:textColorHighlight">@color/violet_700</item>
+    </style>
+
     <style name="PrivacyBrowserSettings" parent="Theme.AppCompat.DayNight" >
         <!-- Colors. -->
         <item name="colorAccent">@color/violet_500</item>
index ff8de4435432fec19b4484313b5d434bc51a8fd7..5c22d0388a625a5d42275c18fe1a58f25333b7ab 100644 (file)
         <item name="lockBlueIcon">@drawable/lock_day</item>
     </style>
 
+    <style name="PrivacyBrowserAppBar" parent="ThemeOverlay.AppCompat.DayNight.ActionBar" >
+        <item name="android:textColorHighlight">@color/blue_200</item>
+    </style>
+
     <style name="PrivacyBrowserSettings" parent="Theme.AppCompat.DayNight" >
         <!-- Main Items. -->
         <item name="android:statusBarColor">?android:attr/colorBackground</item>
index b56b11795e1d9dce820e3760991001b86a0334bd..7fa4b5c822e4485bcfaf4b4f3aaa6531315228a9 100644 (file)
         <item name="lockBlueIcon">@drawable/lock_day</item>
     </style>
 
+    <style name="PrivacyBrowserAppBar" parent="ThemeOverlay.AppCompat.DayNight.ActionBar" >
+        <item name="android:textColorHighlight">@color/blue_200</item>
+    </style>
+
     <style name="PrivacyBrowserSettings" parent="Theme.AppCompat.DayNight" >
         <!-- Main Items. -->
         <item name="android:navigationBarColor">?android:attr/colorBackground</item>
index f57308ae5a988f4fd4bfe2abc2a2561233113406..21d99f63b0e3be6c4373aba1a23c20d4b6d3ad3b 100644 (file)
         <item name="lockBlueIcon">@drawable/lock_day</item>
     </style>
 
+    <style name="PrivacyBrowserAppBar" parent="ThemeOverlay.AppCompat.DayNight.ActionBar" >
+        <item name="android:textColorHighlight">@color/blue_200</item>
+    </style>
+
     <style name="PrivacyBrowserSettings" parent="Theme.AppCompat.DayNight" >
         <!-- Colors. -->
         <item name="colorAccent">@color/blue_700</item>