|
@@ -93,7 +93,7 @@ public class ActWebX5 extends BaseActWeb {
|
|
|
if (!TextUtils.isEmpty(url)) {
|
|
if (!TextUtils.isEmpty(url)) {
|
|
|
url = url.trim();
|
|
url = url.trim();
|
|
|
}
|
|
}
|
|
|
- if(webParams.isShowTitle()) {
|
|
|
|
|
|
|
+ if (webParams.isShowTitle()) {
|
|
|
TitleBarUtils
|
|
TitleBarUtils
|
|
|
.getInstance()
|
|
.getInstance()
|
|
|
.setShowOrHide(this, true)
|
|
.setShowOrHide(this, true)
|
|
@@ -113,7 +113,6 @@ public class ActWebX5 extends BaseActWeb {
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
|
// webViewSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
|
// webViewSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
|
|
}
|
|
}
|
|
|
- mWebView.clearCache(true);
|
|
|
|
|
if (TextUtils.isEmpty(jsUrl)) {
|
|
if (TextUtils.isEmpty(jsUrl)) {
|
|
|
loadUrl(url);
|
|
loadUrl(url);
|
|
|
} else {
|
|
} else {
|
|
@@ -173,7 +172,7 @@ public class ActWebX5 extends BaseActWeb {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
protected void onDestroy() {
|
|
protected void onDestroy() {
|
|
|
- if(act_web_loading_iv != null){
|
|
|
|
|
|
|
+ if (act_web_loading_iv != null) {
|
|
|
try {
|
|
try {
|
|
|
act_web_loading_iv.clearAnimation();
|
|
act_web_loading_iv.clearAnimation();
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -295,23 +294,26 @@ public class ActWebX5 extends BaseActWeb {
|
|
|
act_web_loading_iv.startAnimation(animation);
|
|
act_web_loading_iv.startAnimation(animation);
|
|
|
}
|
|
}
|
|
|
ViewUtil.setVisibility(act_web_loading_pb, newProgress != 100);
|
|
ViewUtil.setVisibility(act_web_loading_pb, newProgress != 100);
|
|
|
- if(act_web_loading_pb != null)
|
|
|
|
|
|
|
+ if (act_web_loading_pb != null)
|
|
|
act_web_loading_pb.setProgress(newProgress);
|
|
act_web_loading_pb.setProgress(newProgress);
|
|
|
super.onProgressChanged(view, newProgress);
|
|
super.onProgressChanged(view, newProgress);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
mWebView.setWebViewClient(new WebViewClient() {
|
|
mWebView.setWebViewClient(new WebViewClient() {
|
|
|
-// @Override
|
|
|
|
|
-// public WebResourceResponse shouldInterceptRequest(WebView webView, String s) {
|
|
|
|
|
-// LogUtil.println("ActWeb", "shouldInterceptRequest from cache", url);
|
|
|
|
|
-// return WebResourceResponseAdapter.adapter(WebViewCacheInterceptorInst.getInstance().interceptRequest(s));
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// @Override
|
|
|
|
|
-// public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) {
|
|
|
|
|
-// LogUtil.println("ActWeb", "shouldInterceptRequest from cache", url);
|
|
|
|
|
-// return WebResourceResponseAdapter.adapter(WebViewCacheInterceptorInst.getInstance().interceptRequest(WebResourceRequestAdapter.adapter(webResourceRequest)));
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public WebResourceResponse shouldInterceptRequest(WebView webView, String s) {
|
|
|
|
|
+ if (s.contains("ssnocache=1")) return null;
|
|
|
|
|
+ LogUtil.println("ActWeb", "shouldInterceptRequest from cache", url);
|
|
|
|
|
+ return WebResourceResponseAdapter.adapter(WebViewCacheInterceptorInst.getInstance().interceptRequest(s));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) {
|
|
|
|
|
+ if (url.contains("ssnocache=1")) return null;
|
|
|
|
|
+ LogUtil.println("ActWeb", "shouldInterceptRequest from cache", url);
|
|
|
|
|
+ return WebResourceResponseAdapter.adapter(WebViewCacheInterceptorInst.getInstance().interceptRequest(WebResourceRequestAdapter.adapter(webResourceRequest)));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
|
LogUtil.println("ActWeb", "shouldOverrideUrlLoading", url);
|
|
LogUtil.println("ActWeb", "shouldOverrideUrlLoading", url);
|
|
@@ -382,12 +384,12 @@ public class ActWebX5 extends BaseActWeb {
|
|
|
if (webParams.isNeedJsInteract()) {
|
|
if (webParams.isNeedJsInteract()) {
|
|
|
mWebView.addJavascriptInterface(new KFZSJs(this), "kfzsjs");
|
|
mWebView.addJavascriptInterface(new KFZSJs(this), "kfzsjs");
|
|
|
String loadUrl = url;
|
|
String loadUrl = url;
|
|
|
- if(webParams.getTokenKey() != null){
|
|
|
|
|
- if(url.startsWith(Config.YF_SHOP_HOME)){
|
|
|
|
|
|
|
+ if (webParams.getTokenKey() != null) {
|
|
|
|
|
+ if (url.startsWith(Config.YF_SHOP_HOME)) {
|
|
|
webParams.tokenFirstUpperCase();
|
|
webParams.tokenFirstUpperCase();
|
|
|
}
|
|
}
|
|
|
loadUrl = addUrlQuery(url, webParams.getTokenKey(), SpUtils.getToken(SheepApp.getInstance()));
|
|
loadUrl = addUrlQuery(url, webParams.getTokenKey(), SpUtils.getToken(SheepApp.getInstance()));
|
|
|
- if(url.startsWith(Config.YF_SHOP_HOME)){
|
|
|
|
|
|
|
+ if (url.startsWith(Config.YF_SHOP_HOME)) {
|
|
|
loadUrl = addUrlQuery(loadUrl, "pf", Config.YF_SHOP_PLATFORM);
|
|
loadUrl = addUrlQuery(loadUrl, "pf", Config.YF_SHOP_PLATFORM);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -517,7 +519,7 @@ public class ActWebX5 extends BaseActWeb {
|
|
|
@Override
|
|
@Override
|
|
|
public void showTitleBar(boolean isShow) {
|
|
public void showTitleBar(boolean isShow) {
|
|
|
ActionBar actionBar = getSupportActionBar();
|
|
ActionBar actionBar = getSupportActionBar();
|
|
|
- if(actionBar != null)
|
|
|
|
|
|
|
+ if (actionBar != null)
|
|
|
actionBar.hide();
|
|
actionBar.hide();
|
|
|
}
|
|
}
|
|
|
|
|
|