use of org.kiwix.kiwixmobile.views.web.ToolbarScrollingKiwixWebView in project kiwix-android by kiwix.
the class KiwixMobileActivity method selectTab.
private void selectTab(int position) {
currentWebViewIndex = position;
tabDrawerAdapter.setSelected(position);
contentFrame.removeAllViews();
KiwixWebView webView = mWebViews.get(position);
contentFrame.addView(webView);
tabDrawerAdapter.setSelected(currentWebViewIndex);
if (drawerLayout.isDrawerOpen(GravityCompat.START)) {
new Handler().postDelayed(() -> drawerLayout.closeDrawers(), 150);
}
loadPrefs();
if (menu != null) {
refreshBookmarkSymbol(menu);
}
updateTableOfContents();
if (!isHideToolbar) {
((ToolbarScrollingKiwixWebView) webView).ensureToolbarDisplayed();
}
}
use of org.kiwix.kiwixmobile.views.web.ToolbarScrollingKiwixWebView in project kiwix-android by kiwix.
the class KiwixMobileActivity method getWebView.
private KiwixWebView getWebView(String url) {
AttributeSet attrs = StyleUtils.getAttributes(this, R.xml.webview);
KiwixWebView webView;
if (!isHideToolbar) {
webView = new ToolbarScrollingKiwixWebView(KiwixMobileActivity.this, this, toolbarContainer, pageBottomTabLayout, attrs);
((ToolbarScrollingKiwixWebView) webView).setOnToolbarVisibilityChangeListener(new ToolbarScrollingKiwixWebView.OnToolbarVisibilityChangeListener() {
@Override
public void onToolbarDisplayed() {
shrinkDrawers();
}
@Override
public void onToolbarHidden() {
expandDrawers();
}
});
} else {
webView = new ToolbarStaticKiwixWebView(KiwixMobileActivity.this, this, toolbarContainer, attrs);
}
webView.loadUrl(url);
webView.loadPrefs();
return webView;
}
Aggregations