From 5813025b1bfe8d7f02529f80861b762bb17d1bdb Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Sun, 6 Oct 2019 15:44:33 +0200 Subject: [PATCH] Disable webview scrollbar --- .../com/readrops/app/utils/ReadropsWebView.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/readrops/app/utils/ReadropsWebView.java b/app/src/main/java/com/readrops/app/utils/ReadropsWebView.java index 85f58e3c..9506900f 100644 --- a/app/src/main/java/com/readrops/app/utils/ReadropsWebView.java +++ b/app/src/main/java/com/readrops/app/utils/ReadropsWebView.java @@ -31,12 +31,15 @@ public class ReadropsWebView extends WebView { @SuppressLint("SetJavaScriptEnabled") private void init() { - WebSettings settings = getSettings(); + if (!isInEditMode()) { + WebSettings settings = getSettings(); - settings.setJavaScriptEnabled(true); - settings.setBuiltInZoomControls(true); - settings.setDisplayZoomControls(false); + settings.setJavaScriptEnabled(true); + settings.setBuiltInZoomControls(true); + settings.setDisplayZoomControls(false); + } + setVerticalScrollBarEnabled(false); setBackgroundColor(getResources().getColor(R.color.colorBackground)); } @@ -46,9 +49,10 @@ public class ReadropsWebView extends WebView { formatDocument(document); + int color = itemWithFeed.getColor() != 0 ? itemWithFeed.getColor() : getResources().getColor(R.color.colorPrimary); return getContext().getString(R.string.webview_html_template, Utils.getCssColor(itemWithFeed.getBgColor() != 0 ? itemWithFeed.getBgColor() : - (itemWithFeed.getColor() != 0 ? itemWithFeed.getColor() : getResources().getColor(R.color.colorPrimary))), + color), document.body().html()); } else