X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyCell.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacycell%2Fdialogs%2FWebViewDialog.kt;fp=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacycell%2Fdialogs%2FWebViewDialog.kt;h=aa7d296a141def98def55dd87cfd32b767038b85;hp=0a40933c95174739c3bc5e95d139c4b7851c8032;hb=4dae85f915eb4b32fec0988202e5d6e353de3d85;hpb=81346128a1dcde5b65d83f24c1af507cd80802d3 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 +}