bugly版本检测
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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<RecyclerView.ViewHolder>
|
||||
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<RecyclerView.ViewHolder>
|
||||
//鹰眼应用
|
||||
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<RecyclerView.ViewHolder>
|
||||
} 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());
|
||||
|
||||
@@ -58,10 +58,11 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/auto_risk_state"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/dp_260"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_56"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/check_little_btn_green"
|
||||
android:textSize="@dimen/dp_36"
|
||||
app:layout_constraintTop_toTopOf="@+id/icon_auto_title" />
|
||||
|
||||
Reference in New Issue
Block a user