Merge branch 'dev_arch_opt_3.0' into 'dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0'
Dev arch opt 3.0 See merge request zhjt/AndroidApp/MoGoEagleEye!652
This commit is contained in:
@@ -73,11 +73,11 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
/**
|
||||
* obu弱势交通控制
|
||||
*/
|
||||
tbObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
|
||||
tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
|
||||
// 默认开启
|
||||
HmiBuildConfig.isShowObuWeaknessTrafficView = !isChecked
|
||||
}
|
||||
// tbObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
|
||||
// tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
|
||||
// // 默认开启
|
||||
// HmiBuildConfig.isShowObuWeaknessTrafficView = !isChecked
|
||||
// }
|
||||
|
||||
/**
|
||||
* 云端弱势交通控制
|
||||
@@ -88,14 +88,6 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
HmiBuildConfig.isShowCloudWeaknessTrafficView = isChecked
|
||||
}
|
||||
|
||||
/**
|
||||
* 限速数据来源开关
|
||||
*/
|
||||
tbRoadLimitSpeedSop.setOnCheckedChangeListener { _, isChecked ->
|
||||
// 默认关闭
|
||||
HmiBuildConfig.isShowObuLimitSpeedView = isChecked
|
||||
}
|
||||
|
||||
/**
|
||||
* obu V2V开关,默认打开
|
||||
*/
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description fix java.lang.IndexOutOfBoundsException:检测到不一致。视图持有者适配器positionViewHolder无效
|
||||
* @since: 2022/6/7
|
||||
*/
|
||||
class WrapContentLinearLayoutManager : LinearLayoutManager {
|
||||
constructor(context: Context?) : super(context) {}
|
||||
|
||||
constructor(context: Context?, orientation: Int, reverseLayout: Boolean) : super(
|
||||
context,
|
||||
orientation,
|
||||
reverseLayout
|
||||
) {}
|
||||
|
||||
constructor(
|
||||
context: Context?,
|
||||
attrs: AttributeSet?,
|
||||
defStyleAttr: Int,
|
||||
defStyleRes: Int
|
||||
) : super(context, attrs, defStyleAttr, defStyleRes) {}
|
||||
|
||||
override fun onLayoutChildren(recycler: RecyclerView.Recycler?, state: RecyclerView.State?) {
|
||||
try {
|
||||
super.onLayoutChildren(recycler, state)
|
||||
} catch (e: IndexOutOfBoundsException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
private var keyBoardUtil: KeyBoardUtil? = null
|
||||
@Volatile
|
||||
private var connectStatus = false
|
||||
private var lastTime = 0L
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ class PncActionsView @JvmOverloads constructor(
|
||||
@Volatile
|
||||
private var mTrafficLightResult: TrafficLightResult? = null
|
||||
|
||||
@Volatile
|
||||
private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null
|
||||
|
||||
private val bgResources: Int
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.view.View
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import kotlin.math.abs
|
||||
|
||||
|
||||
@@ -139,17 +140,19 @@ class BatteryView : View , IMoGoSkinModeChangeListener {
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
when (skinMode) {
|
||||
0 -> {
|
||||
batteryColor = resources.getColor(R.color.color_27FFFFFF)
|
||||
powerColor = Color.WHITE
|
||||
}
|
||||
1 -> {
|
||||
batteryColor = resources.getColor(R.color.color_1E111111)
|
||||
powerColor = resources.getColor(R.color.color_2C2E30)
|
||||
ThreadUtils.runOnUiThread {
|
||||
when (skinMode) {
|
||||
0 -> {
|
||||
batteryColor = resources.getColor(R.color.color_27FFFFFF)
|
||||
powerColor = Color.WHITE
|
||||
}
|
||||
1 -> {
|
||||
batteryColor = resources.getColor(R.color.color_1E111111)
|
||||
powerColor = resources.getColor(R.color.color_2C2E30)
|
||||
}
|
||||
}
|
||||
invalidate()
|
||||
}
|
||||
invalidate()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
|
||||
@@ -29,7 +29,9 @@ class CheckSystemView @JvmOverloads constructor(
|
||||
const val TAG = "CheckSystemView"
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var connectStatus = false //是否连接工控机
|
||||
@Volatile
|
||||
private var autopilotStatus: Int? = null //自动驾驶状态 0代表不可自动驾驶,1代表可自动驾驶,2代表自动驾驶中
|
||||
private var dockerRebootDialog: DockerRebootDialog? = null
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import kotlinx.android.synthetic.main.view_status_bar.view.*
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
|
||||
@@ -55,9 +56,11 @@ class StatusBarView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
when (skinMode) {
|
||||
0 -> setStatusBarDarkOrLight(false)
|
||||
1 -> setStatusBarDarkOrLight(true)
|
||||
ThreadUtils.runOnUiThread {
|
||||
when (skinMode) {
|
||||
0 -> setStatusBarDarkOrLight(false)
|
||||
1 -> setStatusBarDarkOrLight(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ class VersionNameView @JvmOverloads constructor(
|
||||
const val TAG = "VersionNameView"
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var dockerVersion: String? = null //工控机版本
|
||||
|
||||
init{
|
||||
|
||||
@@ -282,11 +282,13 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
val status = autoPilotStatusInfo.ipcConnStatus
|
||||
if (mLastStatus != status) {
|
||||
val statusInfo = autoPilotStatusInfo.clone()
|
||||
rvConnectInfo.post { updateConnectInfoView(statusInfo) }
|
||||
mLastStatus = status
|
||||
UiThreadHandler.post {
|
||||
val status = autoPilotStatusInfo.ipcConnStatus
|
||||
if (mLastStatus != status) {
|
||||
val statusInfo = autoPilotStatusInfo.clone()
|
||||
rvConnectInfo.post { updateConnectInfoView(statusInfo) }
|
||||
mLastStatus = status
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.main;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Process;
|
||||
|
||||
@@ -18,20 +17,15 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
|
||||
import com.mogo.eagle.core.function.msgbox.db.MsgBoxDb;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.SPUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 默认初始化一些基础服务配置 todo 分离 msgBox去自己的模块中 --- 扶风
|
||||
* 默认初始化一些基础服务配置
|
||||
*/
|
||||
public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
|
||||
@@ -50,12 +44,8 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
initLogConfig();
|
||||
initTipToast();
|
||||
initModules();
|
||||
if (ProcessUtils.isMainProcess(this)) {
|
||||
clearMessageBoxTable();
|
||||
CallerMsgBoxManager.INSTANCE.queryAllMessages(this);
|
||||
}
|
||||
CallerMsgBoxManager.INSTANCE.queryAllMessages(this);
|
||||
CallerDevaToolsManager.INSTANCE.updateUpgradeProgress();
|
||||
CallerDevaToolsManager.INSTANCE.updateObuUpgradeStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,38 +54,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
private void clearMessageBoxTable() {
|
||||
new Thread(() -> {
|
||||
String lastLaunchTimeStr = SPUtils.getInstance().getString("last_launch", "");
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date currDate = new Date(System.currentTimeMillis());
|
||||
String currTimeStr = format.format(currDate);
|
||||
try {
|
||||
if (lastLaunchTimeStr != null && !lastLaunchTimeStr.isEmpty()) {
|
||||
boolean isSameDay = currTimeStr.equals(lastLaunchTimeStr);
|
||||
// 超过一天需要清除消息盒子中的数据,并把时间戳存入SP
|
||||
if (!isSameDay) {
|
||||
File file = this.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME);
|
||||
if (file != null && file.exists()) {
|
||||
this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME);
|
||||
}
|
||||
SPUtils.getInstance().put("last_launch", currTimeStr);
|
||||
}
|
||||
} else {
|
||||
// 首次使用App或中途仅删除sp文件
|
||||
File file = this.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME);
|
||||
if (file != null && file.exists()) {
|
||||
this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME);
|
||||
}
|
||||
SPUtils.getInstance().put("last_launch", currTimeStr);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(TAG, e.getMessage());
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化异常采集配置
|
||||
*/
|
||||
@@ -126,11 +84,11 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_V2X_OBU_MOGO, "IMoGoObuProvider"));
|
||||
// BIZ
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_FUNC_BIZ, "IMoGoNoticeProvider"));
|
||||
// todo 后置 车聊聊,IM
|
||||
// 后置 车聊聊,IM
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(ChatConsts.CHAT_PROVIDER_PATH, ChatConsts.CHAT_MODULE_NAME));
|
||||
// 司机身份专属
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
// todo 后置 地图数据收集模块
|
||||
// 后置 地图数据收集模块
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER, "MoGoMapDataCollector"));
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
@@ -141,7 +99,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
super.attachBaseContext(base);
|
||||
/*如果是主进程**/
|
||||
// if (ProcessUtils.isMainProcess(this)) {
|
||||
AppLaunchTimeUtils.beginTimeCalculate(AppLaunchTimeUtils.COLD_START);
|
||||
AppLaunchTimeUtils.beginTimeCalculate(AppLaunchTimeUtils.COLD_START);
|
||||
// }
|
||||
BoostMultiDex.install(base);
|
||||
AbsMogoApplication.sApp = this;
|
||||
|
||||
@@ -163,11 +163,13 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
/>
|
||||
|
||||
<!--这个后面产品会统一去掉-->
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/tbObuToDcView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="OBU到工控机V2I显示"
|
||||
android:visibility="gone"
|
||||
android:paddingTop="25dp"
|
||||
android:paddingBottom="25dp"
|
||||
android:scaleY="1.2"
|
||||
@@ -200,7 +202,7 @@
|
||||
android:paddingBottom="25dp"
|
||||
android:scaleY="1.2"
|
||||
android:scaleX="1.2"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbObuToDcView"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbObuV2vView"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
|
||||
/>
|
||||
@@ -214,31 +216,17 @@
|
||||
android:paddingBottom="25dp"
|
||||
android:scaleY="1.2"
|
||||
android:scaleX="1.2"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbObuToDcView"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbObuWeaknessTrafficSop"
|
||||
app:layout_constraintLeft_toRightOf="@id/verticalGuideLine"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/tbRoadLimitSpeedSop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="路侧限速提醒"
|
||||
android:paddingTop="25dp"
|
||||
android:paddingBottom="25dp"
|
||||
android:scaleY="1.2"
|
||||
android:scaleX="1.2"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbCloudWeaknessTrafficSop"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSpeedThresholdTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbRoadLimitSpeedSop"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbCloudWeaknessTrafficSop"
|
||||
android:text="变道速度阈值:"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:textColor="#1A1A1A"
|
||||
|
||||
Reference in New Issue
Block a user