[6.7.0-tmp]update
This commit is contained in:
@@ -5,6 +5,8 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import kotlinx.android.synthetic.main.view_bone_tab.view.carInfoTabView
|
||||
import kotlinx.android.synthetic.main.view_bone_tab.view.tabSwitchCarInfo
|
||||
import kotlinx.android.synthetic.main.view_bone_tab.view.tabSwitchMore
|
||||
@@ -18,6 +20,10 @@ class BoneTabLayout @JvmOverloads constructor(
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
companion object{
|
||||
private const val TAG = "BoneTabLayout"
|
||||
}
|
||||
|
||||
private enum class TabType {
|
||||
NONE,
|
||||
CAR_INFO,
|
||||
@@ -27,6 +33,7 @@ class BoneTabLayout @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private var tabType by Delegates.observable(TabType.NONE) { _, oldValue, newValue ->
|
||||
CallerLogger.i("$M_HMI$TAG", "tabType old:$oldValue , new:$newValue")
|
||||
if (oldValue != newValue) {
|
||||
updateTab(oldValue, false)
|
||||
updateTab(newValue, true)
|
||||
@@ -59,11 +66,12 @@ class BoneTabLayout @JvmOverloads constructor(
|
||||
tabType = if (tabType == changeType) {
|
||||
TabType.NONE
|
||||
} else {
|
||||
TabType.CAR_INFO
|
||||
changeType
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateTab(tabType: TabType, check: Boolean) {
|
||||
CallerLogger.i("$M_HMI$TAG", "updateTab tabType:$tabType , check:$check")
|
||||
when (tabType) {
|
||||
TabType.CAR_INFO -> {
|
||||
tabSwitchCarInfo.switchTab(check)
|
||||
|
||||
@@ -6,10 +6,12 @@ import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
@@ -20,6 +22,7 @@ import com.mogo.eagle.core.function.hmi.ui.tools.OfflineMapDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
@@ -33,23 +36,32 @@ import kotlinx.android.synthetic.main.view_car_info_tab.view.tvHDMapUpdate
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvPADUpdate
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvPadVersion
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvSnInfo
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import system_master.SsmInfo
|
||||
import system_master.SystemStatusInfo
|
||||
|
||||
private fun String.parsePlateNo(): String {
|
||||
return substring(0, 2) + " " + substring(2)
|
||||
}
|
||||
|
||||
private fun String.parsePhoneNo(): String {
|
||||
return take(3) + "****" + takeLast(4)
|
||||
}
|
||||
|
||||
class CarInfoTabView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoCheckAutoPilotBtnListener,
|
||||
IMoGoAutopilotStatusListener, IMoGoDevaToolsListener {
|
||||
IMoGoAutopilotStatusListener, IMoGoDevaToolsListener, IMoGoAutopilotCarConfigListener {
|
||||
|
||||
companion object{
|
||||
companion object {
|
||||
private const val TAG = "CarInfoTabView"
|
||||
}
|
||||
|
||||
|
||||
private var loginOut: (() -> Unit)? = null
|
||||
|
||||
@Volatile
|
||||
private var isHDCached = false
|
||||
|
||||
@@ -62,6 +74,7 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
super.onAttachedToWindow()
|
||||
CallerHmiListenerManager.addListener(TAG, this)
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
|
||||
CallerDevaToolsListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
@@ -78,9 +91,16 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
updateAdHdMapVersion()
|
||||
|
||||
tvSnInfo.text = SharedPrefsMgr.getInstance().sn
|
||||
|
||||
if (AppConfigInfo.plateNumber.isNotEmpty()) {
|
||||
val plateNo = AppConfigInfo.plateNumber
|
||||
tvCarNo.text = plateNo.parsePlateNo()
|
||||
}
|
||||
|
||||
tvCarExit.setOnClickListener {
|
||||
loginOut?.invoke()
|
||||
}
|
||||
|
||||
//鹰眼版本 检查更新
|
||||
tvPADUpdate.setOnClickListener {
|
||||
HmiActionLog.hmiAction(
|
||||
@@ -109,7 +129,8 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
ToastUtils.showShort(resources.getString(R.string.location_try_again))
|
||||
} else { // 拿到了高精的经纬度
|
||||
val dialog = OfflineMapDialog(context)
|
||||
dialog.location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
dialog.location =
|
||||
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
dialog.show()
|
||||
}
|
||||
} else {// 拿到高德的cityCode
|
||||
@@ -117,6 +138,7 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MogoData.mogoMapData.get()?.isCityDataCached {
|
||||
updateHDDataCacheStatus(it)
|
||||
}
|
||||
@@ -126,23 +148,37 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
tvPadVersion.text = tvPadVersion.text.toString() + AppUtils.getAppVersionName()
|
||||
}
|
||||
|
||||
|
||||
fun setLoginInfo(loginNo: String) {
|
||||
if (loginNo.isNotEmpty()) {
|
||||
tvCarLoginInfo.text = loginNo.take(3) + "****" + loginNo.takeLast(4)
|
||||
tvCarLoginInfo.text = loginNo.parsePhoneNo()
|
||||
} else {
|
||||
tvCarLoginInfo.text = ""
|
||||
}
|
||||
}
|
||||
|
||||
fun setCarNo(carNo: String) {
|
||||
// todo emArrow 需要同时监听工控的车牌信息,防止调试跳过无车牌内容(链接先后顺序不一致也会导致数据显示异常)
|
||||
if (carNo.isEmpty()) {
|
||||
// 监听工控的车牌信息,防止调试跳过无车牌内容(链接先后顺序不一致也会导致数据显示异常)
|
||||
if (carNo.isNotEmpty()) {
|
||||
if (tvCarNo.text.isNotEmpty() && tvCarNo.text == carNo) {
|
||||
CallerLogger.i("$M_HMI$TAG", "已存在车牌号")
|
||||
return
|
||||
}
|
||||
tvCarNo.visibility = VISIBLE
|
||||
tvCarNo.text = carNo.parsePlateNo()
|
||||
} else {
|
||||
tvCarNo.visibility = GONE
|
||||
tvCarNo.text = ""
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
|
||||
super.onAutopilotCarConfig(carConfigResp)
|
||||
carConfigResp.plateNumber?.let {
|
||||
if (tvCarNo.text.isNotEmpty() && tvCarNo.text == it) {
|
||||
return
|
||||
}
|
||||
tvCarNo.visibility = VISIBLE
|
||||
tvCarNo.text = carNo.substring(0, 2) + " " + carNo.substring(2);
|
||||
tvCarNo.text = it.parsePlateNo()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +204,7 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private fun updateAdHdMapVersion() {
|
||||
if(AppConfigInfo.adHdMapVersion.isNotEmpty()){
|
||||
if (AppConfigInfo.adHdMapVersion.isNotEmpty()) {
|
||||
tvADMapVersion.text = tvADMapVersion.text.toString() + AppConfigInfo.adHdMapVersion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_19"
|
||||
android:elevation="10dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -21,7 +20,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_385"
|
||||
android:elevation="1dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -31,7 +29,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_385"
|
||||
android:elevation="20dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,36 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_960"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clBoneTabChild"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_1128"
|
||||
android:elevation="1dp"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.bone.tab.CarInfoTabView
|
||||
android:id="@+id/carInfoTabView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:layout_width="@dimen/dp_960"
|
||||
android:layout_height="@dimen/dp_1137"
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_height="match_parent"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_224"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginBottom="@dimen/dp_m_2"
|
||||
android:background="@drawable/bg_tab_switch"
|
||||
android:elevation="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent">
|
||||
@@ -41,10 +38,9 @@
|
||||
android:layout_height="@dimen/dp_140"
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:elevation="10dp"
|
||||
app:defaultRes="@drawable/icon_tab_car_info"
|
||||
app:clickRes="@drawable/icon_tab_car_info_click"
|
||||
app:clickBgRes="@drawable/icon_tab_click_bg"
|
||||
app:clickRes="@drawable/icon_tab_car_info_click"
|
||||
app:defaultRes="@drawable/icon_tab_car_info"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -53,9 +49,9 @@
|
||||
android:layout_width="@dimen/dp_220"
|
||||
android:layout_height="@dimen/dp_140"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
app:defaultRes="@drawable/icon_tab_msg_box"
|
||||
app:clickRes="@drawable/icon_tab_msg_box_click"
|
||||
app:clickBgRes="@drawable/icon_tab_click_bg"
|
||||
app:clickRes="@drawable/icon_tab_msg_box_click"
|
||||
app:defaultRes="@drawable/icon_tab_msg_box"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tabSwitchCarInfo"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -64,9 +60,9 @@
|
||||
android:layout_width="@dimen/dp_220"
|
||||
android:layout_height="@dimen/dp_140"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
app:defaultRes="@drawable/icon_tab_report"
|
||||
app:clickRes="@drawable/icon_tab_report_click"
|
||||
app:clickBgRes="@drawable/icon_tab_click_bg"
|
||||
app:clickRes="@drawable/icon_tab_report_click"
|
||||
app:defaultRes="@drawable/icon_tab_report"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tabSwitchMsgBox"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -75,9 +71,9 @@
|
||||
android:layout_width="@dimen/dp_220"
|
||||
android:layout_height="@dimen/dp_140"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
app:defaultRes="@drawable/icon_tab_more"
|
||||
app:clickRes="@drawable/icon_tab_more_click"
|
||||
app:clickBgRes="@drawable/icon_tab_click_bg"
|
||||
app:clickRes="@drawable/icon_tab_more_click"
|
||||
app:defaultRes="@drawable/icon_tab_more"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tabSwitchReport"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -6,40 +6,44 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_tab_item">
|
||||
|
||||
<View
|
||||
android:id="@+id/topViewPos"
|
||||
android:layout_width="@dimen/dp_856"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:layout_marginTop="@dimen/dp_21"
|
||||
android:layout_marginEnd="@dimen/dp_40"
|
||||
android:background="@drawable/bg_tab_view_top"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:layout_marginStart="@dimen/dp_104"
|
||||
android:layout_marginTop="@dimen/dp_55"
|
||||
android:text="@string/tab_car_info"
|
||||
android:textColor="@color/color_CC_FFFFFF"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="@dimen/dp_700"
|
||||
android:layout_marginTop="@dimen/dp_75"
|
||||
app:layout_constraintTop_toBottomOf="@+id/topViewPos">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_21">
|
||||
|
||||
<View
|
||||
android:id="@+id/topViewPos"
|
||||
android:layout_width="@dimen/dp_856"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
android:background="@drawable/bg_tab_view_top"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:layout_marginStart="@dimen/dp_64"
|
||||
android:layout_marginTop="@dimen/dp_34"
|
||||
android:text="@string/tab_car_info"
|
||||
android:textColor="@color/color_CC_FFFFFF"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
android:layout_marginEnd="@dimen/dp_40">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivCarType"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_280"
|
||||
android:layout_marginTop="@dimen/dp_75"
|
||||
app:layout_constraintTop_toBottomOf="@+id/topViewPos"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
@@ -215,7 +219,7 @@
|
||||
android:id="@+id/tvSnInfo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_39"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_32"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tvSnPos"
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<View
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
<string name="tab_car_no">车辆绑定</string>
|
||||
<string name="tab_version_info">版本信息</string>
|
||||
<string name="tab_sn">设备SN</string>
|
||||
<string name="tab_version_pad_info">PAD:</string>
|
||||
<string name="tab_version_ad_info">AD:</string>
|
||||
<string name="tab_version_hdmap_info">HDMAP:</string>
|
||||
<string name="tab_version_admap_info">ADMAP:</string>
|
||||
<string name="tab_version_pad_info">PAD:</string>
|
||||
<string name="tab_version_ad_info">AD:</string>
|
||||
<string name="tab_version_hdmap_info">HDMAP:</string>
|
||||
<string name="tab_version_admap_info">ADMAP:</string>
|
||||
<string name="tab_version_update">检查更新</string>
|
||||
|
||||
<string name="log_min">最小化</string>
|
||||
|
||||
Reference in New Issue
Block a user