Merge branch 'refs/heads/dev_robotaxi-d_240912_6.7.0' into dev_robotaxi-d_240912_6.7.2_local

# Conflicts:
#	OCH/shuttle/passenger/src/main/java/jinlv/com/mogo/och/shuttle/passenger/model/BusPassengerModel.java
#	OCH/shuttle/passenger/src/main/java/m2/com/mogo/och/shuttle/passenger/model/PM2DrivingModel.kt
This commit is contained in:
yangyakun
2024-10-23 18:07:24 +08:00
14 changed files with 238 additions and 112 deletions

View File

@@ -7,6 +7,7 @@ import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.commons.env.ProjectUtils
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.deva.report.ReportEntity
import com.mogo.eagle.core.data.enums.DataSourceType
@@ -114,12 +115,15 @@ class DriverMsgBoxBubbleView @JvmOverloads constructor(
if (isShowData) {
if (category == MsgCategory.RECORD_BAG) {
if (!FunctionBuildConfig.isDemoMode && FunctionBuildConfig.isShowBagRecordWindow) {
//弹出被动录包弹窗
CallerDevaToolsManager.onReceiveBadCaseRecord(
msgBoxBean,
context as Activity,
true
)
//660开始saas环境下原有的接管录包弹窗不弹了其他环境下还弹
if(!ProjectUtils.isSaas()){
//弹出被动录包弹窗
CallerDevaToolsManager.onReceiveBadCaseRecord(
msgBoxBean,
context as Activity,
true
)
}
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
}
} else if (category == MsgCategory.SYS_INFO) {

View File

@@ -7,6 +7,7 @@ import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.commons.env.ProjectUtils
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.deva.report.ReportEntity
import com.mogo.eagle.core.data.enums.DataSourceType
@@ -102,12 +103,15 @@ class MsgBoxToastView @JvmOverloads constructor(
if (isShowData) {
if (category == MsgCategory.RECORD_BAG) {
if (!FunctionBuildConfig.isDemoMode && FunctionBuildConfig.isShowBagRecordWindow) {
//弹出被动录包弹窗
CallerDevaToolsManager.onReceiveBadCaseRecord(
msgBoxBean,
context as Activity,
true
)
//660开始saas环境下原有的接管录包弹窗不弹了其他环境下还弹
if(!ProjectUtils.isSaas()){
//弹出被动录包弹窗
CallerDevaToolsManager.onReceiveBadCaseRecord(
msgBoxBean,
context as Activity,
true
)
}
CallerMsgBoxEventListenerManager.invokeUpdateTipListener(true)
}
} else if (category == MsgCategory.SYS_INFO) {

View File

@@ -2,23 +2,18 @@ package com.mogo.eagle.core.function.hmi.ui.operate.preferences
import android.annotation.SuppressLint
import android.content.Context
import android.text.Editable
import android.util.AttributeSet
import android.widget.EditText
import android.widget.TextView
import androidx.core.widget.doAfterTextChanged
import androidx.core.widget.doBeforeTextChanged
import androidx.core.widget.doOnTextChanged
import androidx.preference.Preference
import androidx.preference.PreferenceViewHolder
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.kotlin.onClickWidthDuration
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.util.ToastUtils
import java.math.BigDecimal
import java.util.concurrent.ConcurrentHashMap
import kotlin.math.max
class PreferenceWithSpeedSetting : Preference {
@@ -74,7 +69,7 @@ class PreferenceWithSpeedSetting : Preference {
if (cache.containsKey(key)) {
cur = cache[key] ?: cur
}
cur = BigDecimal.valueOf(cur).setScale(1).toDouble()
cur = cur.safeScale()
if (speedLimit is EditText) {
speedLimit.setText(cur.toString())
speedLimit.doAfterTextChanged { text ->
@@ -89,14 +84,13 @@ class PreferenceWithSpeedSetting : Preference {
btnOk.isEnabled = false
holder.itemView.isEnabled = false
ll.isSelected = false
ToastUtils.showShort("阈值最大为${BigDecimal.valueOf(max).setScale(1)}$unit")
ToastUtils.showShort("阈值最大为${max.safeScale()}$unit")
return@doAfterTextChanged
}
val temp = BigDecimal.valueOf(current).setScale(1).toDouble()
val temp = current.safeScale()
if (cur == temp) {
return@doAfterTextChanged
}
Logger.d("RWJ", "--- cache ---- 2 ---: $cur, $temp")
cur = temp
btnOk.isEnabled = true
ll.isSelected = true
@@ -115,7 +109,7 @@ class PreferenceWithSpeedSetting : Preference {
minus.onClickWidthDuration(100) {
val minusAfter = cur - step
if (minusAfter < min) {
ToastUtils.showShort("阈值最小为${BigDecimal.valueOf(min).setScale(1)}$unit")
ToastUtils.showShort("阈值最小为${min.safeScale()}$unit")
return@onClickWidthDuration
}
cur = minusAfter
@@ -135,7 +129,7 @@ class PreferenceWithSpeedSetting : Preference {
add.onClickWidthDuration(100) {
val addAfter = cur + step
if (addAfter > max) {
ToastUtils.showShort("阈值最大为${BigDecimal.valueOf(max).setScale(1)}$unit")
ToastUtils.showShort("阈值最大为${max.safeScale()}$unit")
return@onClickWidthDuration
}
holder.itemView.isEnabled = false
@@ -159,4 +153,8 @@ class PreferenceWithSpeedSetting : Preference {
}
}
}
private fun Double.safeScale(s: Int = 1): Double {
return runCatching { BigDecimal.valueOf(this).setScale(s).toDouble() }.getOrNull() ?: this
}
}

View File

@@ -39,21 +39,30 @@ class VisualAngleToggleView : FrameLayout, IMoGoVisualAngleChangeProvider.OnMoGo
val defaultSlop = AutoSizeUtils.dp2px(context, 12.0f)
val scrollSlop = max(context.let { ViewConfiguration.get(it).scaledTouchSlop }, defaultSlop)
val gestureDetector = GestureDetector(context, object : GestureDetector.SimpleOnGestureListener() {
private var flag = false
override fun onDown(e: MotionEvent): Boolean {
flag = false
return true
}
override fun onScroll(e1: MotionEvent, e2: MotionEvent, distanceX: Float, distanceY: Float): Boolean {
if (flag) {
return super.onScroll(e1, e2, distanceX, distanceY)
}
val absX = abs(e2.x - e1.x)
val absY = abs(e2.y - e1.y)
if (absY <= absX) {
return false
}
if (e2.y - e1.y >= scrollSlop) {
flag = true
moveToBottom()
return true
}
if (e1.y - e2.y >= scrollSlop) {
flag = true
moveToTop()
return true
}