Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebView inside FabActivity #18

Open
zeetherocker opened this issue Jan 17, 2016 · 1 comment
Open

WebView inside FabActivity #18

zeetherocker opened this issue Jan 17, 2016 · 1 comment

Comments

@zeetherocker
Copy link

I've a webview inside the sliding activity, Initially I had height problems, since the height isn't fixed as I've set the height and width of webview to fill_parent in xml
I used the code below to solve this,

private void setupWebView() {
    webView = (WebView) findViewById(R.id.webview);
    webView.loadUrl(mAsset);
    webView.setWebViewClient(new WebViewClient() {
        @Override
        public void onPageFinished(WebView view, String url) {
            final int height = webView.getMeasuredHeight();
            webView.setMinimumHeight(height);
            super.onPageFinished(view, url);
        }
    });
}

Note: I'm using offline html files for the webview

This solution works perfectly. but sometimes when the activity is called, the webview isn't scrollable this happens only sometimes and I wanna avoid it, Please help me with this

PS: I have ads in the page too, it mostly happens when the ads are being loaded at activity call
When no ads are downloaded everything runs smooth

@jiangecho
Copy link

I think you can just comment the onInterceptTouchEvent in class MultiShrinkScroller to do some test, maybe it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants