[2.13.0-arch-opt] fix bug of limit speed and move view

This commit is contained in:
zhongchao
2023-01-31 15:26:32 +08:00
parent e01716f30a
commit d3f0ac654b
16 changed files with 136 additions and 240 deletions

View File

@@ -26,16 +26,6 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<!--Vip车辆标志-->
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
android:layout_width="@dimen/module_vip_width"
android:layout_height="@dimen/module_vip_height"
android:visibility="gone"
android:layout_marginStart="@dimen/dp_640"
android:layout_marginTop="@dimen/dp_80"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
android:layout_width="wrap_content"
@@ -45,15 +35,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!--APP、MAP版本-->
<com.mogo.eagle.core.function.hmi.ui.widget.VersionNameView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="45dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout
android:id="@+id/arrive_station_shadow"
android:layout_width="wrap_content"

View File

@@ -1,17 +1,17 @@
package com.mogo.och.bus.passenger;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
//package com.mogo.och.bus.passenger;
//
//import org.junit.Test;
//
//import static org.junit.Assert.*;
//
///**
// * Example local unit test, which will execute on the development machine (host).
// *
// * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
// */
//public class ExampleUnitTest {
// @Test
// public void addition_isCorrect() {
// assertEquals(4, 2 + 2);
// }
//}

View File

@@ -56,11 +56,27 @@
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginTop="45dp"
android:layout_marginEnd="40dp"
app:layout_constraintRight_toLeftOf="@id/viewTrafficLightVr"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="SpeakableTextPresentCheck"
tools:visibility="visible" />
<!--限速牌子-->
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginTop="30dp"
android:layout_marginEnd="40dp"
android:elevation="@dimen/dp_10"
android:gravity="center"
android:text="60"
android:textColor="#FFFFFF"
android:textSize="60dp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
tools:visibility="visible"/>
<!--红绿灯-->
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
android:id="@+id/viewTrafficLightVr"
@@ -89,7 +105,8 @@
android:layout_marginStart="40dp"
android:layout_marginBottom="200dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintStart_toStartOf="parent"
tools:ignore="SpeakableTextPresentCheck" />
<RelativeLayout
android:id="@+id/module_mogo_och_autopilot_status"
@@ -309,6 +326,7 @@
android:textSize="@dimen/dp_60"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotRunning" />
<Button
android:id="@+id/btnAutopilotRoute"
android:layout_width="wrap_content"
@@ -317,7 +335,8 @@
android:text="上传全路径"
android:textSize="@dimen/dp_60"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotArrive" />
app:layout_constraintTop_toBottomOf="@id/btnAutopilotArrive"
tools:ignore="TextContrastCheck" />
<androidx.constraintlayout.widget.Group
android:id="@+id/groupTestPanel"

View File

@@ -30,32 +30,19 @@ class OchNoopFragment : MvpFragment<OchNoopContract.View?, OchNoopPresenter?>(),
true
}
cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
viewDriverMsgBoxList.visibility = View.VISIBLE
viewDriverMsgBoxList.notifyData()
viewDriverMsgBoxBubble.visibility = View.GONE
viewDriverMsgBoxBubble.isShowData(false)
MsgBoxTipView.visibility = View.GONE
} else {
viewDriverMsgBoxList.visibility = View.GONE
viewDriverMsgBoxBubble.visibility = View.VISIBLE
viewDriverMsgBoxBubble.isShowData(true)
}
}
cbMsgBoxPassenger.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
viewPassengerMsgBoxList.visibility = View.VISIBLE
viewPassengerMsgBoxBubble.visibility = View.GONE
viewPassengerMsgBoxBubble.isShowData(false)
MsgBoxTipView.visibility = View.GONE
} else {
viewPassengerMsgBoxList.visibility = View.GONE
viewPassengerMsgBoxBubble.visibility = View.VISIBLE
viewPassengerMsgBoxBubble.isShowData(true)
}
}
// cbMsgBoxDriver.setOnCheckedChangeListener { _, isChecked ->
// if (isChecked) {
// viewDriverMsgBoxList.visibility = View.VISIBLE
// viewDriverMsgBoxList.notifyData()
// viewDriverMsgBoxBubble.visibility = View.GONE
// viewDriverMsgBoxBubble.isShowData(false)
// MsgBoxTipView.visibility = View.GONE
// } else {
// viewDriverMsgBoxList.visibility = View.GONE
// viewDriverMsgBoxBubble.visibility = View.VISIBLE
// viewDriverMsgBoxBubble.isShowData(true)
// }
// }
}

View File

@@ -80,6 +80,23 @@
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
<!--限速牌子-->
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
android:id="@+id/viewLimitingVelocity"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginTop="30dp"
android:layout_marginEnd="40dp"
android:elevation="@dimen/dp_10"
android:gravity="center"
android:text="60"
android:textColor="#FFFFFF"
android:textSize="60dp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
tools:visibility="visible"/>
<!--红绿灯-->
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
android:id="@+id/viewTrafficLightVr"
@@ -122,7 +139,8 @@
android:elevation="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/viewPerspectiveSwitch"
app:layout_goneMarginStart="50dp" />
app:layout_goneMarginStart="50dp"
android:contentDescription="工具箱"/>
<!--问题反馈-->
<ImageView
@@ -133,7 +151,8 @@
android:layout_marginBottom="40dp"
android:src="@drawable/bad_case_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/ivToolsView" />
app:layout_constraintStart_toEndOf="@id/ivToolsView"
android:contentDescription="BadCase"/>
<ImageView
android:id="@+id/ivAiCollectTools"
@@ -143,7 +162,8 @@
android:layout_marginBottom="40dp"
android:src="@drawable/ai_collect_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/ivBadCaseTools" />
app:layout_constraintStart_toEndOf="@id/ivBadCaseTools"
android:contentDescription="数据采集" />
<View
android:id="@+id/viewUpgradeTips"
@@ -157,22 +177,6 @@
app:layout_constraintCircleRadius="60dp"
tools:ignore="MissingConstraints" />
<!--限速牌子-->
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
android:id="@+id/viewLimitingVelocity"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginTop="30dp"
android:layout_marginEnd="40dp"
android:elevation="@dimen/dp_10"
android:gravity="center"
android:text="60"
android:textColor="#FFFFFF"
android:textSize="60dp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />
<!--消息盒子司机端选择入口-->
<CheckBox
android:id="@+id/cbMsgBoxDriver"
@@ -199,32 +203,6 @@
app:layout_constraintCircleRadius="32dp"
tools:ignore="MissingConstraints" />
<!--消息盒子乘客端选择入口-->
<CheckBox
android:id="@+id/cbMsgBoxPassenger"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginStart="320dp"
android:layout_marginBottom="50dp"
android:background="@drawable/selector_msg_box_p"
android:button="@null"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<!--乘客端消息提示-->
<View
android:id="@+id/MsgBoxPTipView"
android:layout_width="15dp"
android:layout_height="15dp"
android:background="@drawable/version_upgrade_tips_background"
android:translationZ="30dp"
android:visibility="gone"
app:layout_constraintCircle="@id/cbMsgBoxPassenger"
app:layout_constraintCircleAngle="40"
app:layout_constraintCircleRadius="50dp"
tools:ignore="MissingConstraints" />
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
android:id="@+id/viewDriverMsgBoxList"
android:layout_width="864px"
@@ -232,36 +210,17 @@
android:layout_marginEnd="40dp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver" />
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
tools:visibility="gone"/>
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
android:id="@+id/viewDriverMsgBoxBubble"
android:layout_width="864px"
android:layout_height="wrap_content"
android:layout_marginEnd="40dp"
android:visibility="visible"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver" />
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView
android:id="@+id/viewPassengerMsgBoxBubble"
android:layout_width="650px"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger" />
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxListView
android:id="@+id/viewPassengerMsgBoxList"
android:layout_width="650px"
android:layout_height="750px"
android:layout_marginBottom="20dp"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger" />
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
tools:visibility="gone" />
<!--左右转向灯-->
<com.mogo.eagle.core.function.hmi.ui.turnlight.TurnLightViewStatus

View File

@@ -71,8 +71,6 @@ public class SweeperTrafficDataView extends ConstraintLayout
CallerChassisLamplightListenerManager.INSTANCE.addListener(TAG, this);
CallerChassisSteeringStateListenerManager.INSTANCE.addListener(TAG, this);
CallerChassisGearStateListenerManager.INSTANCE.addListener(TAG, this);
//增加限速监听
CallerLimitingVelocityListenerManager.INSTANCE.addListener(TAG,limitingVelocityListener);
}
@Override
@@ -82,7 +80,6 @@ public class SweeperTrafficDataView extends ConstraintLayout
CallerChassisLamplightListenerManager.INSTANCE.removeListener(TAG);
CallerChassisSteeringStateListenerManager.INSTANCE.removeListener(TAG);
CallerChassisGearStateListenerManager.INSTANCE.removeListener(TAG);
CallerLimitingVelocityListenerManager.INSTANCE.removeListener(limitingVelocityListener);
}
/**
@@ -140,17 +137,6 @@ public class SweeperTrafficDataView extends ConstraintLayout
});
}
/**
* 限速监听
*/
private final ILimitingVelocityListener limitingVelocityListener = new ILimitingVelocityListener(){
@Override
public void onLimitingVelocityChange(int limitingVelocity, DataSourceType sourceType) {
//设置限速 TODO @钟超
//sweeperLimitingVelocity.updateLimitingSpeed(limitingVelocity, 0);
}
};
/**
* 速度设置
*/

View File

@@ -24,6 +24,7 @@ import com.mogo.commons.module.status.StatusDescriptor;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.enums.DataSourceType;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
@@ -674,7 +675,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
private final ILimitingVelocityListener limitingVelocityListener = new ILimitingVelocityListener(){
@Override
public void onLimitingVelocityChange(int limitingVelocity) {
public void onLimitingVelocityChange(int limitingVelocity, DataSourceType dataSourceType) {
if (mVeloctityCallback != null){
mVeloctityCallback.onLimitingVelocityChange(limitingVelocity);
}

View File

@@ -28,16 +28,6 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--Vip车辆标志-->
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
android:layout_width="@dimen/module_vip_width"
android:layout_height="@dimen/module_vip_height"
android:visibility="gone"
android:layout_marginStart="@dimen/dp_640"
android:layout_marginTop="@dimen/dp_80"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
android:layout_width="wrap_content"
@@ -47,15 +37,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!--APP、MAP版本-->
<com.mogo.eagle.core.function.hmi.ui.widget.VersionNameView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="45dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<ImageView
android:id="@+id/module_och_taxi_swich_map_iv"
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"

View File

@@ -119,6 +119,22 @@
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
<!--限速牌子-->
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginTop="30dp"
android:layout_marginEnd="40dp"
android:elevation="@dimen/dp_10"
android:gravity="center"
android:text="60"
android:textColor="#FFFFFF"
android:textSize="60dp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
tools:visibility="visible"/>
<!--红绿灯-->
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
android:id="@+id/viewTrafficLightVr"

View File

@@ -45,7 +45,7 @@ class DriverMsgBoxListView @JvmOverloads constructor(
private var driverMsgBoxListAdapter: DriverMsgBoxListAdapter ?=null
private fun initView() {
driverMsgBoxListAdapter= DriverMsgBoxListAdapter(context as Activity)
driverMsgBoxListAdapter= DriverMsgBoxListAdapter(context)
rvMsgBoxList.adapter = driverMsgBoxListAdapter
rvMsgBoxList.layoutManager = LinearLayoutManager(context)

View File

@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.msgbox.adapter
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@@ -27,7 +28,7 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
* @description 司机端消息盒子列表视图RecyclerView适配器
* @since: 2022/11/25
*/
class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Adapter<RecyclerView.ViewHolder>(){
class DriverMsgBoxListAdapter(private val context: Context) : RecyclerView.Adapter<RecyclerView.ViewHolder>(){
private var data: List<MsgBoxBean> ?= null
@@ -39,10 +40,13 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
private val record: Int = 6
private val traffic: Int = 7
//Error
val RESULT_AUTOPILOT_DISABLE = "RESULT_AUTOPILOT_DISABLE"
val RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED"
val RESULT_REMOTEPILOT_DISABLE = "RESULT_REMOTEPILOT_DISABLE"
companion object{
//Error
private const val RESULT_AUTOPILOT_DISABLE = "RESULT_AUTOPILOT_DISABLE"
private const val RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED"
private const val RESULT_REMOTEPILOT_DISABLE = "RESULT_REMOTEPILOT_DISABLE"
}
fun setData(data: List<MsgBoxBean>){
this.data = data
@@ -77,7 +81,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
val msgBoxBean = it[position]
holder.tvRecordCheck.setOnClickListener {
//打开被动录包弹窗
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,activity,false)
CallerDevaToolsManager.onReceiveBadCaseRecord(msgBoxBean,context as Activity,false)
}
}
}else if(holder is MsgBoxIpcReportHolder){
@@ -180,7 +184,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
val noticeNormalData = noticeFrCloudMsg.noticeNormalData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeNormalData?.content
GlideApp.with(activity).load(noticeNormalData?.imageUrl).optionalTransform(
GlideApp.with(context).load(noticeNormalData?.imageUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
@@ -194,7 +198,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
val noticeTrafficStylePushData = noticeFrCloudMsg.trafficPushData
holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvNoticeContent.text = noticeTrafficStylePushData?.content
GlideApp.with(activity).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideApp.with(context).load(noticeTrafficStylePushData?.poiImgUrl).optionalTransform(
GlideRoundedCornersTransform(
20f,
GlideRoundedCornersTransform.CornerType.ALL
@@ -214,10 +218,10 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
holder.tvV2XTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
holder.tvV2XContent.text = v2XMsg.content
if(msgBoxBean.type == MsgBoxType.OBU){
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
holder.ivV2XImage.setImageDrawable(context.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}else{
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
holder.ivV2XImage.setImageDrawable(context.resources.getDrawable(
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}
}

View File

@@ -10,23 +10,21 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
class DemoModeHiddenSwitch(context: Context?, attrs: AttributeSet?) : View(context, attrs) {
class DemoModeHiddenSwitch(context: Context, attrs: AttributeSet?) : View(context, attrs) {
override fun onAttachedToWindow() {
super.onAttachedToWindow()
init {
isClickable = true
setOnClickListener {
//只在司机端设置美化模式开关功能
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
//单次查询,是否有行程信息(订单进行中时点击不生效),autopilotControlParameters为null代表不处于自动驾驶状态下
if (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().autopilotControlParameters == null) {
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
context?.let {
CallerHmiManager.updateStatusBarLeftView(
FunctionBuildConfig.isDemoMode,
"demoMode",
DemoModeView(it)
)
}
CallerHmiManager.updateStatusBarLeftView(
FunctionBuildConfig.isDemoMode,
"demoMode",
DemoModeView(context)
)
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
if (!FunctionBuildConfig.isDemoMode) {
//关闭美化模式时,通知工控机

View File

@@ -4,7 +4,7 @@ import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.LinearLayout
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.LimitingVelocityView_TAG
@@ -17,11 +17,10 @@ import kotlinx.android.synthetic.main.view_limiting_speed_vr.view.*
/**
* 限速控件
*/
class LimitingVelocityView @JvmOverloads constructor(
class LimitingVelocityView constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr), ILimitingVelocityListener, IViewControlListener {
) : ConstraintLayout(context, attrs), ILimitingVelocityListener, IViewControlListener {
companion object {
private const val TAG = "LimitingVelocityView"
@@ -39,21 +38,18 @@ class LimitingVelocityView @JvmOverloads constructor(
override fun onLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
if (limitingVelocity > 0) {
tvLimitingVelocity.visibility = View.VISIBLE
tvLimitingSource.visibility = View.VISIBLE
this.visibility = View.VISIBLE
tvLimitingVelocity.text = "$limitingVelocity"
tvLimitingSource.text = sourceType.name
} else {
tvLimitingVelocity.visibility = View.GONE
tvLimitingSource.visibility = View.GONE
this.visibility = View.GONE
tvLimitingSource.text = ""
}
}
override fun visible(v: Int) {
super.visible(v)
tvLimitingVelocity.visibility = v
tvLimitingSource.visibility = v
this.visibility = v
}
override fun onDetachedFromWindow() {

View File

@@ -52,7 +52,7 @@ class VersionNameView @JvmOverloads constructor(
@SuppressLint("SetTextI18n")
private fun showCurrentPadVersion() {
tvAppVersionName?.let {
it.text = "APP:${AppUtils.getAppVersionName()}"
// it.text = "APP:${AppUtils.getAppVersionName()}"
}
}

View File

@@ -21,43 +21,6 @@
android:layout_height="match_parent"
android:paddingTop="72dp">
<!--限速牌子-->
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
android:id="@+id/viewLimitingVelocity"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginTop="30dp"
android:layout_marginEnd="40dp"
android:background="@drawable/bg_waring_limiting_velocity"
android:elevation="@dimen/dp_10"
android:gravity="center"
android:text="60"
android:textColor="#FFFFFF"
android:textSize="60dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_goneMarginEnd="40dp"
app:layout_goneMarginTop="40dp"
tools:visibility="gone" />
<!-- todo 需要放入使用方 -->
<!-- app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"-->
<!--限速来源-->
<TextView
android:id="@+id/tvLimitingSource"
android:layout_width="120dp"
android:layout_height="35dp"
android:gravity="center"
android:text=""
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/dp_30"
android:textStyle="bold"
android:layout_marginEnd="40dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity" />
<!--消息盒子司机端选择入口-->
<CheckBox
android:id="@+id/cbMsgBoxDriver"
@@ -68,9 +31,10 @@
android:background="@drawable/selector_msg_box"
android:button="@null"
android:visibility="gone"
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
app:layout_constraintRight_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<!-- todo 需要放入使用方 , view先gone掉方便重组 -->
<!-- app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"-->
<!-- app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />-->
<!--司机端消息提示-->

View File

@@ -1,14 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical">
<TextView
android:id="@+id/tvLimitingVelocity"
android:layout_width="120dp"
android:layout_height="120dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:background="@drawable/bg_waring_limiting_velocity"
android:elevation="@dimen/dp_10"
android:gravity="center"
@@ -27,6 +29,8 @@
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/dp_30"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvLimitingVelocity"
android:visibility="gone" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>