// Path: app/src/main/java/com/tsy/leanote/widget/loadsir/ErrorCallback.java
// public class ErrorCallback extends Callback {
//     @Override
//     protected int onCreateView() {
//         return R.layout.layout_error;
//     }
// }
// 
// Path: app/src/main/java/com/tsy/leanote/widget/loadsir/LoadingCallback.java
// public class LoadingCallback extends Callback {
// 
//     @Override
//     protected int onCreateView() {
//         return R.layout.layout_loading;
//     }
// 
//     @Override
//     public boolean getSuccessVisible() {
//         return super.getSuccessVisible();
//     }
// 
//     @Override
//     protected boolean onReloadEvent(Context context, View view) {
//         return true;
//     }
// }


import android.graphics.Bitmap;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.kingja.loadsir.core.LoadService;
import com.tsy.leanote.widget.loadsir.ErrorCallback;
import com.tsy.leanote.widget.loadsir.LoadingCallback;
package com.tsy.leanote.widget.webview;



/**
 * custom webviewcilent
 * Created by tsy on 16/8/3.
 */
public class MyWebViewClient extends WebViewClient {

    private LoadService mLoadService;

    public MyWebViewClient(LoadService loadService) {
        mLoadService = loadService;
    }

    @Override
    public void onPageFinished(WebView view, String url) {
        super.onPageFinished(view, url);
        view.getSettings().setBlockNetworkImage(false);
        if(mLoadService.getCurrentCallback().equals(LoadingCallback.class)) {
            mLoadService.showSuccess();
        }
    }

    @Override
    public void onPageStarted(WebView view, String url, Bitmap favicon) {
        super.onPageStarted(view, url, favicon);
        view.getSettings().setBlockNetworkImage(true);
// Path: app/src/main/java/com/tsy/leanote/widget/loadsir/ErrorCallback.java
// public class ErrorCallback extends Callback {
//     @Override
//     protected int onCreateView() {
//         return R.layout.layout_error;
//     }
// }
// 
// Path: app/src/main/java/com/tsy/leanote/widget/loadsir/LoadingCallback.java
// public class LoadingCallback extends Callback {
// 
//     @Override
//     protected int onCreateView() {
//         return R.layout.layout_loading;
//     }
// 
//     @Override
//     public boolean getSuccessVisible() {
//         return super.getSuccessVisible();
//     }
// 
//     @Override
//     protected boolean onReloadEvent(Context context, View view) {
//         return true;
//     }
// }


// Path: app/src/main/java/com/tsy/leanote/widget/webview/MyWebViewClient.java
import android.graphics.Bitmap;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.kingja.loadsir.core.LoadService;
import com.tsy.leanote.widget.loadsir.ErrorCallback;
import com.tsy.leanote.widget.loadsir.LoadingCallback;

package com.tsy.leanote.widget.webview;



/**
 * custom webviewcilent
 * Created by tsy on 16/8/3.
 */
public class MyWebViewClient extends WebViewClient {

    private LoadService mLoadService;

    public MyWebViewClient(LoadService loadService) {
        mLoadService = loadService;
    }

    @Override
    public void onPageFinished(WebView view, String url) {
        super.onPageFinished(view, url);
        view.getSettings().setBlockNetworkImage(false);
        if(mLoadService.getCurrentCallback().equals(LoadingCallback.class)) {
            mLoadService.showSuccess();
        }
    }

    @Override
    public void onPageStarted(WebView view, String url, Bitmap favicon) {
        super.onPageStarted(view, url, favicon);
        view.getSettings().setBlockNetworkImage(true);
        mLoadService.showCallback(LoadingCallback.class);