From 06aad709ccfb3680f03a4e63c8cdfbfcdb6dfd91 Mon Sep 17 00:00:00 2001 From: Nick Bradbury Date: Fri, 22 Nov 2024 14:47:43 -0500 Subject: [PATCH] Use setAlgorithmicDarkeningAllowed --- .../blazepromote/BlazePromoteWebViewFragment.kt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/blaze/blazepromote/BlazePromoteWebViewFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/blaze/blazepromote/BlazePromoteWebViewFragment.kt index d9774d9eb9d6..57dff8fe5859 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/blaze/blazepromote/BlazePromoteWebViewFragment.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/blaze/blazepromote/BlazePromoteWebViewFragment.kt @@ -2,6 +2,7 @@ package org.wordpress.android.ui.blaze.blazepromote import android.annotation.SuppressLint import android.content.Intent +import android.os.Build import android.os.Bundle import android.view.LayoutInflater import android.view.View @@ -218,9 +219,16 @@ class BlazePromoteWebViewFragment : Fragment(), OnBlazeWebViewClientListener, ViewGroup.LayoutParams.MATCH_PARENT ) scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY - settings.userAgentString = model.userAgent - settings.javaScriptEnabled = model.enableJavascript - settings.domStorageEnabled = model.enableDomStorage + + with(settings) { + userAgentString = model.userAgent + javaScriptEnabled = model.enableJavascript + domStorageEnabled = model.enableDomStorage + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + setAlgorithmicDarkeningAllowed(true) + } + } + webViewClient = BlazeWebViewClient(this@BlazePromoteWebViewFragment) chromeClient = WPWebChromeClientWithFileChooser( activity,