From 771125363f79df7b3a6b85321a08c7c201b54661 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Fri, 9 Oct 2020 16:42:42 -0700 Subject: [PATCH] Fix problems with audio still playing after a tab is closed. https://redmine.stoutner.com/issues/595 --- .../privacybrowser/activities/MainWebViewActivity.java | 6 ++++++ app/src/main/res/layout/about_coordinatorlayout.xml | 2 +- app/src/main/res/layout/bookmarks_coordinatorlayout.xml | 2 +- .../res/layout/bookmarks_databaseview_coordinatorlayout.xml | 2 +- app/src/main/res/layout/domains_coordinatorlayout.xml | 2 +- app/src/main/res/layout/guide_coordinatorlayout.xml | 2 +- app/src/main/res/layout/import_export_coordinatorlayout.xml | 2 +- app/src/main/res/layout/logcat_coordinatorlayout.xml | 2 +- app/src/main/res/layout/main_framelayout.xml | 2 +- app/src/main/res/layout/requests_coordinatorlayout.xml | 2 +- app/src/main/res/layout/view_source_coordinatorlayout.xml | 2 +- app/src/main/res/values-night-v23/styles.xml | 4 ++++ app/src/main/res/values-night-v27/styles.xml | 4 ++++ app/src/main/res/values-night/styles.xml | 4 ++++ app/src/main/res/values-v23/styles.xml | 4 ++++ app/src/main/res/values-v27/styles.xml | 4 ++++ app/src/main/res/values/styles.xml | 4 ++++ 17 files changed, 40 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index c49c14ca..cdb2c9fb 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -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(); diff --git a/app/src/main/res/layout/about_coordinatorlayout.xml b/app/src/main/res/layout/about_coordinatorlayout.xml index b9c6dc06..c4dce552 100644 --- a/app/src/main/res/layout/about_coordinatorlayout.xml +++ b/app/src/main/res/layout/about_coordinatorlayout.xml @@ -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" > + android:theme="@style/PrivacyBrowserAppBar" > + android:theme="@style/PrivacyBrowserAppBar" > + android:theme="@style/PrivacyBrowserAppBar" > + android:theme="@style/PrivacyBrowserAppBar" > + android:theme="@style/PrivacyBrowserAppBar" > + android:theme="@style/PrivacyBrowserAppBar" > + android:theme="@style/PrivacyBrowserAppBar" > + android:theme="@style/PrivacyBrowserAppBar" > + android:theme="@style/PrivacyBrowserAppBar" > @drawable/lock_night + + + + + + + + + + + +