From: Soren Stoutner Date: Fri, 9 Oct 2020 23:42:42 +0000 (-0700) Subject: Fix problems with audio still playing after a tab is closed. https://redmine.stoutne... X-Git-Tag: v3.6~14 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=771125363f79df7b3a6b85321a08c7c201b54661;p=PrivacyBrowserAndroid.git Fix problems with audio still playing after a tab is closed. https://redmine.stoutner.com/issues/595 --- 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 + + + + + + + + + + + +