[6.2.6]
[taxi_p] [结束动画]
This commit is contained in:
@@ -2,6 +2,7 @@ package com.mogo.och.taxi.passenger.ui.arrived
|
||||
|
||||
import android.animation.Animator
|
||||
import android.animation.AnimatorListenerAdapter
|
||||
import android.animation.AnimatorSet
|
||||
import android.animation.ObjectAnimator
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
@@ -20,6 +21,7 @@ import kotlinx.android.synthetic.main.taxi_p_arrived_end_panel.view.aciv_bg
|
||||
import kotlinx.android.synthetic.main.taxi_p_arrived_end_panel.view.aciv_close
|
||||
import kotlinx.android.synthetic.main.taxi_p_arrived_end_panel.view.actv_endstation
|
||||
import kotlinx.android.synthetic.main.taxi_p_arrived_end_panel.view.v_video_right_rear_view
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
|
||||
/**
|
||||
@@ -65,6 +67,7 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback {
|
||||
}
|
||||
taxiPxiaozhiLove?.start()
|
||||
v_video_right_rear_view.resetView()
|
||||
aniSpeedSettingRow()
|
||||
viewModel.setEndInfo()
|
||||
} else {
|
||||
v_video_right_rear_view.resetView()
|
||||
@@ -140,6 +143,29 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback {
|
||||
}
|
||||
}
|
||||
|
||||
private fun aniSpeedSettingRow(){
|
||||
val translationYStart = - AutoSizeUtils.dp2px(context,180f).toFloat()
|
||||
val translationYEnd: Float = 0f
|
||||
val alphaStart: Float = 0f
|
||||
val alphaEnd: Float = 1f
|
||||
|
||||
val translationX = ObjectAnimator.ofFloat(
|
||||
v_video_right_rear_view,
|
||||
"translationX",
|
||||
translationYStart,
|
||||
translationYEnd
|
||||
).apply {
|
||||
duration = 1000
|
||||
}
|
||||
val alpha =
|
||||
ObjectAnimator.ofFloat(v_video_right_rear_view, "alpha", alphaStart, alphaEnd).apply {
|
||||
duration = 1000
|
||||
}
|
||||
val animatorSet = AnimatorSet()
|
||||
animatorSet.playTogether(mutableListOf<Animator>(translationX,alpha))
|
||||
animatorSet.start()
|
||||
}
|
||||
|
||||
interface ArrivedVisilityChangeListenr{
|
||||
fun isShow(show: Boolean)
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.och.taxi.passenger.ui.arrived
|
||||
|
||||
import android.animation.Animator
|
||||
import android.animation.AnimatorListenerAdapter
|
||||
import android.animation.AnimatorSet
|
||||
import android.animation.ObjectAnimator
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
@@ -22,6 +23,7 @@ import kotlinx.android.synthetic.main.taxt_u_p_arrived_end_panel.view.aciv_bg
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_arrived_end_panel.view.aciv_close
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_arrived_end_panel.view.actv_endstation
|
||||
import kotlinx.android.synthetic.main.taxt_u_p_arrived_end_panel.view.v_video_right_rear_view
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -66,6 +68,7 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback {
|
||||
}
|
||||
taxiPxiaozhiLove?.start()
|
||||
v_video_right_rear_view.resetView()
|
||||
aniSpeedSettingRow()
|
||||
viewModel.setEndInfo()
|
||||
} else {
|
||||
v_video_right_rear_view.resetView()
|
||||
@@ -143,6 +146,29 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback {
|
||||
}
|
||||
}
|
||||
|
||||
private fun aniSpeedSettingRow(){
|
||||
val translationYStart = - AutoSizeUtils.dp2px(context,180f).toFloat()
|
||||
val translationYEnd: Float = 0f
|
||||
val alphaStart: Float = 0f
|
||||
val alphaEnd: Float = 1f
|
||||
|
||||
val translationX = ObjectAnimator.ofFloat(
|
||||
v_video_right_rear_view,
|
||||
"translationX",
|
||||
translationYStart,
|
||||
translationYEnd
|
||||
).apply {
|
||||
duration = 1000
|
||||
}
|
||||
val alpha =
|
||||
ObjectAnimator.ofFloat(v_video_right_rear_view, "alpha", alphaStart, alphaEnd).apply {
|
||||
duration = 1000
|
||||
}
|
||||
val animatorSet = AnimatorSet()
|
||||
animatorSet.playTogether(mutableListOf<Animator>(translationX,alpha))
|
||||
animatorSet.start()
|
||||
}
|
||||
|
||||
interface ArrivedVisilityChangeListenr{
|
||||
fun isShow(show: Boolean)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user