diff --git a/OCH/common/common/src/main/res/layout/taxi_seekbar_visualangle.xml b/OCH/common/common/src/main/res/layout/taxi_seekbar_visualangle.xml index 456da864d2..de3b7368ad 100644 --- a/OCH/common/common/src/main/res/layout/taxi_seekbar_visualangle.xml +++ b/OCH/common/common/src/main/res/layout/taxi_seekbar_visualangle.xml @@ -2,8 +2,8 @@ - - + + + + diff --git a/core/function-impl/mogo-core-function-devatools/src/main/res/layout/layout_status_bar_over_item.xml b/core/function-impl/mogo-core-function-devatools/src/main/res/layout/layout_status_bar_over_item.xml index 7faa8a0dfa..08b00f9d2f 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/res/layout/layout_status_bar_over_item.xml +++ b/core/function-impl/mogo-core-function-devatools/src/main/res/layout/layout_status_bar_over_item.xml @@ -1,5 +1,5 @@ \ No newline at end of file + android:layout_width="@dimen/dp_51_5" + android:layout_height="@dimen/dp_40_5" /> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/mofang/MoFangStatusView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/mofang/MoFangStatusView.kt index 3cda1fea21..2114c61714 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/mofang/MoFangStatusView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/mofang/MoFangStatusView.kt @@ -12,24 +12,17 @@ import com.mogo.eagle.core.function.api.devatools.mofang.IMoGoMoFangProvider.OnM import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.utilcode.kotlin.scope import com.mogo.eagle.core.utilcode.util.ToastUtils -import com.mogo.eagle.core.utilcode.util.UiThreadHandler -import kotlinx.android.synthetic.main.layout_mofang_status.view.tv_icon_1 -import kotlinx.android.synthetic.main.layout_mofang_status.view.tv_icon_2 -import kotlinx.android.synthetic.main.layout_mofang_status.view.tv_icon_3 -import kotlinx.android.synthetic.main.layout_mofang_status.view.tv_icon_4 -import kotlinx.android.synthetic.main.layout_mofang_status.view.tv_icon_5 -import kotlinx.android.synthetic.main.layout_mofang_status.view.v_lp_1 -import kotlinx.android.synthetic.main.layout_mofang_status.view.v_lp_2 -import kotlinx.android.synthetic.main.layout_mofang_status.view.v_lp_3 -import kotlinx.android.synthetic.main.layout_mofang_status.view.v_lp_4 -import kotlinx.android.synthetic.main.layout_mofang_status.view.v_lp_5 -import kotlinx.android.synthetic.main.layout_mofang_status.view.v_sp_1 -import kotlinx.android.synthetic.main.layout_mofang_status.view.v_sp_2 -import kotlinx.android.synthetic.main.layout_mofang_status.view.v_sp_3 -import kotlinx.android.synthetic.main.layout_mofang_status.view.v_sp_4 -import kotlinx.android.synthetic.main.layout_mofang_status.view.v_sp_5 -import me.jessyan.autosize.utils.AutoSizeUtils +import kotlinx.android.synthetic.main.layout_mofang_status.view.iv_key_1 +import kotlinx.android.synthetic.main.layout_mofang_status.view.iv_key_2 +import kotlinx.android.synthetic.main.layout_mofang_status.view.iv_key_3 +import kotlinx.android.synthetic.main.layout_mofang_status.view.iv_key_4 +import kotlinx.android.synthetic.main.layout_mofang_status.view.iv_key_5 +import kotlinx.coroutines.Job +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch +import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.atomic.AtomicInteger /** @@ -43,6 +36,8 @@ class MoFangStatusView : LinearLayout, OnMoFangStatusListener, IMoGoAutopilotSta private val autoPilotState by lazy { AtomicInteger(CallerAutoPilotStatusListenerManager.getState()) } + private val pendingJobs by lazy { ConcurrentHashMap() } + constructor(context: Context) : super(context) constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) @@ -50,10 +45,7 @@ class MoFangStatusView : LinearLayout, OnMoFangStatusListener, IMoGoAutopilotSta init { View.inflate(context, R.layout.layout_mofang_status, this) orientation = VERTICAL - background = ContextCompat.getDrawable(context, R.drawable.bg_mf_status) - val lr = AutoSizeUtils.dp2px(context, 30f) - val tb = AutoSizeUtils.dp2px(context, 33f) - setPadding(lr, tb, lr, tb) + background = ContextCompat.getDrawable(context, R.drawable.icon_mofang_status_bg) } override fun onAttachedToWindow() { @@ -82,7 +74,7 @@ class MoFangStatusView : LinearLayout, OnMoFangStatusListener, IMoGoAutopilotSta if (last != state) { if (last == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) { Log.d(TAG, "自驾改成非自驾,重置状态") - UiThreadHandler.post { + scope.launch { reset() } } @@ -103,71 +95,70 @@ class MoFangStatusView : LinearLayout, OnMoFangStatusListener, IMoGoAutopilotSta return } if (keyCode == KeyEvent.KEYCODE_A) { - if (tv_icon_2?.tag != 2 && tv_icon_2?.isSelected == true) { - tv_icon_2?.isSelected = false - v_lp_2?.visibility = View.VISIBLE - v_lp_2?.isSelected = false - v_sp_2?.visibility = View.INVISIBLE + if (iv_key_2?.tag != "0") { + iv_key_2?.tag = "0" + iv_key_2?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_default)) + } + if (iv_key_1?.tag == "0") { + iv_key_1?.tag = "1" + iv_key_1?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_clicked)) } - tv_icon_1?.isSelected = true - v_lp_1?.visibility = View.INVISIBLE - v_sp_1?.visibility = View.VISIBLE } if (keyCode == KeyEvent.KEYCODE_B) { - if (tv_icon_1?.isSelected == true) { - tv_icon_1?.isSelected = false - v_lp_1?.visibility = View.VISIBLE - v_lp_1?.isSelected = false - v_sp_1?.visibility = View.INVISIBLE + if (iv_key_1?.tag != "0") { + iv_key_1?.tag = "0" + iv_key_1?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_default)) + } + if (iv_key_2?.tag == "0") { + iv_key_2?.tag = "1" + iv_key_2?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_clicked)) + pendingJobs[keyCode]?.cancel() + scope.launch { + delay(1000) + iv_key_2?.tag = "0" + iv_key_2?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_default)) + }.also { pendingJobs[keyCode] = it } } - tv_icon_2?.isSelected = true - tv_icon_2?.tag = 1 - v_lp_2?.visibility = View.INVISIBLE - v_sp_2?.visibility = View.VISIBLE - UiThreadHandler.postDelayed({ - tv_icon_2?.tag = null - tv_icon_2?.isSelected = false - v_lp_2?.visibility = View.VISIBLE - v_lp_2?.isSelected = false - v_sp_2?.visibility = View.INVISIBLE - }, 1000) } if (keyCode == KeyEvent.KEYCODE_C) { - tv_icon_3?.isSelected = true - v_lp_3?.visibility = View.INVISIBLE - v_sp_3?.visibility = View.VISIBLE - UiThreadHandler.postDelayed({ - tv_icon_3?.isSelected = false - v_lp_3?.visibility = View.VISIBLE - v_lp_3?.isSelected = false - v_sp_3?.visibility = View.INVISIBLE - }, 1000) + if (iv_key_3?.tag == "0") { + iv_key_3?.tag = "1" + iv_key_3?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_clicked)) + pendingJobs[keyCode]?.cancel() + scope.launch { + delay(1000) + iv_key_3?.tag = "0" + iv_key_3?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_default)) + }.also { pendingJobs[keyCode] = it } + } } if (keyCode == KeyEvent.KEYCODE_D) { - tv_icon_4?.isSelected = true - v_lp_4?.visibility = View.INVISIBLE - v_sp_4?.visibility = View.VISIBLE - UiThreadHandler.postDelayed({ - tv_icon_4?.isSelected = false - v_lp_4?.visibility = View.VISIBLE - v_lp_4?.isSelected = false - v_sp_4?.visibility = View.INVISIBLE - }, 1000) + if (iv_key_4?.tag == "0") { + iv_key_4?.tag = "1" + iv_key_4?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_clicked)) + pendingJobs[keyCode]?.cancel() + scope.launch { + delay(1000) + iv_key_4?.tag = "0" + iv_key_4?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_default)) + }.also { pendingJobs[keyCode] = it } + } } if (keyCode == KeyEvent.KEYCODE_E) { - tv_icon_5?.isSelected = true - v_lp_5?.visibility = View.INVISIBLE - v_sp_5?.visibility = View.VISIBLE - UiThreadHandler.postDelayed({ - tv_icon_5?.isSelected = false - v_lp_5?.visibility = View.VISIBLE - v_lp_5?.isSelected = false - v_sp_5?.visibility = View.INVISIBLE - }, 1000) + if (iv_key_5?.tag == "0") { + iv_key_5?.tag = "1" + iv_key_5?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_clicked)) + pendingJobs[keyCode]?.cancel() + scope.launch { + delay(1000) + iv_key_5?.tag = "0" + iv_key_5?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_default)) + }.also { pendingJobs[keyCode] = it } + } } } @@ -182,44 +173,41 @@ class MoFangStatusView : LinearLayout, OnMoFangStatusListener, IMoGoAutopilotSta return } if (keyCode == KeyEvent.KEYCODE_A) { - if (tv_icon_2?.tag != 2 && tv_icon_2?.isSelected == true) { - tv_icon_2?.isSelected = false - v_lp_2?.visibility = View.VISIBLE - v_lp_2?.isSelected = false - v_sp_2?.visibility = View.INVISIBLE + if (iv_key_2?.tag != "0") { + iv_key_2?.tag = "0" + pendingJobs[KeyEvent.KEYCODE_B]?.cancel() + iv_key_2?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_default)) + } + if (iv_key_1?.tag != "2") { + iv_key_1?.tag = "2" + iv_key_1?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_long_clicked)) } - tv_icon_1?.isSelected = true - v_lp_1?.visibility = View.VISIBLE - v_lp_1?.isSelected = true - v_sp_1?.visibility = View.INVISIBLE } if (keyCode == KeyEvent.KEYCODE_B) { - tv_icon_2?.isSelected = true - tv_icon_2?.tag = 2 - v_lp_2?.visibility = View.VISIBLE - v_lp_2?.isSelected = true - v_sp_2?.visibility = View.INVISIBLE - UiThreadHandler.postDelayed({ - tv_icon_2?.tag = null - tv_icon_2?.isSelected = false - v_lp_2?.visibility = View.VISIBLE - v_lp_2?.isSelected = false - v_sp_2?.visibility = View.INVISIBLE - }, 1000) + if (iv_key_2?.tag != "2") { + iv_key_2?.tag = "2" + iv_key_2?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_long_clicked)) + pendingJobs[keyCode]?.cancel() + scope.launch { + delay(1000) + iv_key_2?.tag = "0" + iv_key_2?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_default)) + } + } } if (keyCode == KeyEvent.KEYCODE_E) { - tv_icon_5?.isSelected = true - v_lp_5?.visibility = View.VISIBLE - v_lp_5?.isSelected = true - v_sp_5?.visibility = View.INVISIBLE - UiThreadHandler.postDelayed({ - tv_icon_5?.isSelected = false - v_lp_5?.visibility = View.VISIBLE - v_lp_5?.isSelected = false - v_sp_5?.visibility = View.INVISIBLE - }, 1000) + if (iv_key_5?.tag != "2") { + iv_key_5?.tag = "2" + iv_key_5?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_long_clicked)) + pendingJobs[keyCode]?.cancel() + scope.launch { + delay(1000) + iv_key_5?.tag = "0" + iv_key_5?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_default)) + } + } } } @@ -239,12 +227,14 @@ class MoFangStatusView : LinearLayout, OnMoFangStatusListener, IMoGoAutopilotSta val key1 = keyCodes[0] val key2 = keyCodes[1] if (key1 == KeyEvent.KEYCODE_A && key2 == KeyEvent.KEYCODE_B || (key1 == KeyEvent.KEYCODE_B && key2 == KeyEvent.KEYCODE_A)) { - tv_icon_1?.isSelected = true - v_lp_1?.visibility = View.INVISIBLE - v_sp_1?.visibility = View.VISIBLE - tv_icon_2?.isSelected = true - v_lp_2.visibility = View.INVISIBLE - v_sp_2.visibility = View.VISIBLE + if (iv_key_1?.tag != "1") { + iv_key_1?.tag = "1" + iv_key_1?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_clicked)) + } + if (iv_key_2?.tag != "1") { + iv_key_2?.tag = "1" + iv_key_2?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_clicked)) + } } } @@ -257,30 +247,25 @@ class MoFangStatusView : LinearLayout, OnMoFangStatusListener, IMoGoAutopilotSta } private fun reset() { - tv_icon_1?.isSelected = false - v_lp_1?.visibility = View.VISIBLE - v_lp_1?.isSelected = false - v_sp_1?.visibility = View.INVISIBLE - - tv_icon_2?.isSelected = false - v_lp_2?.visibility = View.VISIBLE - v_lp_2?.isSelected = false - v_sp_2?.visibility = View.INVISIBLE - - - tv_icon_3?.isSelected = false - v_lp_3?.visibility = View.VISIBLE - v_lp_3?.isSelected = false - v_sp_3?.visibility = View.INVISIBLE - - tv_icon_4?.isSelected = false - v_lp_4?.visibility = View.VISIBLE - v_lp_4?.isSelected = false - v_sp_4?.visibility = View.INVISIBLE - - tv_icon_5?.isSelected = false - v_lp_5?.visibility = View.VISIBLE - v_lp_5?.isSelected = false - v_sp_5?.visibility = View.INVISIBLE + if (iv_key_1?.tag != "0") { + iv_key_1?.tag = "0" + iv_key_1?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_default)) + } + if (iv_key_2?.tag != "0") { + iv_key_2?.tag = "0" + iv_key_2?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_default)) + } + if (iv_key_3?.tag != "0") { + iv_key_3?.tag = "0" + iv_key_3?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_default)) + } + if (iv_key_4?.tag != "0") { + iv_key_4?.tag = "0" + iv_key_4?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_default)) + } + if (iv_key_5?.tag != "0") { + iv_key_5?.tag = "0" + iv_key_5?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_mofang_key_default)) + } } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/viewport/VisualAngleToggleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/viewport/VisualAngleToggleView.kt new file mode 100644 index 0000000000..f4c63f507b --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/viewport/VisualAngleToggleView.kt @@ -0,0 +1,179 @@ +package com.mogo.eagle.core.function.hmi.ui.viewport + +import android.animation.Animator +import android.animation.AnimatorListenerAdapter +import android.animation.ValueAnimator +import android.content.Context +import android.util.AttributeSet +import android.view.GestureDetector +import android.view.LayoutInflater +import android.view.MotionEvent +import android.view.ViewConfiguration +import android.view.animation.AccelerateDecelerateInterpolator +import android.widget.LinearLayout +import androidx.core.content.ContextCompat +import com.mogo.eagle.core.function.angle.scenes.Default +import com.mogo.eagle.core.function.angle.scenes.LongSight +import com.mogo.eagle.core.function.api.map.angle.IMoGoVisualAngleChangeProvider +import com.mogo.eagle.core.function.api.map.angle.Scene +import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager +import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.utilcode.kotlin.scope +import kotlinx.android.synthetic.main.layout_visual_angle_toggle.view.iv_toggle_block +import kotlinx.coroutines.launch +import me.jessyan.autosize.utils.AutoSizeUtils +import kotlin.math.abs +import kotlin.math.max + +class VisualAngleToggleView : LinearLayout, IMoGoVisualAngleChangeProvider.OnMoGoVisualAngleSceneChangeListener { + + companion object { + private const val TAG = "VisualAngleToggleView" + } + + constructor(context: Context?) : this(context, null) + constructor(context: Context?, attrs: AttributeSet?) : this(context, attrs, 0) + constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) { + orientation = VERTICAL + isClickable = true + LayoutInflater.from(context).inflate(R.layout.layout_visual_angle_toggle, this, true) + val defaultSlop = AutoSizeUtils.dp2px(context, 12.0f) + val scrollSlop = max(context?.let { ViewConfiguration.get(it).scaledTouchSlop } ?: defaultSlop, defaultSlop) + val gestureDetector = GestureDetector(context, object : GestureDetector.SimpleOnGestureListener() { + + override fun onDown(e: MotionEvent): Boolean { + return true + } + + override fun onScroll(e1: MotionEvent, e2: MotionEvent, distanceX: Float, distanceY: Float): Boolean { + 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) { + moveToBottom() + return true + } + if (e1.y - e2.y >= scrollSlop) { + moveToTop() + return true + } + return super.onScroll(e1, e2, distanceX, distanceY) + } + }) + iv_toggle_block?.setOnTouchListener { _, event -> gestureDetector.onTouchEvent(event) } + if (context != null) { + background = ContextCompat.getDrawable(context, R.drawable.bg_visual_angle_toggle) + } + } + + private fun moveToBottom() { + if (iv_toggle_block?.tag == "0") { + return + } + val start = if (iv_toggle_block?.tag == 1) AutoSizeUtils.dp2px(context, 185.0f) else AutoSizeUtils.dp2px(context, 109.0f) + iv_toggle_block?.tag = "0" + iv_toggle_block?.isEnabled = false + val end = AutoSizeUtils.dp2px(context, 276.0f) + val animator = ValueAnimator.ofInt(start, end) + animator.addUpdateListener { l -> + val current = l.animatedValue as? Int ?: 0 + (iv_toggle_block?.layoutParams as? LayoutParams)?.also { it.topMargin = current }?.also { iv_toggle_block?.layoutParams = it } + } + animator.addListener(object : AnimatorListenerAdapter() { + override fun onAnimationStart(animation: Animator, isReverse: Boolean) { + CallerVisualAngleManager.changeScene(Default()) + } + override fun onAnimationEnd(animation: Animator, isReverse: Boolean) { + super.onAnimationEnd(animation, isReverse) + iv_toggle_block?.isEnabled = true + } + }) + animator.interpolator = AccelerateDecelerateInterpolator() + animator.setDuration(200) + animator.start() + } + + private fun moveToTop() { + if (iv_toggle_block?.tag == "2") { + return + } + val start = if (iv_toggle_block?.tag == 1) AutoSizeUtils.dp2px(context, 185.0f) else AutoSizeUtils.dp2px(context, 276.0f) + iv_toggle_block?.tag = "2" + iv_toggle_block?.isEnabled = false + val end = AutoSizeUtils.dp2px(context, 109.0f) + val animator = ValueAnimator.ofInt(start, end) + animator.addUpdateListener { l -> + val current = l.animatedValue as? Int ?: 0 + (iv_toggle_block?.layoutParams as? LayoutParams)?.also { it.topMargin = current }?.also { iv_toggle_block?.layoutParams = it } + } + animator.addListener(object : AnimatorListenerAdapter() { + override fun onAnimationStart(animation: Animator, isReverse: Boolean) { + CallerVisualAngleManager.changeScene(LongSight()) + + } + override fun onAnimationEnd(animation: Animator, isReverse: Boolean) { + iv_toggle_block?.isEnabled = true + } + }) + animator.interpolator = AccelerateDecelerateInterpolator() + animator.setDuration(200) + animator.start() + } + + private fun moveToMiddle() { + if (iv_toggle_block?.tag == "1") { + return + } + val start = if (iv_toggle_block?.tag == 2) AutoSizeUtils.dp2px(context, 109.0f) else AutoSizeUtils.dp2px(context, 276.0f) + iv_toggle_block?.tag = "1" + iv_toggle_block?.isEnabled = false + val end = AutoSizeUtils.dp2px(context, 185.0f) + val animator = ValueAnimator.ofInt(start, end) + animator.addUpdateListener { l -> + val current = l.animatedValue as? Int ?: 0 + (iv_toggle_block?.layoutParams as? LayoutParams)?.also { it.topMargin = current }?.also { iv_toggle_block?.layoutParams = it } + } + animator.interpolator = AccelerateDecelerateInterpolator() + animator.setDuration(200) + animator.start() + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + CallerVisualAngleManager.addListener(TAG, this) + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + CallerVisualAngleManager.removeListener(TAG) + } + + override fun onSceneChanged(scene: Scene) { + val isCanSwitch = scene.isCanSwitch() + scope.launch { + if (isCanSwitch != isEnabled) { + isEnabled = isCanSwitch + } + if (iv_toggle_block?.isEnabled != isCanSwitch) { + iv_toggle_block?.isEnabled = isCanSwitch + } + } + if (!isCanSwitch) { + scope.launch { + moveToMiddle() + } + } else { + if (scene is Default) { + scope.launch { + moveToBottom() + } + } else if (scene is LongSight) { + scope.launch { + moveToTop() + } + } + } + } +} diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_mofang_key_clicked.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_mofang_key_clicked.png new file mode 100644 index 0000000000..7c8974d75b Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_mofang_key_clicked.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_mofang_key_default.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_mofang_key_default.png new file mode 100644 index 0000000000..73e4d23b58 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_mofang_key_default.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_mofang_key_long_clicked.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_mofang_key_long_clicked.png new file mode 100644 index 0000000000..390e0158fd Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_mofang_key_long_clicked.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_mofang_status_bg.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_mofang_status_bg.png new file mode 100644 index 0000000000..6719017216 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_mofang_status_bg.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_visual_angle_toggle_block_default.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_visual_angle_toggle_block_default.png new file mode 100644 index 0000000000..dff6f03248 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_visual_angle_toggle_block_default.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_visual_angle_toggle_block_pressed.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_visual_angle_toggle_block_pressed.png new file mode 100644 index 0000000000..fd960cb679 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_visual_angle_toggle_block_pressed.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_visual_angle_toggle_disable.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_visual_angle_toggle_disable.png new file mode 100644 index 0000000000..5ccedf346b Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_visual_angle_toggle_disable.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_visual_angle_toggle_enable.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_visual_angle_toggle_enable.png new file mode 100644 index 0000000000..584a7de01e Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_visual_angle_toggle_enable.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_mf_status.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_mf_status.xml deleted file mode 100644 index d57d698808..0000000000 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_mf_status.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_visual_angle_toggle.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_visual_angle_toggle.xml new file mode 100644 index 0000000000..5db95b931c --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_visual_angle_toggle.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_visual_angle_toggle_block.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_visual_angle_toggle_block.xml new file mode 100644 index 0000000000..ee8cd7c595 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_visual_angle_toggle_block.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_mofang_status.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_mofang_status.xml index c5dcdbabb8..79c783b90d 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_mofang_status.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_mofang_status.xml @@ -1,195 +1,64 @@ + tools:parentTag="android.widget.LinearLayout"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_visual_angle_toggle.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_visual_angle_toggle.xml new file mode 100644 index 0000000000..51091be7cc --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_visual_angle_toggle.xml @@ -0,0 +1,19 @@ + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_bone_container.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_bone_container.xml index ea8151d960..bd69fafeaf 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_bone_container.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_bone_container.xml @@ -33,4 +33,6 @@ android:elevation="20dp" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintTop_toTopOf="parent" /> + + \ No newline at end of file diff --git a/core/mogo-core-res/src/main/res/values/dimens.xml b/core/mogo-core-res/src/main/res/values/dimens.xml index fa65ef033e..89d49350f9 100644 --- a/core/mogo-core-res/src/main/res/values/dimens.xml +++ b/core/mogo-core-res/src/main/res/values/dimens.xml @@ -65,6 +65,7 @@ 38dp 39dp 40dp + 40.5dp 41dp 42dp 43dp @@ -76,6 +77,7 @@ 49dp 50dp 51dp + 51.5dp 52dp 53dp 54dp diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/kotlin/Extensions.kt b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/kotlin/Extensions.kt index a39239dd0d..e0ad842277 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/kotlin/Extensions.kt +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/kotlin/Extensions.kt @@ -98,7 +98,7 @@ val T.lifecycleOwner: LifecycleOwner } val T.scope - get() = lifecycleOwner.lifecycleScope + get() = lifecycleOwner.lifecycleScope + SupervisorJob() fun View.onClick(block: (View) -> Unit) { this.setOnClickListener {