diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/feedback/biz/adapter/vh/BadCaseFBViewHolder.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/feedback/biz/adapter/vh/BadCaseFBViewHolder.kt index 66c4aa06cd..5a7acc13f0 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/feedback/biz/adapter/vh/BadCaseFBViewHolder.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/feedback/biz/adapter/vh/BadCaseFBViewHolder.kt @@ -10,10 +10,8 @@ import android.text.TextUtils import android.text.TextUtils.TruncateAt.END import android.util.StateSet import android.util.TypedValue -import android.view.Gravity -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup +import android.view.* +import android.view.inputmethod.EditorInfo import android.widget.EditText import android.widget.ImageView import android.widget.LinearLayout @@ -21,6 +19,7 @@ import android.widget.TextView import androidx.core.content.ContextCompat import com.google.android.flexbox.FlexboxLayout import com.mogo.eagle.core.utilcode.kotlin.* +import com.mogo.eagle.core.utilcode.util.KeyboardUtils import com.mogo.eagle.core.utilcode.util.ToastUtils import com.zhjt.mogo_core_function_devatools.R import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.entity.BadCaseResponse.Reason @@ -43,7 +42,7 @@ internal class BadCaseFBViewHolder(cb: IFeedbackCallback?, parent: ViewGroup): F itemView.findViewById(R.id.et) } - private val editParent by lazy { + private val etParent by lazy { itemView.findViewById(R.id.et_root) } @@ -60,15 +59,24 @@ internal class BadCaseFBViewHolder(cb: IFeedbackCallback?, parent: ViewGroup): F } } - editParent.also { + etParent.also { it.background = shape(solid = Color.parseColor("#263869"), radius = 20.PX) } val words = itemView.findViewById(R.id.words_count) + val action = Runnable { KeyboardUtils.showSoftInput(et) } + et.onDetach { + et.removeCallbacks(action) + } et.onClick { - it.requestFocus() - it.isFocusable = true - it.isFocusableInTouchMode = true - editParent.background = shape(solid = Color.parseColor("#263869"), radius = 20.PX, stroke = Color.parseColor("#5EBFFF"), strokeWidth = 2.PX) + it.post(action) + etParent.background = shape(solid = Color.parseColor("#263869"), radius = 20.PX, stroke = Color.parseColor("#5EBFFF"), strokeWidth = 2.PX) + } + et.setOnEditorActionListener { _, actionId, _ -> + if (actionId == EditorInfo.IME_ACTION_DONE) { + KeyboardUtils.hideSoftInput(et) + return@setOnEditorActionListener true + } + return@setOnEditorActionListener false } et.watch( 200, @@ -91,9 +99,9 @@ internal class BadCaseFBViewHolder(cb: IFeedbackCallback?, parent: ViewGroup): F if (!TextUtils.isEmpty(text)) { et.setText(text) Selection.setSelection(et.text, et.text.length) - editParent.background = shape(solid = Color.parseColor("#263869"), radius = 20.PX, stroke = Color.parseColor("#5EBFFF"), strokeWidth = 2.PX) + etParent.background = shape(solid = Color.parseColor("#263869"), radius = 20.PX, stroke = Color.parseColor("#5EBFFF"), strokeWidth = 2.PX) } else { - editParent.background = shape(solid = Color.parseColor("#263869"), radius = 20.PX) + etParent.background = shape(solid = Color.parseColor("#263869"), radius = 20.PX) } } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/res/layout/layout_fb_badcase.xml b/core/function-impl/mogo-core-function-devatools/src/main/res/layout/layout_fb_badcase.xml index 4ecd6f8bfa..c6d08768e7 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/res/layout/layout_fb_badcase.xml +++ b/core/function-impl/mogo-core-function-devatools/src/main/res/layout/layout_fb_badcase.xml @@ -86,6 +86,7 @@ android:inputType="textMultiLine" android:textSize="36px" android:textColorHint="#4CFFFFFF" + android:imeOptions="actionDone" android:hint="Case细节描述" android:textColor="#FFFFFF" /> diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index d2fec88cd1..aba1ba3798 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -1149,33 +1149,44 @@ class DebugSettingView @JvmOverloads constructor( * 工控机异常回调 */ override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) { - guardianInfo?.let { - reportMsgLayout.visibility = View.VISIBLE - tvReportSrc.text = it.src - tvReportLevel.text = it.level - tvReportMsg.text = it.msg - tvReportCode.text = it.code - tvReportResult.text = it.getResult(0) - tvReportActions.text = it.getActions(0) + ThreadUtils.runOnUiThread{ + guardianInfo?.let { + reportMsgLayout.visibility = View.VISIBLE + tvReportSrc.text = "src:${it.src}" + tvReportLevel.text = "level:${it.level}" + tvReportMsg.text = "msg:${it.msg}" + tvReportCode.text = "code:${it.code}" + var resultStr="result:" + for(result in it.resultList){ + resultStr = "$resultStr$result " + } + tvReportResult.text = resultStr - if("error".equals(it.level)){ - //字体为红色,吐司提示 - tvReportSrc.setTextColor(Color.RED) - tvReportLevel.setTextColor(Color.RED) - tvReportMsg.setTextColor(Color.RED) - tvReportCode.setTextColor(Color.RED) - tvReportResult.setTextColor(Color.RED) - tvReportActions.setTextColor(Color.RED) - ToastUtils.showShort(it.msg) - }else{ - tvReportSrc.setTextColor(Color.BLACK) - tvReportLevel.setTextColor(Color.BLACK) - tvReportMsg.setTextColor(Color.BLACK) - tvReportCode.setTextColor(Color.BLACK) - tvReportResult.setTextColor(Color.BLACK) - tvReportActions.setTextColor(Color.BLACK) + var actionStr="action:" + for(action in it.actionsList){ + actionStr = "$actionStr$action " + } + tvReportActions.text = actionStr + + + if("error".equals(it.level)){ + //字体为红色,吐司提示 + tvReportSrc.setTextColor(Color.RED) + tvReportLevel.setTextColor(Color.RED) + tvReportMsg.setTextColor(Color.RED) + tvReportCode.setTextColor(Color.RED) + tvReportResult.setTextColor(Color.RED) + tvReportActions.setTextColor(Color.RED) + ToastUtils.showShort(it.msg) + }else{ + tvReportSrc.setTextColor(Color.BLACK) + tvReportLevel.setTextColor(Color.BLACK) + tvReportMsg.setTextColor(Color.BLACK) + tvReportCode.setTextColor(Color.BLACK) + tvReportResult.setTextColor(Color.BLACK) + tvReportActions.setTextColor(Color.BLACK) + } } - } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_auto_pilot_check.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_auto_pilot_check.xml index a0314a6569..4d4bec61b1 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_auto_pilot_check.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_auto_pilot_check.xml @@ -9,10 +9,10 @@ + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent"> + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + app:layout_constraintTop_toBottomOf="@id/checkLayout" /> + app:layout_constraintTop_toBottomOf="@id/checkLayout" /> + app:layout_constraintTop_toBottomOf="@id/llSpeedPosition" /> + app:layout_constraintTop_toBottomOf="@id/llSpeedPosition" /> + app:layout_constraintTop_toBottomOf="@id/tvSystemOperation" /> + app:layout_constraintTop_toTopOf="@id/viewSystemVersion" /> + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/viewSystemVersion" /> ) : RecyclerView.On private fun computeIntercepted(x: Int, y: Int, rv: RecyclerView, ids: List): Boolean { return ids.takeIf { it.isNotEmpty() }?.find { val out = Rect() - rv.findViewById(it)?.getGlobalVisibleRect(out) - if (!out.isEmpty) { - out.contains(x, y) - } else { - false - } + val view = rv.findViewById(it) + view?.run { + getGlobalVisibleRect(out) + if (!out.isEmpty) { + out.contains(x, y) and (canScrollVertically(-1) || canScrollVertically(1)) + } else { + false + } + } ?: false }?.let { it != View.NO_ID } ?: false } @@ -273,8 +276,13 @@ private class GestureConflictFixer(private val ids: List) : RecyclerView.On scrollState = newState if (oldState == RecyclerView.SCROLL_STATE_IDLE && newState == RecyclerView.SCROLL_STATE_DRAGGING) { recyclerView.layoutManager?.let { - if (intercpted) { - recyclerView.stopScroll() + val canScrollHorizontally = it.canScrollHorizontally() + val canScrollVertically = it.canScrollVertically() + if (canScrollHorizontally != canScrollVertically) { + if (intercpted || (canScrollHorizontally && abs(dy) > abs(dx)) + || (canScrollVertically && abs(dx) > abs(dy))) { + recyclerView.stopScroll() + } } } }