| | |
| | | import android.content.SharedPreferences; |
| | | import android.content.pm.ActivityInfo; |
| | | import android.net.http.SslError; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | import android.support.annotation.NonNull; |
| | | import android.support.annotation.Nullable; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) { |
| | | return super.shouldOverrideUrlLoading(webView, webResourceRequest); |
| | | } |
| | | |
| | | @Override |
| | | public void onPageFinished(WebView webView, String s) { |
| | | super.onPageFinished(webView, s); |
| | | if (showAd) |
| | |
| | | |
| | | @Override |
| | | public void onReceivedSslError(WebView webView, SslErrorHandler sslErrorHandler, SslError sslError) { |
| | | sslErrorHandler.proceed(); |
| | | } |
| | | }); |
| | | |
| | |
| | | View myVideoView; |
| | | View myNormalView; |
| | | CustomViewCallback callback; |
| | | |
| | | @Override |
| | | public void onReceivedTitle(WebView view, String title) { |
| | | } |
| | | |
| | | @Override |
| | | public void onProgressChanged(WebView webView, int i) { |
| | | super.onProgressChanged(webView, i); |
| | | } |
| | | |
| | | @Override |
| | | public boolean onConsoleMessage(ConsoleMessage consoleMessage) { |
| | |
| | | WebSettings webSetting = webview.getSettings(); |
| | | webSetting.setJavaScriptEnabled(true); |
| | | webSetting.setTextZoom(100); |
| | | webSetting.setBlockNetworkImage(false); |
| | | if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP) { |
| | | webSetting.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); |
| | | } |
| | | webview.addJavascriptInterface(new PPJavaInterface(BeibeiVideoApplication.application, new PPJavaInterface.IEventListener() { |
| | | @Override |
| | | public void onLogin() { |
| | |
| | | getActivity().runOnUiThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | |
| | | } |
| | | }); |
| | | |
| | |
| | | @Override |
| | | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | | return super.onCreateView(inflater, container, savedInstanceState); |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | } |
| | | break; |
| | | case R.id.iv_add_to_favourite: |
| | | collect(collected); |
| | | break; |