diff --git a/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.kt b/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.kt index f746767108..b665fa7591 100644 --- a/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.kt +++ b/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.kt @@ -37,11 +37,6 @@ class TaxiPassengerBaseFragment() : MvpFragment(), IMogoMapListener, TaxiPassengerTaxiView { - /** - * 到达目的地 - */ - private var mArrivedEndView: WeakReference? = 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 } } diff --git a/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/ArrivedView.kt b/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/ArrivedView.kt index 96f1b8918a..d6c5f8c7ef 100644 --- a/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/ArrivedView.kt +++ b/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/ArrivedView.kt @@ -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 } } diff --git a/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/RightRearCamView.kt b/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/RightRearCamView.kt index 655a132350..0fb354ef4a 100644 --- a/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/RightRearCamView.kt +++ b/OCH/taxi/unmanned-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/arrived/RightRearCamView.kt @@ -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" } diff --git a/OCH/taxi/unmanned-passenger/src/main/res/layout/taxi_p_arrived_end_panel.xml b/OCH/taxi/unmanned-passenger/src/main/res/layout/taxi_p_arrived_end_panel.xml index 086e795a01..46fc1a1566 100644 --- a/OCH/taxi/unmanned-passenger/src/main/res/layout/taxi_p_arrived_end_panel.xml +++ b/OCH/taxi/unmanned-passenger/src/main/res/layout/taxi_p_arrived_end_panel.xml @@ -58,48 +58,4 @@ android:layout_width="@dimen/dp_900" android:layout_height="@dimen/dp_506"/> - - - - - - - - - - - - \ No newline at end of file diff --git a/OCH/taxi/unmanned-passenger/src/main/res/layout/taxi_p_base_fragment.xml b/OCH/taxi/unmanned-passenger/src/main/res/layout/taxi_p_base_fragment.xml index ff44f994ee..ed9677db19 100644 --- a/OCH/taxi/unmanned-passenger/src/main/res/layout/taxi_p_base_fragment.xml +++ b/OCH/taxi/unmanned-passenger/src/main/res/layout/taxi_p_base_fragment.xml @@ -148,6 +148,20 @@ android:layout_height="@dimen/dp_160" app:layout_constraintBottom_toBottomOf="parent" /> + + + + + - - \ No newline at end of file