// Path: app/src/main/java/com/tsy/leanote/widget/webview/WebviewActivity.java
// public class WebviewActivity extends BaseActivity {
// 
//     @BindView(R.id.toolbar)
//     Toolbar mToolbar;
// 
//     private final static String EXTRA_URL_KEY = "url";
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         String url = getIntent().getStringExtra(EXTRA_URL_KEY);
//         if(StringUtils.isEmpty(url)) {
//             throw new IllegalArgumentException("empty url");
//         }
// 
//         setContentView(R.layout.activity_webview);
//         ButterKnife.bind(this);
// 
//         mToolbar.setTitle("");
//         setSupportActionBar(mToolbar);
//         ActionBar actionBar = getSupportActionBar();
//         if (actionBar != null) {
//             getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//         }
// 
//         FragmentManager fragmentManager = getSupportFragmentManager();
//         FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
// 
//         WebviewFragment webviewFragment = new WebviewFragment();
//         webviewFragment.setArguments(WebviewFragment.createArguments(url));
//         fragmentTransaction.add(R.id.fl_content, webviewFragment, "webview");
//         fragmentTransaction.commit();
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         switch (item.getItemId()) {
//             case android.R.id.home:
//                 onExit();
//                 break;
//             default:
//                 break;
//         }
// 
//         return true;
//     }
// 
//     @Override
//     public void onBackPressed() {
//         onExit();
//     }
// 
//     private void onExit() {
//         finish();
//     }
// 
//     public static Intent createIntent(Context context, String url) {
//         Intent intent = new Intent(context, WebviewActivity.class);
//         intent.putExtra(EXTRA_URL_KEY, url);
//         return intent;
//     }
// }


import com.tsy.leanote.widget.webview.WebviewActivity;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.net.Uri;
import android.os.Build.VERSION;
import android.support.v4.widget.NestedScrollView;
import android.util.AttributeSet;
import android.util.Log;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import android.webkit.WebViewClient;

        private JavaScriptInterface(MarkdownPreviewView markdownPreviewView) {
            this.a = markdownPreviewView;
        }

        @JavascriptInterface
        public void none() {

        }
    }


    final class MdWebViewClient extends WebViewClient {
        final MarkdownPreviewView mMarkdownPreviewView;

        private MdWebViewClient(MarkdownPreviewView markdownPreviewView) {
            this.mMarkdownPreviewView = markdownPreviewView;
        }

        public final void onPageFinished(WebView webView, String str) {
            if (this.mMarkdownPreviewView.mLoadingFinishListener != null) {
                this.mMarkdownPreviewView.mLoadingFinishListener.onLoadingFinish();
            }
        }

        public final void onReceivedError(WebView webView, int i, String str, String str2) {
            new StringBuilder("onReceivedError :errorCode:").append(i).append("description:").append(str).append("failingUrl").append(str2);
        }

        public final boolean shouldOverrideUrlLoading(WebView webView, String url) {
// Path: app/src/main/java/com/tsy/leanote/widget/webview/WebviewActivity.java
// public class WebviewActivity extends BaseActivity {
// 
//     @BindView(R.id.toolbar)
//     Toolbar mToolbar;
// 
//     private final static String EXTRA_URL_KEY = "url";
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         String url = getIntent().getStringExtra(EXTRA_URL_KEY);
//         if(StringUtils.isEmpty(url)) {
//             throw new IllegalArgumentException("empty url");
//         }
// 
//         setContentView(R.layout.activity_webview);
//         ButterKnife.bind(this);
// 
//         mToolbar.setTitle("");
//         setSupportActionBar(mToolbar);
//         ActionBar actionBar = getSupportActionBar();
//         if (actionBar != null) {
//             getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//         }
// 
//         FragmentManager fragmentManager = getSupportFragmentManager();
//         FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
// 
//         WebviewFragment webviewFragment = new WebviewFragment();
//         webviewFragment.setArguments(WebviewFragment.createArguments(url));
//         fragmentTransaction.add(R.id.fl_content, webviewFragment, "webview");
//         fragmentTransaction.commit();
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         switch (item.getItemId()) {
//             case android.R.id.home:
//                 onExit();
//                 break;
//             default:
//                 break;
//         }
// 
//         return true;
//     }
// 
//     @Override
//     public void onBackPressed() {
//         onExit();
//     }
// 
//     private void onExit() {
//         finish();
//     }
// 
//     public static Intent createIntent(Context context, String url) {
//         Intent intent = new Intent(context, WebviewActivity.class);
//         intent.putExtra(EXTRA_URL_KEY, url);
//         return intent;
//     }
// }


// Path: app/src/main/java/com/tsy/leanote/widget/MarkdownPreviewView.java
import com.tsy.leanote.widget.webview.WebviewActivity;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.net.Uri;
import android.os.Build.VERSION;
import android.support.v4.widget.NestedScrollView;
import android.util.AttributeSet;
import android.util.Log;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import android.webkit.WebViewClient;


        private JavaScriptInterface(MarkdownPreviewView markdownPreviewView) {
            this.a = markdownPreviewView;
        }

        @JavascriptInterface
        public void none() {

        }
    }


    final class MdWebViewClient extends WebViewClient {
        final MarkdownPreviewView mMarkdownPreviewView;

        private MdWebViewClient(MarkdownPreviewView markdownPreviewView) {
            this.mMarkdownPreviewView = markdownPreviewView;
        }

        public final void onPageFinished(WebView webView, String str) {
            if (this.mMarkdownPreviewView.mLoadingFinishListener != null) {
                this.mMarkdownPreviewView.mLoadingFinishListener.onLoadingFinish();
            }
        }

        public final void onReceivedError(WebView webView, int i, String str, String str2) {
            new StringBuilder("onReceivedError :errorCode:").append(i).append("description:").append(str).append("failingUrl").append(str2);
        }

        public final boolean shouldOverrideUrlLoading(WebView webView, String url) {
            mContext.startActivity(WebviewActivity.createIntent(mMarkdownPreviewView.getContext(), url));