[2.13.2-arch-opt] fix bug of limit
This commit is contained in:
@@ -94,7 +94,7 @@
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
android:id="@+id/viewLimitingVelocity"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:elevation="@dimen/dp_10"
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
android:id="@+id/viewLimitingVelocity"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:elevation="@dimen/dp_10"
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
android:id="@+id/viewLimitingVelocity"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:elevation="@dimen/dp_10"
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -12,6 +13,7 @@ import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import kotlinx.android.synthetic.main.view_limiting_speed_vr.view.*
|
||||
|
||||
/**
|
||||
@@ -37,15 +39,16 @@ class LimitingVelocityView constructor(
|
||||
}
|
||||
|
||||
override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
|
||||
if (limitingVelocity > 0) {
|
||||
this.visibility = View.VISIBLE
|
||||
tvLimitingVelocity.text = "$limitingVelocity"
|
||||
tvLimitingSource.visibility = View.VISIBLE
|
||||
tvLimitingSource.text = sourceType.name
|
||||
} else {
|
||||
this.visibility = View.GONE
|
||||
tvLimitingSource.visibility = View.GONE
|
||||
tvLimitingSource.text = ""
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (limitingVelocity > 0) {
|
||||
visibility = View.VISIBLE
|
||||
tvLimitingVelocity.text = "$limitingVelocity"
|
||||
Log.d("emArrow","limit : ${ DataSourceType.getName(sourceType)}")
|
||||
tvLimitingSource.text = DataSourceType.getName(sourceType)
|
||||
} else {
|
||||
visibility = View.GONE
|
||||
tvLimitingSource.text = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
android:id="@+id/tvLimitingSource"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:gravity="center"
|
||||
android:text=""
|
||||
android:text="123"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textStyle="bold"
|
||||
|
||||
@@ -1,11 +1,26 @@
|
||||
package com.mogo.eagle.core.data.enums
|
||||
|
||||
|
||||
|
||||
enum class DataSourceType(name: String) {
|
||||
DEFAULT("defalut"),
|
||||
OBU("OBU"),
|
||||
MAP("MAP"),
|
||||
TELEMATIC("TELEMATIC"),
|
||||
AICLOUD("AI云"),
|
||||
SUMMARY("汇总")// V2X事件汇总
|
||||
SUMMARY("汇总");// V2X事件汇总
|
||||
|
||||
|
||||
companion object{
|
||||
fun getName(type :DataSourceType):String{
|
||||
return when(type){
|
||||
OBU -> "OBU"
|
||||
MAP -> "MAP"
|
||||
TELEMATIC -> "TELEMATIC"
|
||||
AICLOUD -> "AI云"
|
||||
SUMMARY -> "汇总"
|
||||
else -> "defalut"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user