mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2026-01-25 14:47:05 +00:00
stopping toolbar from scrolling while scrolling code.
This commit is contained in:
parent
6afca0235f
commit
faab22bc92
@ -48,7 +48,7 @@ class WikiActivity : BaseActivity<WikiMvp.View, WikiPresenter>(), WikiMvp.View {
|
||||
loadMenu()
|
||||
}
|
||||
if (wiki.content != null) {
|
||||
webView.setGithubContent(wiki.content, null)
|
||||
webView.setGithubContent(wiki.content, null, true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -161,7 +161,11 @@ public class PrettifyWebView extends NestedWebView {
|
||||
}
|
||||
|
||||
public void setGithubContent(@NonNull String source, @Nullable String baseUrl) {
|
||||
addJavascriptInterface(new MarkDownInterceptorInterface(this), "Android");
|
||||
setGithubContent(source, baseUrl, false);
|
||||
}
|
||||
|
||||
public void setGithubContent(@NonNull String source, @Nullable String baseUrl, boolean toggleNestScrolling) {
|
||||
addJavascriptInterface(new MarkDownInterceptorInterface(this, toggleNestScrolling), "Android");
|
||||
String page = GithubHelper.generateContent(getContext(), source, baseUrl, AppHelper.isNightMode(getResources()));
|
||||
post(() -> loadDataWithBaseURL("file:///android_asset/md/", page, "text/html", "utf-8", null));
|
||||
}
|
||||
|
||||
@ -10,22 +10,28 @@ import com.prettifier.pretty.PrettifyWebView;
|
||||
|
||||
public class MarkDownInterceptorInterface {
|
||||
private PrettifyWebView prettifyWebView;
|
||||
private boolean toggleNestScrolling;
|
||||
|
||||
public MarkDownInterceptorInterface(PrettifyWebView prettifyWebView) {
|
||||
this(prettifyWebView, false);
|
||||
}
|
||||
|
||||
public MarkDownInterceptorInterface(PrettifyWebView prettifyWebView, boolean toggleNestScrolling) {
|
||||
this.prettifyWebView = prettifyWebView;
|
||||
this.toggleNestScrolling = toggleNestScrolling;
|
||||
}
|
||||
|
||||
@JavascriptInterface public void startIntercept() {
|
||||
if (prettifyWebView != null) {
|
||||
prettifyWebView.setInterceptTouch(true);
|
||||
// prettifyWebView.setEnableNestedScrolling(false);
|
||||
if (toggleNestScrolling) prettifyWebView.setEnableNestedScrolling(false);
|
||||
}
|
||||
}
|
||||
|
||||
@JavascriptInterface public void stopIntercept() {
|
||||
if (prettifyWebView != null) {
|
||||
prettifyWebView.setInterceptTouch(false);
|
||||
// prettifyWebView.setEnableNestedScrolling(true);
|
||||
if (toggleNestScrolling) prettifyWebView.setEnableNestedScrolling(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user