From 4dae85f915eb4b32fec0988202e5d6e353de3d85 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Wed, 30 Nov 2022 11:06:11 -0700 Subject: [PATCH] Remove deprecated `setForceDark` on WebViews. https://redmine.stoutner.com/issues/933 --- .../privacycell/dialogs/WebViewDialog.kt | 16 ++-------------- app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/stoutner/privacycell/dialogs/WebViewDialog.kt b/app/src/main/java/com/stoutner/privacycell/dialogs/WebViewDialog.kt index 0a40933..aa7d296 100644 --- a/app/src/main/java/com/stoutner/privacycell/dialogs/WebViewDialog.kt +++ b/app/src/main/java/com/stoutner/privacycell/dialogs/WebViewDialog.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2021-2022 Soren Stoutner . + * Copyright 2021-2022 Soren Stoutner . * * This file is part of Privacy Cell . * @@ -21,7 +21,6 @@ package com.stoutner.privacycell.dialogs import android.app.Dialog import android.content.Intent -import android.content.res.Configuration import android.os.Bundle import android.webkit.WebResourceRequest import android.webkit.WebResourceResponse @@ -30,9 +29,7 @@ import android.webkit.WebViewClient import androidx.appcompat.app.AlertDialog import androidx.fragment.app.DialogFragment -import androidx.webkit.WebSettingsCompat import androidx.webkit.WebViewAssetLoader -import androidx.webkit.WebViewFeature import com.stoutner.privacycell.R @@ -388,15 +385,6 @@ class WebViewDialog : DialogFragment() { // Get a handle for the WebView. webView = alertDialog.findViewById(R.id.webview)!! - // Get the current theme status. - val currentThemeStatus = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK - - // Check to see if the app is in night mode. - if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES && WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK)) { // The app is in night mode. - // Apply the dark WebView theme. - WebSettingsCompat.setForceDark(webView.settings, WebSettingsCompat.FORCE_DARK_ON) - } - // Create a WebView asset loader. val webViewAssetLoader = WebViewAssetLoader.Builder().addPathHandler("/assets/", WebViewAssetLoader.AssetsPathHandler(requireContext())).build() @@ -481,4 +469,4 @@ class WebViewDialog : DialogFragment() { // Save the scroll position. savedInstanceState.putInt(SCROLL_Y, webView.scrollY) } -} \ No newline at end of file +} diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index ed21f7e..9fb8c9a 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -132,6 +132,7 @@ Überwachung Echtzeit-Überwachung Plaziert ein Icon in der Statusleiste, das die Überwachung der Mobilfunk-Verbindung anzeigt. + Die Benachrichtigungs-Berechtigung für Privacy Cell wurde abgelehnt. Daher werden derzeit keine Benachrichtigungen angezeigt. Benachrichtigung über sicheres Netzwerk Benachrichtigung über unsicheres Netzwerk Benachrichtigung über veraltetes Netzwerk diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index c10878e..1773a36 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -133,6 +133,7 @@ Supervision Supervision en temps-réel Placez une icône dans la barre d\'état qui surveille le réseau cellulaire. + L\'autorisation d\'afficher les notifications est actuellement refusée, les notifications ne seront donc pas affichées. Notification de réseau sécurisé Notification de réseau non sécurisé Notification de réseau obsolète diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index cea32ce..dc1dc29 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -132,6 +132,7 @@ Monitoraggio Monitoraggio in tempo reale Aggiunge un\'icona nella barra di stato che monitora la rete cellulare. + L\'autorizzazione "Post Notification" non è stata al momento concessa per cui le notifiche non saranno visualizzate. Notifica di rete sicura Notifica di rete insicura Notifiche di Rete Antiquata -- 2.43.0