[6.5.0]
[fea] [司机屏视角切换、ItinerarySummaryDialog行程展示]
This commit is contained in:
@@ -18,6 +18,7 @@ import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.R
|
||||
import kotlinx.android.synthetic.main.taxi_p_seekbar_visualangle.view.iv_visualangle_bg
|
||||
@@ -40,6 +41,8 @@ class SeekBarView : ConstraintLayout, VisualViewModel.IVisualCallback {
|
||||
)
|
||||
}
|
||||
|
||||
private val TAG = "SeekBarView"
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
@@ -103,9 +106,9 @@ class SeekBarView : ConstraintLayout, VisualViewModel.IVisualCallback {
|
||||
}
|
||||
MotionEvent.ACTION_UP -> {
|
||||
if(draggableButton.translationY<0){
|
||||
translationByValue(VisualViewModel.Visualangle.Middle)
|
||||
}else if (draggableButton.translationY>(height-draggableButton.height)){
|
||||
translationByValue(VisualViewModel.Visualangle.Long)
|
||||
}else if (draggableButton.translationY>(height-draggableButton.height)){
|
||||
translationByValue(VisualViewModel.Visualangle.Middle)
|
||||
}else{
|
||||
val marginTop = draggableButton.translationY
|
||||
val split = (height - draggableButton.height) / 2
|
||||
@@ -119,9 +122,9 @@ class SeekBarView : ConstraintLayout, VisualViewModel.IVisualCallback {
|
||||
// }
|
||||
|
||||
if(marginTop>0&&marginTop<split){
|
||||
translationByValue(VisualViewModel.Visualangle.Middle)
|
||||
}else if(marginTop>split&&marginTop<(height - draggableButton.height)){
|
||||
translationByValue(VisualViewModel.Visualangle.Long)
|
||||
}else if(marginTop>split&&marginTop<(height - draggableButton.height)){
|
||||
translationByValue(VisualViewModel.Visualangle.Middle)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -132,6 +135,7 @@ class SeekBarView : ConstraintLayout, VisualViewModel.IVisualCallback {
|
||||
}
|
||||
|
||||
private var value: VisualViewModel.Visualangle by Delegates.observable(VisualViewModel.Visualangle.None) { _, oldValue, newValue ->
|
||||
CallerLogger.d(TAG,"oldValue:${oldValue}____newValue:${newValue}")
|
||||
if (oldValue != newValue) {
|
||||
viewModel?.changeVisualView(newValue)
|
||||
if(newValue==VisualViewModel.Visualangle.UnChange){
|
||||
@@ -148,25 +152,24 @@ class SeekBarView : ConstraintLayout, VisualViewModel.IVisualCallback {
|
||||
value = visualangle
|
||||
when (visualangle) {
|
||||
VisualViewModel.Visualangle.Middle -> {
|
||||
ObjectAnimator.ofFloat(draggableButton, "translationY", draggableButton.translationY, 0f).apply {
|
||||
ObjectAnimator.ofFloat(
|
||||
draggableButton, "translationY", draggableButton.translationY,
|
||||
(height - draggableButton.height).toFloat()
|
||||
).apply {
|
||||
duration = 100
|
||||
}.start()
|
||||
}
|
||||
VisualViewModel.Visualangle.Long -> {
|
||||
ObjectAnimator.ofFloat(
|
||||
draggableButton,
|
||||
"translationY",
|
||||
draggableButton.translationY,
|
||||
(height - draggableButton.height).toFloat()
|
||||
draggableButton, "translationY", draggableButton.translationY,
|
||||
0f
|
||||
).apply {
|
||||
duration = 100
|
||||
}.start()
|
||||
}
|
||||
VisualViewModel.Visualangle.UnChange -> {
|
||||
ObjectAnimator.ofFloat(
|
||||
draggableButton,
|
||||
"translationY",
|
||||
draggableButton.translationY,
|
||||
draggableButton, "translationY", draggableButton.translationY,
|
||||
(height - draggableButton.height) / 2f
|
||||
).apply {
|
||||
duration = 100
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
package com.mogo.och.common.module.wigets.map.switchvisual
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.R
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class VisualView : AppCompatImageView, VisualViewModel.IVisualCallback {
|
||||
|
||||
private val TAG = "VisualView"
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet)
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attributeSet,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
private fun initView() {
|
||||
setImageResource(R.drawable.common_visual_medium)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
|
||||
val viewModel = findViewTreeViewModelStoreOwner()?.let {
|
||||
ViewModelProvider(it).get(VisualViewModel::class.java)
|
||||
}
|
||||
|
||||
viewModel?.setDistanceCallback(this)
|
||||
|
||||
onClick {
|
||||
viewModel?.changeVisualView()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
init {
|
||||
try {
|
||||
initView()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun setViewShow(boolean: Boolean) {
|
||||
UiThreadHandler.post({
|
||||
if (boolean) {
|
||||
visibility = View.VISIBLE
|
||||
} else {
|
||||
visibility = View.GONE
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
override fun setMiddleAngle() {
|
||||
UiThreadHandler.post({
|
||||
setImageResource(R.drawable.common_visual_medium)
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
override fun setLongAngle() {
|
||||
UiThreadHandler.post({
|
||||
setImageResource(R.drawable.common_visual_long)
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
|
||||
override fun setUnableChange() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -72,33 +72,6 @@ class VisualViewModel : ViewModel(),
|
||||
}
|
||||
}
|
||||
|
||||
fun changeVisualView() {
|
||||
CallerVisualAngleManager.getCurrentScene().let {
|
||||
val default = Default(0)
|
||||
|
||||
when (it.angle) {
|
||||
VisualAngleMode.MODE_MEDIUM_SIGHT -> {
|
||||
if(default.angle==VisualAngleMode.MODE_MEDIUM_SIGHT){
|
||||
CallerVisualAngleManager.changeScene(LongSight(0))
|
||||
}
|
||||
}
|
||||
|
||||
VisualAngleMode.MODE_LONG_SIGHT -> {
|
||||
CallerVisualAngleManager.changeScene(Default(0))
|
||||
}
|
||||
VisualAngleMode.MAP_STYLE_VR_SKY_BOX -> {
|
||||
if(default.angle==VisualAngleMode.MAP_STYLE_VR_SKY_BOX){
|
||||
CallerVisualAngleManager.changeScene(LongSight(0))
|
||||
}
|
||||
}
|
||||
|
||||
else -> {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun changeVisualView(angle: Visualangle) {
|
||||
|
||||
when (angle) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.ItinerarySummaryDialog
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -48,6 +49,8 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback {
|
||||
|
||||
private lateinit var viewModel: ArrivedViewModel
|
||||
|
||||
val dialog = ItinerarySummaryDialog(context,false,R.style.summary_dialog_p)
|
||||
|
||||
|
||||
private fun initView() {
|
||||
d(SceneConstant.M_TAXI_P + TAG, "initView")
|
||||
@@ -71,6 +74,7 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback {
|
||||
aniSpeedSettingRow()
|
||||
viewModel.setEndInfo()
|
||||
ZhiViewmanager.showListeningAni(ZhiViewmanager.loveAni)
|
||||
dialog.show()
|
||||
} else {
|
||||
v_video_right_rear_view.resetView()
|
||||
taxiPxiaozhiLove?.stop()
|
||||
@@ -78,6 +82,7 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback {
|
||||
taxiPxiaozhiLove = null
|
||||
RxUtils.disposeSubscribe(subscribe)
|
||||
ZhiViewmanager.showListeningAni(ZhiViewmanager.normalAni)
|
||||
dialog.dismiss()
|
||||
}
|
||||
arrivedVisilityChangeListenr?.isShow(isVisible)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user