Disable webview scrollbar

This commit is contained in:
Shinokuni 2019-10-06 15:44:33 +02:00
parent 8867eefe05
commit 5813025b1b
1 changed files with 9 additions and 5 deletions

View File

@ -31,12 +31,15 @@ public class ReadropsWebView extends WebView {
@SuppressLint("SetJavaScriptEnabled") @SuppressLint("SetJavaScriptEnabled")
private void init() { private void init() {
WebSettings settings = getSettings(); if (!isInEditMode()) {
WebSettings settings = getSettings();
settings.setJavaScriptEnabled(true); settings.setJavaScriptEnabled(true);
settings.setBuiltInZoomControls(true); settings.setBuiltInZoomControls(true);
settings.setDisplayZoomControls(false); settings.setDisplayZoomControls(false);
}
setVerticalScrollBarEnabled(false);
setBackgroundColor(getResources().getColor(R.color.colorBackground)); setBackgroundColor(getResources().getColor(R.color.colorBackground));
} }
@ -46,9 +49,10 @@ public class ReadropsWebView extends WebView {
formatDocument(document); formatDocument(document);
int color = itemWithFeed.getColor() != 0 ? itemWithFeed.getColor() : getResources().getColor(R.color.colorPrimary);
return getContext().getString(R.string.webview_html_template, return getContext().getString(R.string.webview_html_template,
Utils.getCssColor(itemWithFeed.getBgColor() != 0 ? itemWithFeed.getBgColor() : Utils.getCssColor(itemWithFeed.getBgColor() != 0 ? itemWithFeed.getBgColor() :
(itemWithFeed.getColor() != 0 ? itemWithFeed.getColor() : getResources().getColor(R.color.colorPrimary))), color),
document.body().html()); document.body().html());
} else } else