diff --git a/modules/mogo-module-check/build.gradle b/modules/mogo-module-check/build.gradle index 9ef58bae7c..a839783784 100644 --- a/modules/mogo-module-check/build.gradle +++ b/modules/mogo-module-check/build.gradle @@ -62,7 +62,10 @@ dependencies { api project(":foudations:mogo-commons") api project(':services:mogo-service-api') } - + implementation 'com.tencent.bugly:crashreport_upgrade:latest.release' + //其中latest.release指代最新Bugly SDK版本号,也可以指定明确的版本号,例如2.1.9 + implementation 'com.tencent.bugly:nativecrashreport:latest.release' + //其中latest.release指代最新Bugly NDK版本号,也可以指定明确的版本号,例如3.0 } diff --git a/modules/mogo-module-check/src/main/java/com/mogo/module/check/view/CheckActivity.java b/modules/mogo-module-check/src/main/java/com/mogo/module/check/view/CheckActivity.java index 850aed08bc..884ad0526b 100644 --- a/modules/mogo-module-check/src/main/java/com/mogo/module/check/view/CheckActivity.java +++ b/modules/mogo-module-check/src/main/java/com/mogo/module/check/view/CheckActivity.java @@ -18,6 +18,8 @@ import com.mogo.module.check.model.CheckItemInfo; import com.mogo.module.common.view.SpacesItemDecoration; import com.mogo.utils.CommonUtils; import com.mogo.utils.network.utils.NetworkStatusUtil; +import com.tencent.bugly.beta.Beta; +import com.tencent.bugly.beta.UpgradeInfo; import java.util.ArrayList; import java.util.concurrent.TimeUnit; @@ -113,9 +115,10 @@ public class CheckActivity extends AppCompatActivity { ArrayList arrayVer = new ArrayList(); //adas 检测指标 - //鹰眼 + //鹰眼当前版本 String verCodeStr = CommonUtils.getVersionName(context, true); Log.d(TAG, "版本检测结果:鹰眼" + verCodeStr); + //测试数据 CheckItemInfo itemInfo = new CheckItemInfo(); itemInfo.setViewTitle("版本检测:"); @@ -127,9 +130,16 @@ public class CheckActivity extends AppCompatActivity { arrayVer.add(itemInfo); CheckItemInfo yingyan = new CheckItemInfo(); - yingyan.setUsual(true); - yingyan.setTitle(" 鹰眼 \n版本" + verCodeStr); - yingyan.setValue("最新版本 无风险"); + UpgradeInfo upgradeInfo = Beta.getUpgradeInfo(); + if (upgradeInfo == null) { + yingyan.setUsual(true); + yingyan.setTitle(" 鹰眼 \n版本" + verCodeStr); + yingyan.setValue("最新版本 无风险"); + } else { + yingyan.setUsual(false); + yingyan.setTitle(" 鹰眼升级到 \n版本" + upgradeInfo.versionName); + yingyan.setValue("版本升级"); + } arrayVer.add(yingyan); dataArrayList.add(arrayVer); } diff --git a/modules/mogo-module-check/src/main/java/com/mogo/module/check/view/CheckAdapter.java b/modules/mogo-module-check/src/main/java/com/mogo/module/check/view/CheckAdapter.java index 5f56ab50d0..1d8fd61c37 100644 --- a/modules/mogo-module-check/src/main/java/com/mogo/module/check/view/CheckAdapter.java +++ b/modules/mogo-module-check/src/main/java/com/mogo/module/check/view/CheckAdapter.java @@ -1,6 +1,7 @@ package com.mogo.module.check.view; import android.content.Context; +import android.content.Intent; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -13,6 +14,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.mogo.module.check.R; import com.mogo.module.check.model.CheckItemInfo; +import com.mogo.module.common.MogoApisHandler; import java.util.ArrayList; @@ -89,7 +91,6 @@ public class CheckAdapter extends RecyclerView.Adapter private TextView iconAutoTitle; private TextView autoRiskState; - private TextView yingDetailTitle; private TextView iconyingTitle; private TextView yingRiskState; @@ -102,6 +103,13 @@ public class CheckAdapter extends RecyclerView.Adapter //鹰眼应用 iconyingTitle = itemView.findViewById(R.id.icon_ying_title); yingRiskState = itemView.findViewById(R.id.ying_risk_state); + itemView.setLongClickable(true); + itemView.setOnLongClickListener(v -> { + Log.d(TAG, "长按显示状态工具栏"); + Intent intent = new Intent(); + intent.putExtra("oper", 52); + return true; + }); } } @@ -170,6 +178,14 @@ public class CheckAdapter extends RecyclerView.Adapter } else { ((CheckListViewHolder) holder).autoRiskState.setTextColor(mContext.getResources().getColor(R.color.check_tip_error_color)); } + if (position == 1) { + if (item.isUsual() == false) { + ((CheckListViewHolder) holder).autoRiskState.setTextColor(mContext.getResources().getColor(R.color.modules_commons_toast_text_color)); + ((CheckListViewHolder) holder).autoRiskState.setBackground(mContext.getResources().getDrawable(R.drawable.check_detail)); + } else { + ((CheckListViewHolder) holder).autoRiskState.setTextColor(mContext.getResources().getColor(R.color.check_little_btn_green)); + } + } //鹰眼 CheckItemInfo itemForYing = (CheckItemInfo) ((ArrayList) list).get(1); ((CheckListViewHolder) holder).iconyingTitle.setText(itemForYing.getTitle()); diff --git a/modules/mogo-module-check/src/main/res/layout/check_list.xml b/modules/mogo-module-check/src/main/res/layout/check_list.xml index b0c84053e3..8f9869e6e8 100644 --- a/modules/mogo-module-check/src/main/res/layout/check_list.xml +++ b/modules/mogo-module-check/src/main/res/layout/check_list.xml @@ -58,10 +58,11 @@