Skip to content

Commit

Permalink
Merge pull request #21488 from wordpress-mobile/issue/21487-blaze-dar…
Browse files Browse the repository at this point in the history
…k-mode

Support dark mode in Blaze WebViews
  • Loading branch information
nbradbury authored Nov 25, 2024
2 parents 61d36ee + 06aad70 commit a8ce4ba
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a8ce4ba

Please sign in to comment.