| | |
| | | import android.graphics.Typeface; |
| | | import android.graphics.drawable.AnimationDrawable; |
| | | import android.graphics.drawable.GradientDrawable; |
| | | import android.os.Build; |
| | | import android.os.Bundle; |
| | | import android.os.Handler; |
| | | import android.os.Message; |
| | |
| | | import android.view.animation.Animation; |
| | | import android.view.animation.AnimationUtils; |
| | | import android.view.animation.DecelerateInterpolator; |
| | | import android.webkit.WebChromeClient; |
| | | import android.webkit.WebResourceRequest; |
| | | import android.webkit.WebSettings; |
| | | import android.webkit.WebView; |
| | | import android.webkit.WebViewClient; |
| | |
| | | import java.util.List; |
| | | import java.util.Timer; |
| | | |
| | | import androidx.annotation.RequiresApi; |
| | | import androidx.recyclerview.widget.LinearLayoutManager; |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | import androidx.viewpager.widget.PagerAdapter; |
| | |
| | | animationDrawable.start(); |
| | | webView.setWebViewClient(new MWebviewClient()); |
| | | WebSettings settings = webView.getSettings(); |
| | | settings.setUserAgentString("Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"); |
| | | settings.setJavaScriptEnabled(true); |
| | | webView.setInitialScale(100); |
| | | ll_loading.setVisibility(View.VISIBLE); |
| | |
| | | if (null != url && url.startsWith("yestv://webviewHeight#")) { |
| | | int height = Integer.parseInt(url.replace("yestv://webviewHeight#", "")); |
| | | Log.i("mResult", "webView的高度为:" + height + ""); |
| | | //TODO 测试 |
| | | webView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, height)); |
| | | return true; |
| | | } |
| | | return super.shouldOverrideUrlLoading(view, url); |
| | | } |
| | | |
| | | @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) |
| | | @Override |
| | | public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { |
| | | String url = request.getUrl().toString(); |
| | | if (null != url && url.startsWith("yestv://webviewHeight#")) { |
| | | int height = Integer.parseInt(url.replace("yestv://webviewHeight#", "")); |
| | | Log.i("mResult", "webView的高度为:" + height + ""); |
| | | webView.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, height)); |
| | | return true; |
| | | } |
| | | return super.shouldOverrideUrlLoading(view, request); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | }, 3000); |
| | | } |
| | | |
| | | } |
| | | |
| | | private void getAppPageNotification() { |