Merge remote-tracking branch 'origin/dev_robotaxi-d_241112_6.8.0' into dev_robotaxi-d_241112_6.8.0
This commit is contained in:
@@ -4,4 +4,6 @@ import com.mogo.och.common.module.wigets.media.MediaItem
|
||||
|
||||
interface IMediaDispatch {
|
||||
fun diapatchMedia(list :MutableList<MediaItem>)
|
||||
fun setMediaPause(){}
|
||||
fun setMediaResume(){}
|
||||
}
|
||||
@@ -12,4 +12,18 @@ object MediaManager : CallerBase<IMediaDispatch>() {
|
||||
}
|
||||
}
|
||||
|
||||
fun setMediaResume(){
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.setMediaResume()
|
||||
}
|
||||
}
|
||||
|
||||
fun setMediaPause(){
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.setMediaPause()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import com.mogo.och.common.module.R
|
||||
import com.mogo.och.common.module.biz.media.IMediaDispatch
|
||||
import com.mogo.och.common.module.biz.media.MediaManager
|
||||
import com.mogo.och.common.module.manager.download.DownloadManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import io.reactivex.disposables.Disposable
|
||||
@@ -113,6 +114,20 @@ class MediaPlayerFragment :
|
||||
fisrtData = RxUtils.createSubscribe(3_000) {}
|
||||
setHightPriorityMediaItem(list)
|
||||
}
|
||||
|
||||
override fun setMediaPause() {
|
||||
super.setMediaPause()
|
||||
BizLoopManager.runInMainThread{
|
||||
imageVideoRotationView.setPause()
|
||||
}
|
||||
}
|
||||
|
||||
override fun setMediaResume() {
|
||||
super.setMediaResume()
|
||||
BizLoopManager.runInMainThread {
|
||||
imageVideoRotationView.setResume()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MediaPlayerPresenter(view: MediaPlayerFragment?) :
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
package com.mogo.och.shuttle.weaknet.passenger.ui
|
||||
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.mogo.och.common.module.biz.media.MediaManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.transform.OchTransform
|
||||
import com.mogo.och.common.module.manager.transform.OchTransformDispatch
|
||||
import com.mogo.och.shuttle.weaknet.passenger.R
|
||||
import com.mogo.och.shuttle.weaknet.passenger.presenter.PM2Presenter
|
||||
import com.mogo.och.common.module.wigets.media.MediaPlayerFragment
|
||||
import kotlinx.android.synthetic.main.shuttle_p_m2_fragment.tv_shuttle_b2_p_version
|
||||
import kotlinx.android.synthetic.main.shuttle_p_m2_fragment.video_fragment
|
||||
|
||||
|
||||
/**
|
||||
@@ -19,6 +27,27 @@ class PM2BaseFragment :
|
||||
private var hdMapFragment : PM2HPMapFragment? = null
|
||||
private var mediaFragment : MediaPlayerFragment? = null
|
||||
|
||||
private val ochTransform = object : OchTransformDispatch{
|
||||
override fun setVideoView(target: View?) {
|
||||
super.setVideoView(target)
|
||||
if(target!=null){
|
||||
BizLoopManager.runInMainThread{
|
||||
target.id = R.id.video_show
|
||||
val params = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT)
|
||||
video_fragment.addView(target,params)
|
||||
MediaManager.setMediaPause()
|
||||
}
|
||||
}else{
|
||||
BizLoopManager.runInMainThread{
|
||||
findViewById<View>(R.id.video_show)?.let {
|
||||
video_fragment.removeView(it)
|
||||
MediaManager.setMediaResume()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.shuttle_p_m2_fragment
|
||||
}
|
||||
@@ -31,6 +60,12 @@ class PM2BaseFragment :
|
||||
tv_shuttle_b2_p_version.text = "版本:${AppUtils.getAppVersionName()}"
|
||||
//隐藏小地图
|
||||
initFragment()
|
||||
OchTransform.addListener(TAG,ochTransform)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
OchTransform.removeListener(TAG)
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<item name="video_show" type="id" />
|
||||
</resources>
|
||||
Reference in New Issue
Block a user