[6.7.0] finish the func of car
This commit is contained in:
@@ -5,8 +5,6 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.enums.Carmodel
|
||||
import com.mogo.eagle.core.function.api.och.IOchFunctionCallNotify
|
||||
import com.mogo.eagle.core.function.call.och.CallerOchBizFunctionCall4EagleManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import kotlinx.android.synthetic.main.view_bone_container.view.clBoneBiz
|
||||
@@ -16,9 +14,9 @@ class BoneContainerView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IOchFunctionCallNotify {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
companion object{
|
||||
companion object {
|
||||
private const val TAG = "BoneContainerView"
|
||||
}
|
||||
|
||||
@@ -29,14 +27,6 @@ class BoneContainerView @JvmOverloads constructor(
|
||||
|
||||
private var logOut: (() -> Unit)? = null
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
clBoneTab.loginOut {
|
||||
CallerOchBizFunctionCall4EagleManager.logout()
|
||||
@@ -47,17 +37,8 @@ class BoneContainerView @JvmOverloads constructor(
|
||||
clBoneBiz.addView(view)
|
||||
}
|
||||
|
||||
fun loginOut(logOut:(() -> Unit)){
|
||||
fun loginOut(logOut: (() -> Unit)) {
|
||||
this.logOut = logOut
|
||||
}
|
||||
|
||||
override fun notifyCarMode(carModel: Carmodel?) {
|
||||
super.notifyCarMode(carModel)
|
||||
clBoneTab.setCarMode(carModel)
|
||||
}
|
||||
|
||||
override fun notifyPlateNumber(plateNumber: String?) {
|
||||
super.notifyPlateNumber(plateNumber)
|
||||
clBoneTab.setCarNo(plateNumber)
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.enums.Carmodel
|
||||
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
@@ -115,18 +114,6 @@ class BoneTabLayout @JvmOverloads constructor(
|
||||
})
|
||||
}
|
||||
|
||||
fun setCarNo(carNo: String?) {
|
||||
carInfoTabView.setCarNo(carNo)
|
||||
}
|
||||
|
||||
fun setLoginInfo(loginNo: String) {
|
||||
carInfoTabView.setLoginInfo(loginNo)
|
||||
}
|
||||
|
||||
fun setCarMode(carModel: Carmodel?) {
|
||||
carInfoTabView.setCarMode(carModel)
|
||||
}
|
||||
|
||||
fun loginOut(logOut: (() -> Unit)) {
|
||||
UiThreadHandler.post {
|
||||
this.logOut = logOut
|
||||
|
||||
@@ -4,21 +4,28 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.enums.Carmodel
|
||||
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.datacenter.IDataCenterBizListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener
|
||||
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.api.och.IOchFunctionCallNotify
|
||||
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.datacenter.CallerDataCenterBizListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.bone.BoneTabLayout
|
||||
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
|
||||
@@ -29,13 +36,15 @@ import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.map.MogoData
|
||||
import kotlinx.android.synthetic.main.view_bone_container.view.clBoneTab
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.ivCarType
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvADMapVersion
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvADVersion
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvADVersionName
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvCarExit
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvCarLoginInfo
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvCarNo
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvHDMapUpdate
|
||||
import kotlinx.android.synthetic.main.view_car_info_tab.view.tvHDMapVersion
|
||||
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
|
||||
@@ -55,7 +64,7 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoCheckAutoPilotBtnListener,
|
||||
IMoGoAutopilotStatusListener, IMoGoDevaToolsListener {
|
||||
IMoGoAutopilotStatusListener, IMoGoDevaToolsListener, IDataCenterBizListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "CarInfoTabView"
|
||||
@@ -77,6 +86,7 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
CallerHmiListenerManager.addListener(TAG, this)
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerDevaToolsListenerManager.addListener(TAG, this)
|
||||
CallerDataCenterBizListener.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
@@ -84,6 +94,7 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
CallerHmiListenerManager.removeListener(TAG)
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerDevaToolsListenerManager.removeListener(TAG)
|
||||
CallerDataCenterBizListener.removeListener(TAG)
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
@@ -110,6 +121,7 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
CallerDevaToolsManager.queryAppUpgrade()
|
||||
}
|
||||
|
||||
tvHDMapVersion.text = tvHDMapVersion.text.toString() + DebugConfig.getMapVersion()
|
||||
//高精地图 检查更新
|
||||
tvHDMapUpdate.setOnClickListener {
|
||||
HmiActionLog.hmiAction(
|
||||
@@ -144,26 +156,24 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
tvPadVersion.text = tvPadVersion.text.toString() + AppUtils.getAppVersionName()
|
||||
}
|
||||
|
||||
fun setLoginInfo(loginNo: String) {
|
||||
override fun invokeCarRes(res: Int) {
|
||||
super.invokeCarRes(res)
|
||||
UiThreadHandler.post {
|
||||
if (loginNo.isNotEmpty()) {
|
||||
tvCarLoginInfo.text = loginNo.parsePhoneNo()
|
||||
} else {
|
||||
tvCarLoginInfo.text = ""
|
||||
}
|
||||
ivCarType.setImageResource(res)
|
||||
}
|
||||
}
|
||||
|
||||
fun setCarNo(carNo: String?) {
|
||||
override fun invokeCarNo(no: String?) {
|
||||
super.invokeCarNo(no)
|
||||
UiThreadHandler.post {
|
||||
// 监听工控的车牌信息,防止调试跳过无车牌内容(链接先后顺序不一致也会导致数据显示异常)
|
||||
if (!carNo.isNullOrEmpty()) {
|
||||
if (tvCarNo.text.isNotEmpty() && tvCarNo.text == carNo) {
|
||||
if (!no.isNullOrEmpty()) {
|
||||
if (tvCarNo.text.isNotEmpty() && tvCarNo.text == no) {
|
||||
CallerLogger.i("$M_HMI$TAG", "已存在车牌号")
|
||||
return@post
|
||||
}
|
||||
tvCarNo.visibility = VISIBLE
|
||||
tvCarNo.text = carNo.parsePlateNo()
|
||||
tvCarNo.text = no.parsePlateNo()
|
||||
} else {
|
||||
tvCarNo.visibility = GONE
|
||||
tvCarNo.text = ""
|
||||
@@ -171,13 +181,12 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun setCarMode(carModel: Carmodel?){
|
||||
fun setLoginInfo(loginNo: String) {
|
||||
UiThreadHandler.post {
|
||||
if(carModel == null){
|
||||
ivCarType.visibility = GONE
|
||||
}else{
|
||||
ivCarType.visibility = VISIBLE
|
||||
ivCarType.setImageResource(carModel.resId)
|
||||
if (loginNo.isNotEmpty()) {
|
||||
tvCarLoginInfo.text = loginNo.parsePhoneNo()
|
||||
} else {
|
||||
tvCarLoginInfo.text = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -193,7 +202,7 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
private fun showCurrentAdVersion() {
|
||||
UiThreadHandler.post {
|
||||
CallerAutoPilotStatusListenerManager.getDockerVersion()?.let {
|
||||
tvADVersion.text = tvADVersion.text.toString() + it
|
||||
tvADVersionName.text = it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ class OfflineMapDialog(context: Context) : BaseFloatDialog(context) {
|
||||
if (this@OfflineMapDialog.isShowing) {
|
||||
progressBar?.let {
|
||||
if (it.visibility == View.VISIBLE) {
|
||||
it.progress = if (progress in 1..5) 5 else progress
|
||||
it.progress = if (progress <= 5) 5 else progress
|
||||
val p = AutoSizeUtils.dp2px(
|
||||
context,
|
||||
770f
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<!-- 设置背景色 -->
|
||||
<item
|
||||
android:id="@android:id/background"
|
||||
android:width="@dimen/dp_760"
|
||||
android:height="@dimen/dp_10"
|
||||
android:width="@dimen/dp_770"
|
||||
android:height="@dimen/dp_20"
|
||||
android:gravity="center_vertical">
|
||||
<shape>
|
||||
<corners android:radius="10dp" />
|
||||
@@ -33,9 +33,8 @@
|
||||
<item
|
||||
android:id="@android:id/progress"
|
||||
android:width="@dimen/dp_770"
|
||||
android:height="@dimen/dp_50"
|
||||
android:gravity="center_vertical"
|
||||
android:left="@dimen/dp_0">
|
||||
android:height="@dimen/dp_40"
|
||||
android:gravity="center_vertical">
|
||||
<scale
|
||||
android:drawable="@drawable/icon_progress_patch"
|
||||
android:scaleWidth="100%" />
|
||||
|
||||
@@ -61,10 +61,8 @@
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_296"
|
||||
android:max="100"
|
||||
android:progress="5"
|
||||
android:progress="0"
|
||||
android:visibility="gone"
|
||||
android:paddingStart="@dimen/dp_0"
|
||||
android:paddingEnd="@dimen/dp_0"
|
||||
android:progressDrawable="@drawable/progressbar_corner_bg_test"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
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"
|
||||
@@ -17,6 +16,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/topViewPos"
|
||||
android:layout_width="@dimen/dp_160"
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:layout_marginStart="@dimen/dp_104"
|
||||
@@ -30,7 +30,6 @@
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_700"
|
||||
android:layout_marginTop="@dimen/dp_75"
|
||||
app:layout_constraintTop_toBottomOf="@+id/topViewPos">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -40,12 +39,13 @@
|
||||
android:layout_marginEnd="@dimen/dp_40">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivCarType"
|
||||
android:layout_width="@dimen/dp_760"
|
||||
android:layout_height="@dimen/dp_400"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_car_default"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:id="@+id/ivCarType"
|
||||
android:layout_width="@dimen/dp_532"
|
||||
android:layout_height="@dimen/dp_280"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
@@ -151,15 +151,28 @@
|
||||
<TextView
|
||||
android:id="@+id/tvADVersion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/tab_version_ad_info"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_32"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/tvPadVersion"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvPadVersion" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvADVersionName"
|
||||
android:layout_width="@dimen/dp_514"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:gravity="start"
|
||||
android:lines="2"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_32"
|
||||
app:layout_constraintRight_toRightOf="@+id/tvADUpdate"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tvADVersion"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvPadVersion" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvADUpdate"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -175,14 +188,14 @@
|
||||
<TextView
|
||||
android:id="@+id/tvHDMapVersion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/tab_version_hdmap_info"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_32"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/tvADVersion"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvADVersion" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvADVersionName" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvHDMapUpdate"
|
||||
@@ -198,9 +211,9 @@
|
||||
<TextView
|
||||
android:id="@+id/tvADMapVersion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_45"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/tab_version_admap_info"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_32"
|
||||
@@ -212,12 +225,12 @@
|
||||
android:layout_width="@dimen/dp_152"
|
||||
android:layout_height="@dimen/dp_53"
|
||||
android:layout_marginStart="@dimen/dp_60"
|
||||
android:layout_marginTop="@dimen/dp_232"
|
||||
android:layout_marginTop="@dimen/dp_39"
|
||||
android:text="@string/tab_sn"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_38"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvVersionPos" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvADMapVersion" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSnInfo"
|
||||
|
||||
Reference in New Issue
Block a user