Search in sources :

Example 1 with LoggingWebChromeClient

use of com.ferg.awfulapp.webview.LoggingWebChromeClient in project Awful.apk by Awful.

the class ThreadDisplayFragment method initThreadViewProperties.

private void initThreadViewProperties() {
    if (mThreadView == null) {
        Timber.w("initThreadViewProperties called for null WebView");
        return;
    }
    mThreadView.setWebViewClient(threadWebViewClient);
    mThreadView.setWebChromeClient(new LoggingWebChromeClient() {

        @Override
        public void onProgressChanged(WebView view, int newProgress) {
            super.onProgressChanged(view, newProgress);
            // second half of progress bar
            setProgress(newProgress / 2 + 50);
        }
    });
    mThreadView.setJavascriptHandler(clickInterface);
    refreshSessionCookie();
    mThreadView.setContent(getBlankPage());
    mThreadView.setDownloadListener(new DownloadListener() {

        @Override
        public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) {
            enqueueDownload(Uri.parse(url));
        }
    });
}
Also used : DownloadListener(android.webkit.DownloadListener) LoggingWebChromeClient(com.ferg.awfulapp.webview.LoggingWebChromeClient) WebView(android.webkit.WebView) AwfulWebView(com.ferg.awfulapp.webview.AwfulWebView)

Aggregations

DownloadListener (android.webkit.DownloadListener)1 WebView (android.webkit.WebView)1 AwfulWebView (com.ferg.awfulapp.webview.AwfulWebView)1 LoggingWebChromeClient (com.ferg.awfulapp.webview.LoggingWebChromeClient)1