Commit 84569c33 by 徐健

Merge branch 'feature/v3' of…

Merge branch 'feature/v3' of ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component into feature/v3
parents 3a9d0b26 cb277c4f
......@@ -43,17 +43,17 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.41.1",
"m-consultant" : "0.0.51.3",
"m-fm" : "0.0.23.3",
"m-user" : "0.0.40.3",
"m-home" : "0.0.6.19",
"m-confide" : "0.0.41.2",
"m-consultant" : "0.0.51.4",
"m-fm" : "0.0.23.4",
"m-user" : "0.0.41.1",
"m-home" : "0.0.6.20",
"m-muse" : "0.0.20.3",
"m-tests" : "0.0.15.2",
"m-course" : "0.0.34.3",
"m-im" : "0.0.3.1",
"m-dynamic" : "0.0.1.1",
"m-muse" : "0.0.20.4",
"m-tests" : "0.0.15.3",
"m-course" : "0.0.34.4",
"m-im" : "0.0.3.3",
"m-dynamic" : "0.0.1.2",
//-------------- 业务模块 API 层 --------------
......@@ -71,13 +71,13 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.29.1",
"ydl-platform" : "0.0.29.3",
//第二步 若干
"ydl-webview" : "0.0.28.5",
"ydl-media" : "0.0.14.3",
"ydl-pay" : "0.0.11.4",
"m-audioim" : "0.0.40.3",
"ydl-webview" : "0.0.28.6",
"ydl-media" : "0.0.14.4",
"ydl-pay" : "0.0.11.5",
"m-audioim" : "0.0.40.4",
//以下 几乎不会动
"router" : "0.0.1",
......@@ -116,13 +116,13 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.29.1",
"ydl-platform" : "0.0.29.3",
//第二步 若干
"ydl-webview" : "0.0.28.5",
"ydl-media" : "0.0.14.3",
"ydl-pay" : "0.0.11.4",
"m-audioim" : "0.0.40.3",
"ydl-webview" : "0.0.28.6",
"ydl-media" : "0.0.14.4",
"ydl-pay" : "0.0.11.5",
"m-audioim" : "0.0.40.4",
//以下 几乎不会动
......@@ -251,7 +251,7 @@ ext {
"ydl-pushagent" : "com.ydl:ydl-pushagent:0.1.9",
"ydl-notracepoint" : "com.ydl:notracepoint-lib:0.1.8@aar",
"ydl-js" : "com.ydl:ydl-js:1.0.7-SNAPSHOT@aar",
"ydl-router" : "com.ydl:ydl-router:1.3.2-SNAPSHOT@aar",
"ydl-router" : "com.ydl:ydl-router:1.3.7-SNAPSHOT@aar",
"xrecyclerview" : "com.ydl:xrecyclerview:1.0.0-SNAPSHOT@aar",
"arouter-api" : "com.alibaba:arouter-api:1.4.1",
"arouter-compiler" : "com.alibaba:arouter-compiler:1.2.2",
......
......@@ -248,7 +248,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
*/
private void sendNetLossMessage() {
if (null != mTimeOutHandler)
mTimeOutHandler.sendEmptyMessageDelayed(TIME_OUT_TYPE, timeOutLong);
mTimeOutHandler.sendEmptyMessageDelayed(TIME_OUT_TYPE, timeOutLong);
}
/**
......@@ -304,7 +304,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
@NotNull
@Override
public StatusBarOptions getStatusViewOptions() {
return new StatusBarOptions(true,true);
return new StatusBarOptions(true, true);
}
@Override
......@@ -331,7 +331,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}
setUrlHeightParams();
EventBus.getDefault().register(this);
jtoJHandle = WebModularServiceUtils.Companion.getWebService().getJavascripHandler(this,tellData = tellData);
jtoJHandle = WebModularServiceUtils.Companion.getWebService().getJavascripHandler(this, tellData = tellData);
appFrom = BaseApp.instance.getGlobalConfig().getAppFrom();
init();
......@@ -396,11 +396,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
return pinjie(resultUrl);
}
private String pinjie(String jumpUrl){
if (jumpUrl.contains("hideNavBar=1")){
private String pinjie(String jumpUrl) {
if (jumpUrl.contains("hideNavBar=1")) {
hideJavaTitleBar();
return jumpUrl;
}else if (jumpUrl.contains("hideNavBar=2")){
} else if (jumpUrl.contains("hideNavBar=2")) {
showTitleBar();
return jumpUrl;
}
......@@ -500,7 +500,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}
}
public void showTitleBar(){
public void showTitleBar() {
tb_title.setVisibility(VISIBLE);
if (null != getStatusView()) {
......@@ -634,16 +634,18 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Boolean overridePayUrl = shouldOverridePayUrl(view, url);
if(overridePayUrl != null) {
if (overridePayUrl != null) {
return overridePayUrl;
}
if (YDLRouterManager.Companion.router(url)) {
} else {
if (!TextUtils.isEmpty(url) && url.startsWith("http")) {
loadUrl(setUrlHeightParams(url));
}
} else {
if (YDLRouterManager.Companion.router(url)) {
} else {
loadUrl(setUrlHeightParams(url));
}
}
return true;
}
......@@ -710,14 +712,20 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Boolean overridePayUrl = shouldOverridePayUrl(view, url);
if(overridePayUrl!=null) {
if (overridePayUrl != null) {
return overridePayUrl;
}
if (YDLRouterManager.Companion.router(url)) {
} else {
if (!TextUtils.isEmpty(url) && url.startsWith("http")) {
loadUrl(setUrlHeightParams(url));
} else {
if (YDLRouterManager.Companion.router(url)) {
} else {
loadUrl(setUrlHeightParams(url));
}
}
return true;
......@@ -755,7 +763,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
tb_title.setImageVis(1);
}
} else {
tb_title.setImage(getResources().getDrawable(YDLConstants.FROM_YDL.equals(appFrom)?R.drawable.platform_toolbar_back :R.drawable.platform_toolbar_back_yellow));
tb_title.setImage(getResources().getDrawable(YDLConstants.FROM_YDL.equals(appFrom) ? R.drawable.platform_toolbar_back : R.drawable.platform_toolbar_back_yellow));
tb_title.setmLeftText("");
tb_title.setImageListener(v -> {
if (h5Params.getShowUrlTitle()) {
......@@ -831,7 +839,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
return true;
}
} else if (url.startsWith("alipays://") || url.startsWith("alipay")) {
try{
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
return true;
} catch (Exception e) {
......@@ -848,7 +856,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
// 处理微信 H5 支付跳转时验证请求头 referer 失效
// 验证不通过会出现“商家参数格式有误,请联系商家解决”
if (url.contains("wx.tenpay.com")){
if (url.contains("wx.tenpay.com")) {
// 申请微信 H5 支付时填写的域名
// 比如经常用来测试网络连通性的 http://www.baidu.com
......@@ -857,12 +865,12 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
String redirectUrlStr = parse.getQueryParameter("redirect_url");
Uri redirectUrl = Uri.parse(redirectUrlStr);
// 申请微信 H5 支付时填写的域名
String referer = redirectUrl.getScheme()+"://"+redirectUrl.getHost();
String referer = redirectUrl.getScheme() + "://" + redirectUrl.getHost();
// 兼容 Android 4.4.3 和 4.4.4 两个系统版本设置 referer 无效的问题
if (("4.4.3".equals(Build.VERSION.RELEASE))
|| ("4.4.4".equals(Build.VERSION.RELEASE))) {
if (firstVisitWXH5PayUrl){
if (firstVisitWXH5PayUrl) {
view.loadDataWithBaseURL(referer, "<script>window.location.href=\"" + url + "\";</script>",
"text/html", "utf-8", null);
// 修改标记位状态,避免循环调用
......@@ -878,7 +886,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
view.loadUrl(url, map);
return true;
}
}else if(url.contains("alipay")) {
} else if (url.contains("alipay")) {
return false;
}
......@@ -907,11 +915,11 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}
public void onEvent(RefreshWebEvent event) {
if(event.isClearHistory) {
if (event.isClearHistory) {
wv_content.clearCache(true);
wv_content.clearHistory();
loadUrl(h5Params.getUrl());
}else{
} else {
//刷新页面
loadUrl(h5Params.getUrl());
shouldClearHistory = true;
......@@ -977,7 +985,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}
String resultUrl = h5Params.getSuffix() ? TemporaryUtils.getSuffix(url) : url;
Log.e("AAAA",resultUrl);
Log.e("AAAA", resultUrl);
wv_content.loadUrl(resultUrl);
pointBI(resultUrl);
}
......@@ -994,7 +1002,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
private void initHead() {
// header
final MaterialHeader header = new MaterialHeader(this);
int[] colors = new int[]{getResources().getColor(YDLConstants.FROM_YDL.equals(appFrom)?R.color.platform_google_green :R.color.platform_google_yellow)};
int[] colors = new int[]{getResources().getColor(YDLConstants.FROM_YDL.equals(appFrom) ? R.color.platform_google_green : R.color.platform_google_yellow)};
header.setColorSchemeColors(colors);
header.setLayoutParams(new PtrFrameLayout.LayoutParams(-1, -2));
int padding = (int) getResources().getDimension(R.dimen.platform_default_dis_size);
......@@ -1284,6 +1292,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
}
private void toTrend(String url) {
WebModularServiceUtils.Companion.getDynamicService().publishArticleToTrend(NewH5Activity.this, url, cover, shareTitle);
WebModularServiceUtils.Companion.getDynamicService().publishArticleToTrend(NewH5Activity.this, url, cover, shareTitle);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment