Search in sources :

Example 1 with ToolbarStaticKiwixWebView

use of org.kiwix.kiwixmobile.views.web.ToolbarStaticKiwixWebView 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;
}
Also used : ToolbarScrollingKiwixWebView(org.kiwix.kiwixmobile.views.web.ToolbarScrollingKiwixWebView) KiwixWebView(org.kiwix.kiwixmobile.views.web.KiwixWebView) ToolbarStaticKiwixWebView(org.kiwix.kiwixmobile.views.web.ToolbarStaticKiwixWebView) ToolbarStaticKiwixWebView(org.kiwix.kiwixmobile.views.web.ToolbarStaticKiwixWebView) AttributeSet(android.util.AttributeSet) ToolbarScrollingKiwixWebView(org.kiwix.kiwixmobile.views.web.ToolbarScrollingKiwixWebView)

Aggregations

AttributeSet (android.util.AttributeSet)1 KiwixWebView (org.kiwix.kiwixmobile.views.web.KiwixWebView)1 ToolbarScrollingKiwixWebView (org.kiwix.kiwixmobile.views.web.ToolbarScrollingKiwixWebView)1 ToolbarStaticKiwixWebView (org.kiwix.kiwixmobile.views.web.ToolbarStaticKiwixWebView)1