added background color to wiki webview

This commit is contained in:
Chumva 2018-05-04 12:31:57 +03:00
parent 2e55393c4f
commit 1609233fdd
3 changed files with 7 additions and 0 deletions

View file

@ -437,5 +437,7 @@
<color name="wikivoyage_secondary_text">#727272</color>
<color name="wikivoyage_start_editing_card_image_background">#339966</color>
<color name="wikivoyage_open_beta_card_image_background">#008bf8</color>
<color name="wikivoyage_webview_background_light">#ffffff</color>
<color name="wikivoyage_webview_background_dark">#17191a</color>
</resources>

View file

@ -106,6 +106,8 @@ public class WikipediaDialogFragment extends WikiArticleBaseDialogFragment {
webSettings.setJavaScriptEnabled(true);
contentWebView.setWebViewClient(new WikipediaWebViewClient(getActivity(), nightMode));
updateWebSettings();
contentWebView.setBackgroundColor(ContextCompat.getColor(getMyApplication(),
nightMode ? R.color.wikivoyage_webview_background_dark : R.color.wikivoyage_webview_background_light));
return mainView;
}

View file

@ -10,6 +10,7 @@ import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentManager.BackStackEntry;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
@ -159,6 +160,8 @@ public class WikivoyageArticleDialogFragment extends WikiArticleBaseDialogFragme
contentWebView.addJavascriptInterface(new WikivoyageArticleWebAppInterface(), "Android");
webViewClient = new WikivoyageWebViewClient(getActivity(), getFragmentManager(), nightMode);
contentWebView.setWebViewClient(webViewClient);
contentWebView.setBackgroundColor(ContextCompat.getColor(getMyApplication(),
nightMode ? R.color.wikivoyage_webview_background_dark : R.color.wikivoyage_webview_background_light));
return mainView;
}