diff options
author | Allan Wang <me@allanwang.ca> | 2021-01-12 20:46:02 -0800 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2021-01-12 20:46:02 -0800 |
commit | 0e5c1ab2dd2b574970883576e18f9a119b058788 (patch) | |
tree | ba715d7a5e0537b9598722e203956fb56d3d5c53 /app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt | |
parent | 82fa4c5d6c75e245e74d903328b3e5d96b01b5ca (diff) | |
download | frost-0e5c1ab2dd2b574970883576e18f9a119b058788.tar.gz frost-0e5c1ab2dd2b574970883576e18f9a119b058788.tar.bz2 frost-0e5c1ab2dd2b574970883576e18f9a119b058788.zip |
Create themeprovider
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt index c68d3f57..a454584e 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt @@ -24,9 +24,11 @@ import android.util.AttributeSet import android.view.View import android.webkit.WebView import ca.allanwang.kau.utils.withAlpha +import com.pitchedapps.frost.enums.ThemeCategory import com.pitchedapps.frost.facebook.USER_AGENT -import com.pitchedapps.frost.injectors.CssHider import com.pitchedapps.frost.injectors.CssAsset +import com.pitchedapps.frost.injectors.CssHider +import com.pitchedapps.frost.injectors.ThemeProvider import com.pitchedapps.frost.injectors.jsInject import com.pitchedapps.frost.prefs.Prefs import com.pitchedapps.frost.utils.L @@ -50,6 +52,7 @@ class DebugWebView @JvmOverloads constructor( ) : WebView(context, attrs, defStyleAttr), KoinComponent { private val prefs: Prefs by inject() + private val themeProvider: ThemeProvider by inject() var onPageFinished: (String?) -> Unit = {} init { @@ -112,7 +115,7 @@ class DebugWebView @JvmOverloads constructor( CssHider.STORIES.maybe(!prefs.showStories), CssHider.PEOPLE_YOU_MAY_KNOW.maybe(!prefs.showSuggestedFriends), CssHider.SUGGESTED_GROUPS.maybe(!prefs.showSuggestedGroups), - prefs.themeInjector, + themeProvider.injector(ThemeCategory.FACEBOOK), CssHider.NON_RECENT.maybe( (url?.contains("?sk=h_chr") ?: false) && prefs.aggressiveRecents |