klinker41 / android-slidingactivity

Android library which allows you to swipe down from an activity to close it.
Other
1.28k stars 182 forks source link

WebView inside FabActivity #18

Open zeetherocker opened 8 years ago

zeetherocker commented 8 years ago

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 commented 8 years ago

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