prevent webview flashing white on dark theme

This commit is contained in:
Andrew Dolgov 2016-04-14 10:16:59 +03:00
parent bca92c0d8e
commit 2e27a463d8
3 changed files with 11 additions and 1 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss"
android:versionCode="406"
android:versionCode="407"
android:versionName="1.174" >
<uses-sdk

View File

@ -3,6 +3,7 @@ package org.fox.ttrss;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
@ -447,6 +448,10 @@ public class ArticleFragment extends Fragment {
ws.setMediaPlaybackRequiresUserGesture(false);
}
if (CommonActivity.THEME_DARK.equals(m_prefs.getString("theme", CommonActivity.THEME_DEFAULT))) {
m_web.setBackgroundColor(Color.BLACK);
}
if (m_prefs.getBoolean("justify_article_text", true)) {
cssOverride += "body { text-align : justify; } ";
}

View File

@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
@ -29,6 +30,7 @@ import android.widget.TextView;
import com.shamanland.fab.ShowHideOnScroll;
import org.fox.ttrss.CommonActivity;
import org.fox.ttrss.R;
import org.fox.ttrss.util.ImageCacheService;
import org.fox.ttrss.util.NotifyingScrollView;
@ -238,6 +240,9 @@ public class OfflineArticleFragment extends Fragment {
final WebView web = (WebView)view.findViewById(R.id.article_content);
if (web != null) {
if (CommonActivity.THEME_DARK.equals(m_prefs.getString("theme", CommonActivity.THEME_DEFAULT))) {
web.setBackgroundColor(Color.BLACK);
}
web.setWebViewClient(new WebViewClient() {
@Override