[taxi_u_p]
[arrived dest]
This commit is contained in:
yangyakun
2023-12-07 15:36:59 +08:00
parent e449b8a00d
commit 9291445f9a
5 changed files with 54 additions and 104 deletions

View File

@@ -37,11 +37,6 @@ class TaxiPassengerBaseFragment() :
MvpFragment<TaxiPassengerBaseFragment?, BaseTaxiPassengerPresenter?>(), IMogoMapListener,
TaxiPassengerTaxiView {
/**
* 到达目的地
*/
private var mArrivedEndView: WeakReference<ArrivedView?>? = null
/**
* 手机号后四位验证
*/
@@ -277,20 +272,13 @@ class TaxiPassengerBaseFragment() :
fun showOrHideArrivedEndLayout(isShow: Boolean) {
if (isShow) {
exitFullVideoScreen(true)
if (mArrivedEndView == null || mArrivedEndView!!.get() == null) {
mArrivedEndView = WeakReference(ArrivedView(context))
}
mArrivedEndView?.get()?.let {
OverlayViewUtils.showOverlayView(activity, it, R.style.och_window_anim_alpha)
RxUtils.createSubscribe(500) {
it.setDataAndStartAnimation()
VoiceNotice.showNotice("已到达目的地,带好随身物品,右侧下车更安全!期待下次再见", AIAssist.LEVEL2)
}
arrivedView.visibility = View.VISIBLE
RxUtils.createSubscribe(500) {
arrivedView.setDataAndStartAnimation()
VoiceNotice.showNotice("已到达目的地,带好随身物品,右侧下车更安全!期待下次再见", AIAssist.LEVEL2)
}
} else {
mArrivedEndView?.get()?.let {
OverlayViewUtils.dismissOverlayView(it)
}
arrivedView.visibility = View.GONE
}
}

View File

@@ -3,13 +3,12 @@ package com.mogo.och.taxi.passenger.ui.arrived
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import androidx.lifecycle.ViewModelProvider
import com.mogo.commons.AbsMogoApplication
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
import com.mogo.eagle.core.utilcode.util.OverlayViewUtils
import com.mogo.och.common.module.utils.FrameAnimatorContainer
import com.mogo.och.common.module.utils.RxUtils
import com.mogo.och.taxi.passenger.R
import com.mogo.och.taxi.passenger.widget.WindowRelativeLayout
@@ -19,11 +18,9 @@ import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
import io.reactivex.disposables.Disposable
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.iv_xiaozhi_belt
import kotlinx.android.synthetic.main.taxi_p_arrived_end_panel.view.svp_frame
import kotlinx.android.synthetic.main.taxi_p_arrived_end_panel.view.v_video_right_rear_view
/**
*
* 评价View
@@ -43,8 +40,6 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback {
private val gsyVideoOptionBuilder = GSYVideoOptionBuilder()
private var taxiPxiaozhiLove: FrameAnimatorContainer?=null
private fun initView() {
d(SceneConstant.M_TAXI_P + TAG, "initView")
LayoutInflater.from(context).inflate(R.layout.taxi_p_arrived_end_panel, this, true)
@@ -61,39 +56,33 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback {
.build(svp_frame)
aciv_close.onClick {
OverlayViewUtils.dismissOverlayView(this)
visibility = View.GONE
}
}
taxiPxiaozhiLove = FrameAnimatorContainer(R.array.xiaozhi_love, 48,iv_xiaozhi_belt)
taxiPxiaozhiLove?.setOnAnimStopListener(object : FrameAnimatorContainer.OnAnimationStoppedListener{
override fun AnimationStopped() {
d(SceneConstant.M_TAXI_P + TAG, "动画暂停")
}
})
override fun onVisibilityAggregated(isVisible: Boolean) {
super.onVisibilityAggregated(isVisible)
d(SceneConstant.M_TAXI_P + TAG, "展示---:${isVisible}")
if(isVisible){
v_video_right_rear_view.resetView()
}else{
svp_frame.setBackgroundResource(R.drawable.tail_ani_0000)
svp_frame.setVideoAllCallBack(null)
svp_frame.onVideoReset()
svp_frame.release()
v_video_right_rear_view.resetView()
RxUtils.disposeSubscribe(subscribe)
}
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
val viewModel = ViewModelProvider(this).get(ArrivedViewModel::class.java)
viewModel.setViewCallback(this)
taxiPxiaozhiLove?.reStart()
v_video_right_rear_view.resetView()
}
override fun onDetachedFromWindow() {
svp_frame.setBackgroundResource(R.drawable.tail_ani_0000)
svp_frame.setVideoAllCallBack(null)
svp_frame.onVideoReset()
svp_frame.release()
taxiPxiaozhiLove?.stop()
v_video_right_rear_view.resetView()
super.onDetachedFromWindow()
subscribe?.let {
if (!it.isDisposed) {
it.dispose()
}
}
}
/**
@@ -106,8 +95,8 @@ class ArrivedView : WindowRelativeLayout, ArrivedViewModel.ArrivedViewCallback {
}
})
svp_frame.startPlayLogic()
RxUtils.createSubscribe(60_000) {
OverlayViewUtils.dismissOverlayView(this@ArrivedView)
subscribe = RxUtils.createSubscribe(60_000) {
visibility = View.GONE
}
}

View File

@@ -9,7 +9,7 @@ import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.function.api.autopilot.IMoGoBackCameraVideoListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoRoboBusJinlvM1StitchedVideoListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setIsSubscribeBackCameraVideoVideo
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerBackCameraVideoListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerRoboBusJinlvM1StitchedVideoListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
@@ -48,18 +48,28 @@ class RightRearCamView : ConstraintLayout , IMoGoBackCameraVideoListener,
override fun onAttachedToWindow() {
super.onAttachedToWindow()
setIsSubscribeBackCameraVideoVideo(1, true)
CallerBackCameraVideoListenerManager.addListener(TAG, this)
CallerRoboBusJinlvM1StitchedVideoListenerManager.addListener(TAG, this)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
setIsSubscribeBackCameraVideoVideo(1, false)
CallerBackCameraVideoListenerManager.removeListener(this)
CallerRoboBusJinlvM1StitchedVideoListenerManager.removeListener(this)
}
override fun onVisibilityAggregated(isVisible: Boolean) {
super.onVisibilityAggregated(isVisible)
if(isVisible){
d(SceneConstant.M_TAXI_P + TAG, "展示--可见")
CallerAutoPilotControlManager.setIsSubscribeBackCameraVideoVideo(1, true)
CallerBackCameraVideoListenerManager.addListener(TAG, this)
CallerRoboBusJinlvM1StitchedVideoListenerManager.addListener(TAG, this)
}else{
d(SceneConstant.M_TAXI_P + TAG, "展示--不可见")
CallerAutoPilotControlManager.setIsSubscribeBackCameraVideoVideo(1, false)
CallerBackCameraVideoListenerManager.removeListener(this)
CallerRoboBusJinlvM1StitchedVideoListenerManager.removeListener(this)
}
}
companion object {
const val TAG = "RightRearCamView"
}

View File

@@ -58,48 +58,4 @@
android:layout_width="@dimen/dp_900"
android:layout_height="@dimen/dp_506"/>
<View
android:id="@+id/v_xiaozhi_belt_info_bg"
app:layout_constraintBottom_toTopOf="@+id/iv_xiaozhi_belt"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="@dimen/dp_50"
android:background="@drawable/taxi_p_xiaozhibelt_info"
android:layout_marginBottom="-60dp"
android:layout_width="@dimen/dp_600"
android:layout_height="@dimen/dp_339"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_title_01"
app:layout_constraintStart_toStartOf="@+id/v_xiaozhi_belt_info_bg"
app:layout_constraintEnd_toEndOf="@+id/v_xiaozhi_belt_info_bg"
app:layout_constraintTop_toTopOf="@+id/v_xiaozhi_belt_info_bg"
android:layout_marginTop="@dimen/dp_45"
android:text="带好随身物品,右侧下车\n更安全"
android:textSize="@dimen/dp_44"
android:textColor="@android:color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.appcompat.widget.AppCompatTextView
app:layout_constraintBottom_toBottomOf="@+id/v_xiaozhi_belt_info_bg"
app:layout_constraintStart_toStartOf="@+id/actv_title_01"
android:layout_marginBottom="@dimen/dp_67"
android:text="记得在小程序完成支付哦~"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_44"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageView
android:id="@+id/iv_xiaozhi_belt"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="@dimen/dp_360"
android:layout_height="@dimen/dp_360"
android:layout_marginBottom="@dimen/dp_m_30"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -148,6 +148,20 @@
android:layout_height="@dimen/dp_160"
app:layout_constraintBottom_toBottomOf="parent" />
<com.mogo.och.taxi.passenger.ui.debug.DebugView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_120"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.och.taxi.passenger.ui.arrived.ArrivedView
android:id="@+id/arrivedView"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<com.mogo.och.common.module.wigets.ZhiView
android:id="@+id/aciv_xiaozhi_normal"
android:layout_width="@dimen/dp_360"
@@ -165,11 +179,4 @@
android:layout_marginBottom="-80dp"
app:layout_constraintEnd_toEndOf="parent" />
<com.mogo.och.taxi.passenger.ui.debug.DebugView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_120"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>