(view)
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/provider/M2StatusViewManager.java b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/provider/M2StatusViewManager.java
new file mode 100644
index 0000000000..3c79925efa
--- /dev/null
+++ b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/provider/M2StatusViewManager.java
@@ -0,0 +1,33 @@
+package com.mogo.och.bus.passenger.passenger.provider;
+
+import android.content.Context;
+import android.view.View;
+
+import com.mogo.och.bus.passenger.passenger.ui.widget.M2StatusBarView;
+import androidx.annotation.NonNull;
+
+import com.alibaba.android.arouter.facade.annotation.Route;
+import com.mogo.eagle.core.data.constants.MogoServicePaths;
+import com.mogo.eagle.core.function.api.hmi.view.IStatusViewLayout;
+
+/**
+ * @author congtaowang
+ * @since 2020-01-06
+ *
+ * 根据优先级控制显示 window view.
+ */
+@Route( path = MogoServicePaths.PATH_STATUS_VIEW_MANAGER )
+public class M2StatusViewManager implements IStatusViewLayout {
+
+
+ @NonNull
+ @Override
+ public View getStatusView(Context context) {
+ return new M2StatusBarView(context);
+ }
+
+ @Override
+ public void init(Context context) {
+
+ }
+}
diff --git a/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/PM2BaseFragment.kt b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/PM2BaseFragment.kt
new file mode 100644
index 0000000000..ff1a90270f
--- /dev/null
+++ b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/PM2BaseFragment.kt
@@ -0,0 +1,70 @@
+package com.mogo.och.bus.passenger.passenger.ui
+
+import com.mogo.commons.mvp.MvpFragment
+import com.mogo.och.bus.passenger.R
+import com.mogo.och.bus.passenger.passenger.presenter.PM2Presenter
+import com.mogo.och.bus.passenger.passenger.ui.video.PM2VideoFragment
+
+/**
+ * @author: wangmingjun
+ * @date: 2022/4/12
+ */
+class PM2BaseFragment :
+ MvpFragment() {
+
+ private var drivingFragment : PM2DrivingInfoFragment? = null
+ private var hdMapFragment : PM2HPMapFragment? = null
+ private var videoFragment : PM2VideoFragment? = null
+
+ override fun getLayoutId(): Int {
+ return R.layout.bus_p_m2_fragment
+ }
+
+ override fun getTagName(): String {
+ return TAG
+ }
+
+ override fun initViews() {
+ //横竖屏
+// setScreenDirection()
+
+ //隐藏小地图
+ initFragment()
+ }
+
+// private fun setScreenDirection() {
+// var ro = Settings.System.getInt(context?.contentResolver,
+// Settings.System.USER_ROTATION,Surface.ROTATION_270)
+// if (ro != Surface.ROTATION_270){
+// ro = Surface.ROTATION_270
+// }
+// Settings.System.putInt(context?.contentResolver,
+// Settings.System.USER_ROTATION,ro)
+// }
+
+ /**
+ * 初始化行程信息,高静地图,宣传 三个fragment
+ */
+ private fun initFragment() {
+
+ if (drivingFragment == null) drivingFragment = PM2DrivingInfoFragment()
+ childFragmentManager.beginTransaction().add(R.id.driving_fragment, drivingFragment!!)
+ .show(drivingFragment!!).commitAllowingStateLoss()
+
+ if (hdMapFragment == null) hdMapFragment = PM2HPMapFragment()
+ childFragmentManager.beginTransaction().add(R.id.hd_map_fragment, hdMapFragment!!)
+ .show(hdMapFragment!!).commitAllowingStateLoss()
+
+ if (videoFragment == null) videoFragment = PM2VideoFragment()
+ childFragmentManager.beginTransaction().add(R.id.video_fragment, videoFragment!!)
+ .show(videoFragment!!).commitAllowingStateLoss()
+ }
+
+ override fun createPresenter(): PM2Presenter {
+ return PM2Presenter(this)
+ }
+
+ companion object {
+ public val TAG = PM2BaseFragment::class.java.simpleName
+ }
+}
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/PM2DrivingInfoFragment.kt b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/PM2DrivingInfoFragment.kt
new file mode 100644
index 0000000000..a573be4e8d
--- /dev/null
+++ b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/PM2DrivingInfoFragment.kt
@@ -0,0 +1,300 @@
+package com.mogo.och.bus.passenger.passenger.ui
+
+import android.graphics.BitmapFactory
+import android.graphics.drawable.AnimationDrawable
+import android.os.Bundle
+import android.view.View
+import androidx.core.content.ContextCompat
+import com.amap.api.maps.model.LatLng
+import com.mogo.commons.AbsMogoApplication
+import com.mogo.commons.mvp.MvpFragment
+import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
+import com.mogo.eagle.core.function.view.SiteMarkerBean
+import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
+import com.mogo.och.bus.passenger.R
+import com.mogo.och.bus.passenger.passenger.presenter.PM2DrivingPresenter
+import com.mogo.och.common.module.utils.DateTimeUtil.*
+import com.mogo.och.common.module.utils.NumberFormatUtil
+import com.mogo.och.data.bean.BusStationBean
+import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.auto_tv
+import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.clg_distance_left_time
+import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.group_not_select_line
+import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.group_stationinfo
+import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.iv_animal_list
+import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.line_during_tv
+import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.line_name_tv
+import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.overMapView
+import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.speed_tv
+import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.station_name_tv
+import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.tv_arrived_notice
+import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.tv_distance
+import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.tv_left_time
+import kotlinx.android.synthetic.main.bus_p_m2_driving_info_fragment.tv_next_station_title
+
+import me.jessyan.autosize.utils.AutoSizeUtils
+import kotlin.math.ceil
+import kotlin.math.roundToInt
+
+/**
+ * @author: wangmingjun
+ * @date: 2022/4/12
+ */
+class PM2DrivingInfoFragment :
+ MvpFragment() {
+
+ val stationIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.bus_p_m2_map_staton_icon)
+ val stationPassIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.bus_p_m2_map_staton_arrived_icon)
+ val startStationIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.bus_p_m2_map_start_icon)
+ val endStationIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.bus_p_m2_map_end_icon)
+
+ /**
+ * 改变自动驾驶状态
+ *
+ * @param status 2 - running 1 - enable 2 - disable
+ */
+ override fun getLayoutId(): Int {
+ return R.layout.bus_p_m2_driving_info_fragment
+ }
+
+ override fun getTagName(): String {
+ return TAG
+ }
+
+ override fun initViews() {
+ speed_tv.setOnLongClickListener {
+ context?.let { ToggleDebugView.toggleDebugView.toggle(it) }
+ true
+ }
+
+ line_name_tv.setTextColor(resources.getColor(R.color.bus_p_m2_line_name_tv_color))
+ station_name_tv.setTextColor(resources.getColor(R.color.bus_p_m2_line_name_tv_color))
+ speed_tv.setVertrial(true)
+ val intArrayOf = intArrayOf(
+ requireContext().resources.getColor(R.color.bus_p_m2_color_43cefe),
+ requireContext().resources.getColor(R.color.bus_p_m2_color_1466fb)
+ )
+ speed_tv.setmColorList(intArrayOf)
+
+// current_time_tv.onClick {
+
+// //测试V2X消息
+// CallerMsgBoxManager.saveMsgBox(
+// MsgBoxBean(
+// MsgBoxType.V2X,
+// V2XMsg(
+// "6666",
+// "超速行驶",
+// ""
+// )
+// )
+// )
+//
+// val noticeTrafficStylePushData = NoticeTrafficStylePushData()
+// noticeTrafficStylePushData.content= "测试公告布局"
+// val noticeFromCloudMsg = NoticeFrCloudMsg(null, noticeTrafficStylePushData, 1)
+// CallerMsgBoxManager.saveMsgBox(
+// MsgBoxBean(
+// MsgBoxType.NOTICE, noticeFromCloudMsg)
+// )
+// BPRouteDataTestUtils.converToRouteData()
+// }
+ }
+
+ override fun initViews(savedInstanceState: Bundle?) {
+ super.initViews(savedInstanceState)
+ overMapView?.let {
+ it.onCreateView(savedInstanceState)
+ val radius = AutoSizeUtils.dp2px(requireContext(), 16f)
+ it.outlineProvider = TextureVideoViewOutlineProvider(radius.toFloat())
+ it.clipToOutline = true
+ }
+ }
+
+ override fun onResume() {
+ super.onResume()
+ overMapView?.let{
+ it.onResume()
+ }
+ }
+
+ override fun onPause() {
+ super.onPause()
+ overMapView?.let{
+ it.onPause()
+ }
+ }
+
+ override fun onDestroy() {
+ super.onDestroy()
+ overMapView?.let{
+ it.onDestroy()
+ }
+ }
+
+ fun updateSpeed(speed: Int){
+ speed_tv.text = speed.toString()
+ }
+
+ fun updateCarPlateNum(plateNum : String){
+
+ }
+
+ fun updateTaskName(name: String){
+ line_name_tv.text = name
+ }
+
+ fun updateTaskDuringTime(time : String){
+ line_during_tv.text = time
+ }
+
+ fun changeOperationStatus(status:Boolean){
+ if (!status){
+ updateNoOrderUI()
+ }
+ }
+
+ fun showNoTaskView(haveTask: Boolean){
+ setLineInfoView(haveTask)
+ }
+
+ private fun setLineInfoView(isShow: Boolean){
+ if (!isShow){
+ updateNoOrderUI()
+ }
+ }
+
+ private fun updateNoOrderUI() {
+ line_name_tv.text = resources.getString(R.string.bus_p_m2_not_select_line_content)
+ updateNoStationView()
+ overMapView?.let {
+ it.clearSiteMarkers()
+ }
+ clearCustomPolyline()
+ }
+
+ fun clearCustomPolyline(){
+ overMapView?.let {
+ it.clearCustomPolyline()
+ }
+ }
+ private fun updateNoStationView(){
+ station_name_tv.setTextColor(resources.getColor(R.color.bus_p_m2_next_tv_color))
+ station_name_tv.text = resources.getString(R.string.bus_p_m2_empty_tv)
+ tv_distance.text = resources.getString(R.string.bus_p_m2_empty_remain_km)
+ tv_left_time.text = resources.getString(R.string.bus_p_m2_empty_remain_minute)
+ noLineShow()
+ }
+
+ override fun createPresenter(): PM2DrivingPresenter {
+ return PM2DrivingPresenter(this)
+ }
+
+ fun updateAutoStatus(isAutoPilot: Boolean) {
+ if (isAutoPilot){
+ context?.let { auto_tv.setTextColor(ContextCompat.getColor(it,R.color.bus_p_m2_white_color)) }
+ context?.let { auto_tv.background = ContextCompat.getDrawable(it,R.drawable.bus_p_m2_auto_button_bg) }
+ }else{
+ context?.let { auto_tv.setTextColor(ContextCompat.getColor(it,R.color.bus_p_m2_color_7094ad)) }
+ context?.let { auto_tv.background = ContextCompat.getDrawable(it,R.drawable.bus_p_m2_bg_p_m2_auto) }
+ }
+ }
+
+ fun updateLineStations(
+ stations: MutableList,
+ stationsPass: MutableList,
+ startStation: LatLng?,
+ endStation: LatLng?
+ ){
+ overMapView?.let {
+ val stationsList: MutableList = mutableListOf()
+ startStation?.let { start->
+ stationsList.add(SiteMarkerBean(start,startStationIcon,0.5f,0.5f))
+ }
+ for (stationsPass in stationsPass) {
+ stationsList.add(SiteMarkerBean(stationsPass,stationPassIcon,0.5f,0.5f))
+ }
+ for (stationsPass in stations) {
+ stationsList.add(SiteMarkerBean(stationsPass,stationIcon,0.5f,0.5f))
+ }
+ endStation?.let {end->
+ stationsList.add(SiteMarkerBean(end,endStationIcon,0.5f,0.5f))
+ }
+ it.drawSiteMarkers(stationsList)
+ }
+ }
+
+ fun updateStationsInfo(stations: MutableList, i: Int, isArrived: Boolean){
+ if (stations.size == 0) return
+ if (0<= i && i 0) {
+ if (meters / 1000 < 1) {
+ disUnit = "米"
+ remainDis = meters.toFloat().roundToInt().toString()
+ } else {
+ disUnit = "公里"
+ remainDis = NumberFormatUtil.formatLong(meters.toDouble() / 1000)
+ }
+ }
+
+ val time = ceil(timeInSecond / 60f).toInt()
+
+ "$remainDis$disUnit".also { tv_distance.text = it }
+ "${time}分钟".also { tv_left_time.text = it }
+ }
+
+ fun noLineShow(){
+ // 没有线路展示
+ group_not_select_line.visibility = View.VISIBLE
+ // 下一个站点
+ group_stationinfo.visibility = View.GONE
+ // 距离和剩余大概时间
+ clg_distance_left_time.visibility = View.GONE
+ // 到达站点
+ tv_arrived_notice.visibility = View.GONE
+
+ iv_animal_list.visibility = View.GONE
+ }
+ // 有线路正在到站点
+ fun haveLineAndArriveingStation(){
+ group_not_select_line.visibility = View.GONE
+ group_stationinfo.visibility = View.VISIBLE
+ clg_distance_left_time.visibility = View.VISIBLE
+ tv_arrived_notice.visibility = View.GONE
+ iv_animal_list.visibility = View.GONE
+ }
+ // 有线路到达站点
+ private fun haveLineAndArrivedStation(){
+ group_not_select_line.visibility = View.GONE
+ group_stationinfo.visibility = View.VISIBLE
+ clg_distance_left_time.visibility = View.GONE
+ tv_arrived_notice.visibility = View.VISIBLE
+ iv_animal_list.visibility = View.VISIBLE
+ val animationDrawable = iv_animal_list.drawable as AnimationDrawable
+ animationDrawable.start()
+ }
+
+ companion object {
+ private val TAG = PM2DrivingInfoFragment::class.java.simpleName
+ }
+}
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/PM2HPMapFragment.kt b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/PM2HPMapFragment.kt
new file mode 100644
index 0000000000..61491e19b2
--- /dev/null
+++ b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/PM2HPMapFragment.kt
@@ -0,0 +1,127 @@
+package com.mogo.och.bus.passenger.passenger.ui
+
+import android.os.Bundle
+import com.mogo.commons.mvp.MvpFragment
+import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getOverlayManager
+import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
+import com.mogo.map.overlay.core.Level
+import com.mogo.map.overlay.point.Point
+import com.mogo.map.MapDataWrapper
+import com.mogo.och.bus.passenger.R
+import com.mogo.och.bus.passenger.passenger.constant.M2Const.Companion.TYPE_MARKER_M2_LINE
+import com.mogo.och.bus.passenger.passenger.presenter.PM2ADASPresenter
+import com.mogo.och.common.module.utils.OCHThreadPoolManager
+import kotlinx.android.synthetic.main.bus_p_m2_hpmap_fragment.mapBizView
+
+import java.util.*
+
+/**
+ * @author: wangmingjun
+ * @date: 2022/4/12
+ */
+class PM2HPMapFragment :
+ MvpFragment() {
+ /**
+ * 改变自动驾驶状态
+ *
+ * @param status 2 - running 1 - enable 2 - disable
+ */
+ override fun getLayoutId(): Int {
+ return R.layout.bus_p_m2_hpmap_fragment
+ }
+
+ override fun getTagName(): String {
+ return TAG
+ }
+
+ override fun initViews() {
+ }
+
+ override fun initViews(savedInstanceState: Bundle?) {
+ super.initViews(savedInstanceState)
+ mapBizView.onCreate(savedInstanceState)
+ }
+
+ override fun onResume() {
+ super.onResume()
+ mapBizView.onResume()
+ }
+
+ override fun onLowMemory() {
+ super.onLowMemory()
+ mapBizView.onLowMemory()
+ }
+
+ override fun onSaveInstanceState(outState: Bundle) {
+ super.onSaveInstanceState(outState)
+ mapBizView.onSaveInstanceState(outState)
+ }
+
+ override fun onPause() {
+ super.onPause()
+ mapBizView.onPause()
+ }
+
+ override fun onDestroyView() {
+ mapBizView.onDestroy()
+ super.onDestroyView()
+ }
+
+ override fun createPresenter(): PM2ADASPresenter {
+ return PM2ADASPresenter(this)
+ }
+
+ companion object {
+ private val TAG = PM2HPMapFragment::class.java.simpleName
+ }
+
+ fun setMapMaker(
+ uuid: String,
+ station: MutableList,
+ ) {
+ //开启线程执行起终点marker设置
+ val setMapMarkerRunnable = Runnable {
+ d(
+ "setMapMaker= " + Thread.currentThread().name,
+ uuid + "=latitude=" + station[1] + ",longitude=" + station[0]
+ )
+
+ val builder = Point.Options.Builder(
+ TYPE_MARKER_M2_LINE,
+ Level.MAP_MARKER
+ )
+ .setId(uuid)
+ .anchor(0.5f, 0.5f)
+ .set3DMode(true)
+ .isUseGps(true)
+ .controlAngle(true)
+ .icon3DRes(R.raw.star_marker)
+ .longitude(station[0])
+ .latitude(station[1])
+ MapDataWrapper.getCenterLineInfo(
+ station[0], station[1], -1f
+ ) {
+ // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
+ it?.let{
+ builder.rotate(it.angle.toFloat())
+ }
+ }
+ val overlayManager = getOverlayManager()
+ overlayManager?.showOrUpdatePoint(builder.build())
+ }
+ OCHThreadPoolManager.getsInstance().execute(setMapMarkerRunnable)
+ }
+
+ fun removeMapMaker(
+ uuid: String,
+ ) {
+ //开启线程移除起终点marker设置
+ val removeMapMarkerRunnable = Runnable {
+ d("RemoveMapMaker=" + Thread.currentThread().name, uuid)
+ val overlayManager = getOverlayManager()
+ overlayManager?.removeAllPointsInOwner(TYPE_MARKER_M2_LINE)
+ }
+ OCHThreadPoolManager.getsInstance().execute(removeMapMarkerRunnable)
+ }
+
+}
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/video/PM2VideoFragment.kt b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/video/PM2VideoFragment.kt
new file mode 100644
index 0000000000..7459c52dc5
--- /dev/null
+++ b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/video/PM2VideoFragment.kt
@@ -0,0 +1,64 @@
+package com.mogo.och.bus.passenger.passenger.ui.video
+
+import com.google.gson.reflect.TypeToken
+import com.mogo.commons.mvp.MvpFragment
+import com.mogo.eagle.core.data.config.FunctionBuildConfig
+import com.mogo.eagle.core.utilcode.util.GsonUtils
+import com.mogo.och.bus.passenger.R
+import com.mogo.och.bus.passenger.passenger.presenter.PM2VideoPresenter
+import com.mogo.och.common.module.wigets.video.AdsDatas
+import com.mogo.och.common.module.wigets.video.RotationItem
+import kotlinx.android.synthetic.main.bus_p_m2_video_fragment.imageVideoRotationView
+
+/**
+ * @author: wangmingjun
+ * @date: 2022/4/12
+ */
+class PM2VideoFragment :
+ MvpFragment() {
+
+ private var arrayListOf = mutableListOf()
+
+ override fun getLayoutId(): Int {
+ return R.layout.bus_p_m2_video_fragment
+ }
+
+
+ override fun createPresenter(): PM2VideoPresenter {
+ return PM2VideoPresenter(this)
+ }
+
+ companion object {
+ private val TAG = PM2VideoFragment::class.java.simpleName
+ }
+
+ override fun getTagName(): String {
+ return TAG
+ }
+
+ override fun initViews() {
+ initResourceData()
+ imageVideoRotationView.setData(arrayListOf)
+ }
+
+ override fun onPause() {
+ super.onPause()
+ imageVideoRotationView.setPause()
+ }
+
+ override fun onResume() {
+ super.onResume()
+ imageVideoRotationView.setResume()
+ }
+
+ private fun initResourceData() {
+
+ try {
+ arrayListOf.clear()
+ var datas: AdsDatas = GsonUtils.fromJson(FunctionBuildConfig.tempConfig,object : TypeToken() {}.type)
+ arrayListOf.addAll(datas.ads)
+ } catch (e: Exception) {
+ e.printStackTrace()
+ }
+ }
+}
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/M2BlueToothView.kt b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/M2BlueToothView.kt
new file mode 100644
index 0000000000..54377e1c4d
--- /dev/null
+++ b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/M2BlueToothView.kt
@@ -0,0 +1,36 @@
+package com.mogo.och.bus.passenger.passenger.ui.widget
+
+import android.content.Context
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
+import com.mogo.eagle.core.function.hmi.ui.widget.BlueToothView
+import com.mogo.eagle.core.utilcode.util.ThreadUtils
+import com.mogo.och.bus.passenger.R
+import kotlinx.android.synthetic.main.bus_p_m2_view_blue_tooth.view.blueView
+
+/**
+ * 魔戒蓝牙控件
+ * 放置于StatusBar右侧位置
+ */
+class M2BlueToothView @JvmOverloads constructor(
+ context: Context,
+ attrs: AttributeSet? = null,
+ defStyleAttr: Int = 0
+) : BlueToothView(context, attrs, defStyleAttr),IMoGoDevaToolsListener {
+
+ init {
+ LayoutInflater.from(context).inflate(R.layout.bus_p_m2_view_blue_tooth, this, true)
+ }
+
+ override fun mofangStatus(status: Boolean) {
+ ThreadUtils.runOnUiThread {
+ if (status) {
+ blueView.setImageResource(R.drawable.bus_p_m2_blue_tooth_close)
+ } else {
+ blueView.setImageResource(R.drawable.bus_p_m2_blue_tooth_open)
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/M2PTrafficLightView.kt b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/M2PTrafficLightView.kt
new file mode 100644
index 0000000000..b769b88f7d
--- /dev/null
+++ b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/M2PTrafficLightView.kt
@@ -0,0 +1,181 @@
+package com.mogo.och.bus.passenger.passenger.ui.widget
+
+import android.content.Context
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.widget.LinearLayout
+import com.mogo.eagle.core.data.enums.DataSourceType
+import com.mogo.eagle.core.data.enums.TrafficLightEnum
+import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener
+import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
+import com.mogo.eagle.core.utilcode.util.UiThreadHandler
+import com.mogo.och.bus.passenger.R
+import kotlinx.android.synthetic.main.bus_p_m2_traffic_light_view.view.m2_p_traffic_light_bg
+import kotlinx.android.synthetic.main.bus_p_m2_traffic_light_view.view.m2_p_traffic_light_iv
+import kotlinx.android.synthetic.main.bus_p_m2_traffic_light_view.view.m2_p_traffic_light_time_tv
+
+/**
+ * bus乘客端:红绿灯view
+ *
+ * Created on 2022/3/14
+ */
+class M2PTrafficLightView @JvmOverloads constructor(
+ context: Context?,
+ attrs: AttributeSet? = null,
+ defStyleAttr: Int = 0
+) : LinearLayout(context, attrs, defStyleAttr), IMoGoTrafficLightListener {
+
+ companion object {
+ private const val TAG = "M2PTrafficLightView"
+ }
+
+ private var mCurrentLightId = TrafficLightEnum.BLACK
+
+ init {
+ init(context)
+ }
+
+ private fun init(context: Context?) {
+ LayoutInflater.from(context).inflate(R.layout.bus_p_m2_traffic_light_view, this, true)
+ }
+
+ override fun onAttachedToWindow() {
+ super.onAttachedToWindow()
+ CallerTrafficLightListenerManager.addListener(TAG, this)
+ }
+
+ override fun onDetachedFromWindow() {
+ super.onDetachedFromWindow()
+ CallerTrafficLightListenerManager.removeListener(TAG)
+ }
+
+ /**
+ * 展示红绿灯预警
+ *
+ * @param checkLightId 0-都是默认,1-红,2-黄,3-绿
+ * @param lightSource 1:云端下发;2:自车感知
+ */
+ override fun showTrafficLight(checkLightId: TrafficLightEnum, lightSource: DataSourceType) {
+ super.showTrafficLight(checkLightId, lightSource)
+ mCurrentLightId = checkLightId
+ updateTrafficLightIcon(checkLightId)
+ }
+
+ /**
+ * 关闭红绿灯预警展示,并重制灯态
+ */
+ override fun disableTrafficLight() {
+ super.disableTrafficLight()
+ UiThreadHandler.post {
+ mCurrentLightId = TrafficLightEnum.BLACK
+ this@M2PTrafficLightView.visibility = GONE
+ }
+ }
+
+ /**
+ * @param redNum 红灯倒计时
+ * @param yellowNum 黄灯倒计时
+ * @param greenNum 绿灯倒计时
+ */
+ override fun changeCountdownTrafficLightNum(redNum: Int, yellowNum: Int, greenNum: Int) {
+ super.changeCountdownTrafficLightNum(redNum, yellowNum, greenNum)
+ resetView()
+ when (mCurrentLightId) {
+ TrafficLightEnum.RED -> changeCountdownRed(redNum)
+ TrafficLightEnum.YELLOW -> changeCountdownYellow(yellowNum)
+ TrafficLightEnum.GREEN -> changeCountdownGreen(greenNum)
+ else -> UiThreadHandler.post { m2_p_traffic_light_time_tv.text = "" }
+ }
+ }
+
+ override fun changeCountdownRed(redNum: Int) {
+ super.changeCountdownRed(redNum)
+ UiThreadHandler.post {
+ if (redNum > 0) {
+ resetView()
+ m2_p_traffic_light_time_tv.text = redNum.toString()
+ } else {
+ disableTrafficLightCountDown()
+ m2_p_traffic_light_time_tv.text = ""
+ }
+ }
+ }
+
+ override fun changeCountdownGreen(greenNum: Int) {
+ super.changeCountdownGreen(greenNum)
+ UiThreadHandler.post {
+ if (greenNum > 0) {
+ resetView()
+ m2_p_traffic_light_time_tv.text = greenNum.toString()
+ } else {
+ disableTrafficLightCountDown()
+ m2_p_traffic_light_time_tv.text = ""
+ }
+ }
+ }
+
+ override fun changeCountdownYellow(yellowNum: Int) {
+ super.changeCountdownYellow(yellowNum)
+ UiThreadHandler.post {
+ if (yellowNum > 0) {
+ resetView()
+ m2_p_traffic_light_time_tv.text = yellowNum.toString()
+ } else {
+ disableTrafficLightCountDown()
+ m2_p_traffic_light_time_tv.text = ""
+ }
+ }
+ }
+
+ /**
+ * 更新红绿灯icon
+ *
+ * @param lightId 0-都是默认,1-红,2-黄,3-绿
+ */
+ private fun updateTrafficLightIcon(lightId: TrafficLightEnum) {
+ UiThreadHandler.post {
+ when (lightId) {
+ TrafficLightEnum.RED -> {
+ m2_p_traffic_light_iv.setBackgroundResource(R.drawable.bus_p_m2_light_red_nor)
+ this@M2PTrafficLightView.visibility = VISIBLE
+ }
+ TrafficLightEnum.YELLOW -> {
+ m2_p_traffic_light_iv.setBackgroundResource(R.drawable.bus_p_m2_light_yellow_nor)
+ this@M2PTrafficLightView.visibility = VISIBLE
+ }
+ TrafficLightEnum.GREEN -> {
+ m2_p_traffic_light_iv.setBackgroundResource(R.drawable.bus_p_m2_light_green_nor)
+ this@M2PTrafficLightView.visibility = VISIBLE
+ }
+ else -> this@M2PTrafficLightView.visibility = GONE
+ }
+ }
+ }
+
+ override fun disableTrafficLightCountDown() {
+ super.disableTrafficLightCountDown()
+ UiThreadHandler.post {
+ val layoutParams = layoutParams
+ if (layoutParams is MarginLayoutParams) {
+ val lp = layoutParams
+ lp.width = resources.getDimension(R.dimen.dp_40).toInt()
+ setLayoutParams(lp)
+ m2_p_traffic_light_time_tv.visibility = GONE
+ m2_p_traffic_light_bg.layoutParams.width =
+ resources.getDimension(R.dimen.dp_40).toInt()
+ }
+ }
+ }
+
+ private fun resetView() {
+ val layoutParams = layoutParams
+ if (layoutParams is MarginLayoutParams) {
+ val lp = layoutParams
+ lp.width = resources.getDimension(R.dimen.dp_60).toInt()
+ setLayoutParams(lp)
+ m2_p_traffic_light_time_tv.visibility = VISIBLE
+ m2_p_traffic_light_bg.layoutParams.width =
+ resources.getDimension(R.dimen.dp_60).toInt()
+ }
+ }
+}
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/M2StatusBarView.kt b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/M2StatusBarView.kt
new file mode 100644
index 0000000000..4455fbd417
--- /dev/null
+++ b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/M2StatusBarView.kt
@@ -0,0 +1,110 @@
+package com.mogo.och.bus.passenger.passenger.ui.widget
+
+import android.annotation.*
+import android.content.Context
+import android.graphics.Color
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.constraintlayout.widget.ConstraintLayout
+import chassis.ChassisStatesOuterClass
+import com.mogo.eagle.core.function.api.autopilot.IMoGoBatteryManagementSystemListener
+import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
+import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
+import com.mogo.eagle.core.function.call.autopilot.CallerBatteryManagementSystemListenerManager
+import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
+import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
+import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
+import com.mogo.eagle.core.utilcode.kotlin.*
+import com.mogo.eagle.core.utilcode.util.ClickUtils
+import com.mogo.och.bus.passenger.R
+import kotlinx.android.synthetic.main.bus_p_m2_view_status_bar.view.progress
+import kotlinx.android.synthetic.main.bus_p_m2_view_status_bar.view.tv_power_cos
+import kotlinx.coroutines.*
+import me.jessyan.autosize.utils.AutoSizeUtils
+
+/**
+ * @author: wangmingjun
+ * @date: 2023/2/14
+ */
+class M2StatusBarView @JvmOverloads constructor(
+ context: Context, attrs: AttributeSet? = null
+) : ConstraintLayout(context, attrs), IViewControlListener, IMoGoSkinModeChangeListener,
+ IMoGoBatteryManagementSystemListener {
+
+ companion object {
+ const val TAG = "M2StatusBarView"
+ }
+
+ @Volatile
+ private var oldBmsSoc: Float = -1.0f
+
+ init {
+ LayoutInflater.from(context).inflate(R.layout.bus_p_m2_view_status_bar, this, true)
+ setBackgroundColor(Color.parseColor("#80FFFFFF"))
+ isClickable = true
+ isFocusable = true
+ }
+
+
+ @SuppressLint("ClickableViewAccessibility")
+ override fun onAttachedToWindow() {
+ super.onAttachedToWindow()
+ post {
+ val params: ViewGroup.LayoutParams = getLayoutParams()
+ params.height = AutoSizeUtils.dp2px(context,40f)
+ layoutParams = params
+ }
+ //添加view控制
+ CallerHmiViewControlListenerManager.addListener(TAG,this)
+ // 添加换肤监听
+ CallerSkinModeListenerManager.addListener(TAG, this)
+ //电量
+ CallerBatteryManagementSystemListenerManager.addListener(TAG,this)
+
+ progress?.also {
+ it.progress = 50
+ }
+ tv_power_cos?.also {
+ it.text = "50%"
+ }
+ }
+
+ override fun onSkinModeChange(skinMode: Int) {
+ when (skinMode) {
+ 0 -> setStatusBarDarkOrLight(false)
+ 1 -> setStatusBarDarkOrLight(true)
+ }
+ }
+
+ override fun onDetachedFromWindow() {
+ super.onDetachedFromWindow()
+ CallerHmiViewControlListenerManager.removeListener(TAG)
+ CallerSkinModeListenerManager.removeListener(TAG)
+ CallerDevaToolsManager.hideStatusBar()
+ }
+
+ @SuppressLint("SetTextI18n")
+ override fun onBatteryManagementSystemStates(states: ChassisStatesOuterClass.BMSSystemStates) {
+ if (ClickUtils.isClickTooFrequent(this,1000)) {
+ return
+ }
+ val bmsSoc = states.bmsSoc
+ try {
+ if (oldBmsSoc != bmsSoc ) {
+ scope.launch {
+ if(bmsSoc >1){
+ progress?.also { it.progress = bmsSoc.toInt() }
+ tv_power_cos?.also { it.text = "${bmsSoc.toInt()}%" }
+ }else{
+ val power = (bmsSoc * 100).toInt()
+ progress?.also { it.progress = power }
+ tv_power_cos?.also {it.text = "$power%" }
+ }
+ }
+ }
+ } finally {
+ oldBmsSoc = bmsSoc
+ }
+ }
+}
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/M2TurnLightView.kt b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/M2TurnLightView.kt
new file mode 100644
index 0000000000..f280b6eb1f
--- /dev/null
+++ b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/M2TurnLightView.kt
@@ -0,0 +1,199 @@
+package com.mogo.och.bus.passenger.passenger.ui.widget
+
+import android.animation.AnimatorSet
+import android.animation.ObjectAnimator
+import android.content.Context
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.view.View
+import android.view.animation.AlphaAnimation
+import android.view.animation.Animation
+import android.widget.ImageView
+import androidx.constraintlayout.widget.ConstraintLayout
+import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTurnLightListener
+import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
+import com.mogo.eagle.core.function.call.v2x.CallerTurnLightListenerManager
+import com.mogo.eagle.core.utilcode.util.ThreadUtils
+import com.mogo.och.bus.passenger.R
+import com.mogo.och.common.module.manager.lightmanager.TurnLightManager
+import kotlinx.android.synthetic.main.bus_p_m2_turn_light_status.view.left_nor_image
+import kotlinx.android.synthetic.main.bus_p_m2_turn_light_status.view.left_select_image
+import kotlinx.android.synthetic.main.bus_p_m2_turn_light_status.view.right_nor_image
+import kotlinx.android.synthetic.main.bus_p_m2_turn_light_status.view.right_select_image
+import kotlinx.android.synthetic.main.bus_p_m2_turn_light_status.view.turn_light_layout
+
+/**
+ * @author: wangmingjun
+ * @date: 2023/2/13
+ */
+class M2TurnLightView @JvmOverloads constructor(
+ context: Context,
+ attrs: AttributeSet? = null,
+ defStyleAttr: Int = 0
+) : ConstraintLayout(context, attrs, defStyleAttr),
+ IMoGoTurnLightListener, TurnLightManager.TurnLightListener {
+
+
+ companion object {
+ private const val TAG = "TurnLightViewStatus"
+ }
+
+ private var isLeftLight: Boolean = false
+ private var isRightLight: Boolean = false
+ private var isDisappear: Boolean = false
+
+ init {
+ LayoutInflater.from(context)
+ .inflate(R.layout.bus_p_m2_turn_light_status, this, true)
+ }
+
+ override fun onAttachedToWindow() {
+ super.onAttachedToWindow()
+ CallerTurnLightListenerManager.addListener(TAG,this)
+
+ TurnLightManager.addTurnLightStatusChangeListener(TAG,this)
+ }
+
+ override fun onDetachedFromWindow() {
+ super.onDetachedFromWindow()
+ CallerChassisLamplightListenerManager.removeListener(TAG)
+ CallerTurnLightListenerManager.removeListener(TAG)
+ }
+
+ override fun hideTurnLightView() {
+ ThreadUtils.runOnUiThread{
+ if (!isDisappear) {
+ isDisappear = true
+ isLeftLight = false
+ isRightLight = false
+ animationDisappear()
+ }
+ }
+ }
+
+ override fun statusChange(newStatus: TurnLightManager.TurnLightStatus) {
+ ThreadUtils.runOnUiThread {
+ setTurnLight(newStatus)
+ }
+ }
+
+ /**
+ * 转向灯动画
+ */
+ private fun setTurnLight(directionLight: TurnLightManager.TurnLightStatus) {
+ if (!isAttachedToWindow) {
+ return
+ }
+ //根据左右进行显示和隐藏,实际要判断每个来的时间和频度
+ when (directionLight) {
+ TurnLightManager.TurnLightStatus.TURN_LIGHT_LEFT -> { //左转向
+ if (!isLeftLight) {
+ isLeftLight = true
+ isRightLight = false
+ isDisappear = false
+ showNormalAnimation()
+ left_select_image.visibility = View.VISIBLE
+ right_select_image.visibility = View.GONE
+ right_select_image.clearAnimation()
+ setAnimation(left_select_image)
+ }
+ }
+ TurnLightManager.TurnLightStatus.TURN_LIGHT_RIGHT -> { //右转向
+ if (!isRightLight) {
+ isRightLight = true
+ isLeftLight = false
+ isDisappear = false
+ showNormalAnimation()
+ left_select_image.visibility = View.GONE
+ right_select_image.visibility = View.VISIBLE
+ left_select_image.clearAnimation()
+ setAnimation(right_select_image)
+ }
+ }
+ TurnLightManager.TurnLightStatus.TURN_LIGHT_NONE -> { //消失
+ if (!isDisappear) {
+ isDisappear = true
+ isLeftLight = false
+ isRightLight = false
+ animationDisappear()
+ }
+ }
+ }
+ }
+
+ //显示背景
+ private fun showNormalAnimation() {
+ val appearAnimation = AlphaAnimation(0f, 1.0f)
+ appearAnimation.duration = 300
+ val appearAnimationImage = AlphaAnimation(0f, 1.0f)
+ appearAnimation.duration = 500
+ turn_light_layout.startAnimation(appearAnimation)
+ left_nor_image.startAnimation(appearAnimationImage)
+ right_nor_image.startAnimation(appearAnimationImage)
+
+ turn_light_layout.visibility = View.VISIBLE
+ left_nor_image.visibility = View.VISIBLE
+ right_nor_image.visibility = View.VISIBLE
+ }
+
+ //消失动画,当转向等数据为空时候
+ private fun animationDisappear() {
+ left_select_image.visibility = View.GONE
+ right_select_image.visibility = View.GONE
+ left_select_image.clearAnimation()
+ right_select_image.clearAnimation()
+
+ left_nor_image.clearAnimation()
+ right_nor_image.clearAnimation()
+ turn_light_layout.clearAnimation()
+
+ val disappearAnimationLeft = AlphaAnimation(1.0f, 0f)
+ disappearAnimationLeft.duration = 300
+
+ val disappearAnimationBg = AlphaAnimation(1.0f, 0f)
+ disappearAnimationBg.duration = 500
+
+ left_nor_image.startAnimation(disappearAnimationLeft)
+ right_nor_image.startAnimation(disappearAnimationLeft)
+ turn_light_layout.startAnimation(disappearAnimationBg)
+
+ disappearAnimationLeft.setAnimationListener(object : Animation.AnimationListener {
+ override fun onAnimationRepeat(p0: Animation?) {
+ }
+
+ override fun onAnimationStart(p0: Animation?) {
+ }
+
+ override fun onAnimationEnd(p0: Animation?) {
+ left_nor_image.visibility = View.GONE
+ right_nor_image.visibility = View.GONE
+ }
+ })
+
+ disappearAnimationBg.setAnimationListener(object : Animation.AnimationListener {
+ override fun onAnimationRepeat(p0: Animation?) {
+ }
+
+ override fun onAnimationStart(p0: Animation?) {
+ }
+
+ override fun onAnimationEnd(p0: Animation?) {
+ turn_light_layout.visibility = View.GONE
+ }
+ })
+ }
+
+ //实现图片闪烁效果
+ private fun setAnimation(imageView: ImageView) {
+ val animationSet = AnimatorSet()
+ val valueAnimator = ObjectAnimator.ofFloat(imageView, "alpha", 0f, 1.0f)
+ val valueAnimatorDisappear = ObjectAnimator.ofFloat(imageView, "alpha", 1.0f, 0f)
+ valueAnimator.duration = 1000
+ valueAnimatorDisappear.duration = 800
+ valueAnimator.repeatCount = -1
+ valueAnimatorDisappear.repeatCount = -1
+ animationSet.playTogether(valueAnimatorDisappear, valueAnimator)
+ animationSet.start()
+ }
+
+}
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/AdvanceGSYVideoPlayer.kt b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/AdvanceGSYVideoPlayer.kt
new file mode 100644
index 0000000000..8fe325db3e
--- /dev/null
+++ b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/AdvanceGSYVideoPlayer.kt
@@ -0,0 +1,137 @@
+package com.mogo.och.bus.passenger.passenger.ui.widget.video
+
+import android.content.Context
+import android.media.AudioManager
+import android.util.AttributeSet
+import com.mogo.eagle.core.utilcode.mogo.logger.Logger
+import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
+import com.shuyu.gsyvideoplayer.utils.GSYVideoType
+import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
+import me.jessyan.autosize.utils.AutoSizeUtils
+
+/**
+ * @author: wangmingjun
+ * @date: 2023/2/17
+ * 隐藏所有控件的player
+ */
+class AdvanceGSYVideoPlayer: StandardGSYVideoPlayer {
+ constructor(context: Context?) : super(context)
+ constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
+
+ init {
+ hideWidget()
+ GSYVideoType.setShowType(GSYVideoType.SCREEN_TYPE_16_9)
+ GSYVideoType.setRenderType(GSYVideoType.GLSURFACE)
+ }
+
+ override fun hideAllWidget() {
+ Logger.d(ImageAndVideoRotation.TAG, "hideAllWidget")
+// hideWidget()
+ }
+
+ override fun changeUiToNormal() {
+ Logger.d(ImageAndVideoRotation.TAG, "changeUiToNormal-hide")
+ hideWidget()
+ }
+
+ override fun changeUiToPreparingShow() {
+ Logger.d(ImageAndVideoRotation.TAG, "changeUiToPreparingShow-hide")
+ hideWidget()
+ }
+
+ override fun changeUiToPlayingShow() {
+ Logger.d(ImageAndVideoRotation.TAG, "changeUiToPlayingShow")
+ setCacheImageViewGone()
+ }
+
+ override fun changeUiToPauseShow() {
+ Logger.d(ImageAndVideoRotation.TAG, "changeUiToPauseShow-hide")
+ startPlayLogic()
+// hideWidget()
+ }
+
+ override fun changeUiToCompleteShow() {
+ Logger.d(ImageAndVideoRotation.TAG, "changeUiToCompleteShow")
+ setCacheImageViewGone()
+ }
+
+ override fun changeUiToPlayingBufferingShow() {
+ Logger.d(ImageAndVideoRotation.TAG, "changeUiToPlayingBufferingShow -hide")
+ hideWidget()
+ }
+
+ override fun changeUiToError() {
+ Logger.d(ImageAndVideoRotation.TAG, "changeUiToError-hide")
+ hideWidget()
+ }
+
+ private fun hideWidget(){
+ setViewShowState(mBottomContainer, INVISIBLE)
+ setViewShowState(mProgressBar, INVISIBLE)
+ setViewShowState(mCurrentTimeTextView, INVISIBLE)
+ setViewShowState(mTotalTimeTextView, INVISIBLE)
+ setViewShowState(mBottomProgressBar, INVISIBLE)
+ setViewShowState(mBackButton, INVISIBLE)
+ setViewShowState(mStartButton, INVISIBLE)
+
+ setViewShowState(mThumbImageViewLayout, VISIBLE)
+ setViewShowState(mThumbImageView, VISIBLE)
+
+ setViewShowState(mTopContainer, INVISIBLE)
+
+ setViewShowState(mLoadingProgressBar, INVISIBLE)
+ setViewShowState(
+ mLockScreen, INVISIBLE
+ )
+
+ setIsTouchWiget(false)
+ isFocusableInTouchMode = false
+ }
+
+ fun setCacheImageViewVisible() {
+ Logger.d(ImageAndVideoRotation.TAG, "CacheImageViewVISIBLE")
+ setViewShowState(mThumbImageViewLayout, VISIBLE)
+// setViewShowState(mThumbImageView, VISIBLE)
+ }
+
+ fun setCacheImageViewGone() {
+ Logger.d(ImageAndVideoRotation.TAG, "CacheImageViewGONE")
+ setViewShowState(mThumbImageViewLayout, INVISIBLE)
+// setViewShowState(mThumbImageView, INVISIBLE)
+ }
+
+ //失去焦点声音压低
+ override fun onLossTransientCanDuck() {
+// setStreamVolume(0.2f)
+ setNeedMute(true)
+ }
+
+ //获取焦点声音恢复
+ override fun onGankAudio() {
+// setStreamVolume(5.0f)
+ setNeedMute(false)
+ }
+
+ private fun setStreamVolume(percent: Float){
+ var mAudioManager = mContext?.getSystemService(Context.AUDIO_SERVICE) as AudioManager
+ var maxVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC)
+ var volume = (percent * maxVolume).toInt()
+ if (volume < 0 ){
+ volume = 0
+ }
+ mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC,volume,0)
+ }
+
+ private fun setNeedMute(isMute: Boolean){
+ gsyVideoManager?.player?.setNeedMute(isMute)
+ }
+
+ override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
+ super.onSizeChanged(w, h, oldw, oldh)
+ if (!mIfCurrentIsFullscreen) {
+ val dp2px = AutoSizeUtils.dp2px(context, 16f)
+ this.outlineProvider = TextureVideoViewOutlineProvider(dp2px.toFloat())
+ this.clipToOutline = true
+ }
+ }
+}
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/AdvanceImageView.kt b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/AdvanceImageView.kt
new file mode 100644
index 0000000000..6ec0d9d997
--- /dev/null
+++ b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/AdvanceImageView.kt
@@ -0,0 +1,45 @@
+package com.mogo.och.bus.passenger.passenger.ui.widget.video
+
+import android.annotation.SuppressLint
+import android.content.Context
+import android.util.AttributeSet
+import android.widget.ImageView
+import android.widget.RelativeLayout
+import com.bumptech.glide.Glide
+import com.bumptech.glide.request.RequestOptions
+import com.mogo.och.bus.passenger.R
+
+/**
+ * @author: wangmingjun
+ * @date: 2023/2/6
+ */
+class AdvanceImageView @JvmOverloads constructor(
+ context: Context, attrs: AttributeSet? = null
+) : RelativeLayout(context, attrs) {
+
+ private var imageView: ImageView? = null
+
+ init {
+ initView()
+ }
+
+ private fun initView() {
+ imageView = ImageView(context)
+ imageView?.scaleType = ImageView.ScaleType.FIT_XY
+ addView(imageView, LayoutParams(-1, -1))
+ }
+
+ @SuppressLint("CheckResult")
+ fun setImagePath(path: String){
+ imageView?.setImageResource(R.drawable.bus_p_m2_p_video_holder)
+ imageView?.let { Glide.with(context).asBitmap().load(path)
+ .apply(
+ RequestOptions().useUnlimitedSourceGeneratorsPool(true)
+ .placeholder(R.drawable.bus_p_m2_p_video_holder)
+ .error(R.drawable.bus_p_m2_p_video_holder)
+ .fallback(R.drawable.bus_p_m2_p_video_holder)
+ .centerCrop()
+ )
+ .into(it) }
+ }
+}
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/AdvancePagerAdapter.kt b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/AdvancePagerAdapter.kt
new file mode 100644
index 0000000000..422bb1aa15
--- /dev/null
+++ b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/AdvancePagerAdapter.kt
@@ -0,0 +1,212 @@
+package com.mogo.och.bus.passenger.passenger.ui.widget.video
+
+import android.content.Context
+import android.view.View
+import android.view.ViewGroup
+import androidx.viewpager.widget.PagerAdapter
+import androidx.viewpager.widget.ViewPager
+import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
+import com.mogo.eagle.core.utilcode.mogo.logger.Logger
+import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
+import com.mogo.eagle.core.utilcode.util.CountDownTimer
+import com.mogo.och.common.module.wigets.video.RotationItem
+import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
+
+/**
+ * @author: wangmingjun
+ * @date: 2023/2/6
+ */
+class AdvancePagerAdapter(context: Context, viewPager: ViewPager) : PagerAdapter(),
+ ViewPager.OnPageChangeListener {
+
+ private val mContext: Context = context
+ private val mViewPager: ViewPager = viewPager
+
+ private var dataList = mutableListOf()
+ private var viewList = mutableListOf()
+
+ private var lastPosition = -1
+
+ private var current = 0
+ private val time = 5000
+ private var pause = false
+ private var countDownTimer: CountDownTimer? = null
+
+ fun setData(list: MutableList) {
+ if (list.isEmpty()) return
+ dataList.addAll(list)
+
+ viewList.clear()
+
+ list.forEach {
+ addView(it)
+ }
+
+ mViewPager.addOnPageChangeListener(this)
+
+ notifyDataSetChanged()
+
+ mViewPager.currentItem = 0
+
+ if (viewList.size > 0) {
+ if (viewList[mViewPager.currentItem] is AdvanceVideoView) {//有人反应第一个是视频不播放这边优化了一下
+ Logger.d(ImageAndVideoRotation.TAG, "第一个是视频")
+ val video = viewList[mViewPager.currentItem] as AdvanceVideoView
+ video.setVideo(gsySampleCallBack)
+
+ } else if (viewList[mViewPager.currentItem] is AdvanceImageView) {
+ Logger.d(ImageAndVideoRotation.TAG, "startTimer()_1")
+ current = 0//换页重新计算时间
+ startTimer()
+ }
+ }
+ }
+
+ override fun getCount(): Int {
+ return dataList.size
+ }
+
+ override fun isViewFromObject(view: View, `object`: Any): Boolean {
+ return view === `object`
+ }
+
+ override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
+ container.removeView(viewList[position])
+ }
+
+ override fun instantiateItem(container: ViewGroup, position: Int): Any {
+ val view: View = viewList[position]
+ container.addView(view)
+ return view
+
+ }
+
+ override fun getItemPosition(`object`: Any): Int {
+ return POSITION_NONE
+ }
+
+ private fun addView(item: RotationItem) {
+ if (item.type == 1) { // 表示视频
+ val videoView = AdvanceVideoView(mContext)
+ videoView.setVideoPath(item.path,item.cacheImgPath)
+ viewList.add(videoView)
+ } else { // 表示图片
+ val imageView = AdvanceImageView(mContext)
+ imageView.setImagePath(item.path)
+ viewList.add(imageView)
+ }
+ }
+
+ fun setPause() {
+ pause = true
+ if (viewList.size > 0 && viewList[mViewPager.currentItem] is AdvanceVideoView) {
+ val videoView = viewList[mViewPager.currentItem] as AdvanceVideoView
+ videoView.setPause()
+ }
+ }
+
+ fun setResume() {
+ pause = false
+ if (viewList.size > 0 && viewList[mViewPager.currentItem] is AdvanceVideoView) {
+ val videoView = viewList[mViewPager.currentItem] as AdvanceVideoView
+ videoView.setResume()
+ }
+ }
+
+ override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
+ }
+
+ override fun onPageSelected(position: Int) {
+ }
+
+ override fun onPageScrollStateChanged(state: Int) {
+ // 由于viewpager的预加载机制onPageSelected这里面加载videoview 放的跟玩一样 等操作完成后再播放videoview就香了 很丝滑
+ if (state == 0) { //静止,什么都没做
+ val currentItem = mViewPager.currentItem
+ Logger.d(
+ ImageAndVideoRotation.TAG,
+ "state = $state currentItem = $currentItem lastPosition = $lastPosition")
+
+ if (viewList.size > 1) { //多于1,才会循环跳转
+
+ if (viewList[mViewPager.currentItem] is AdvanceVideoView) {
+
+ val videoView = (viewList[mViewPager.currentItem] as AdvanceVideoView)
+ videoView.setCacheImageViewVisible()
+ videoView.setVideo(gsySampleCallBack)
+
+ } else if (viewList[mViewPager.currentItem] is AdvanceImageView) {
+ Logger.d(ImageAndVideoRotation.TAG, "startTimer()")
+ current = 0//换页重新计算时间
+ startTimer()
+ }
+ lastPosition = mViewPager.currentItem
+ }
+ }
+ }
+
+ private var gsySampleCallBack = object : GSYSampleCallBack() {
+
+ override fun onPrepared(url: String?, vararg objects: Any?) {
+ Logger.d(ImageAndVideoRotation.TAG, "onPrepared--$url")
+ }
+
+ override fun onAutoComplete(url: String?, vararg objects: Any?) {
+ Logger.d(ImageAndVideoRotation.TAG, "onAutoComplete()-$url")
+ if (viewList[mViewPager.currentItem] is AdvanceVideoView){
+ val videoView = (viewList[mViewPager.currentItem] as AdvanceVideoView)
+ if (viewList.size == 1){
+ videoView.startPlay(url)
+ }else{
+ videoView.onVideoReset()
+ goNextItemView()
+ }
+ }
+ }
+
+ override fun onPlayError(url: String?, vararg objects: Any?) {
+ super.onPlayError(url, *objects)
+ Logger.d(ImageAndVideoRotation.TAG, "onPlayError()-$url")
+ if (viewList[mViewPager.currentItem] is AdvanceVideoView){
+ val videoView = (viewList[mViewPager.currentItem] as AdvanceVideoView)
+ videoView.onVideoReset()
+// videoView.setCacheImageViewVisible()
+ videoView.clearLocalErrorVideo()
+ goNextItemView()
+ }
+ }
+ }
+
+ private fun startTimer() {
+ if (countDownTimer != null){
+ countDownTimer?.cancel()
+ countDownTimer = null
+ }
+ countDownTimer = object : CountDownTimer(5000,1000){
+ override fun onTick(millisUntilFinished: Long) {
+ d(SceneConstant.M_BUS_P + "startTimer", "倒计时秒 = ${millisUntilFinished/1000}" )
+ }
+
+ override fun onFinish() {
+ d(ImageAndVideoRotation.TAG + "startTimer", "5s到,跳转")
+ goNextItemView()
+ }
+
+ }.start()
+ }
+
+ /**
+ * view 跳转
+ */
+ private fun goNextItemView() {
+ if (mViewPager.currentItem == viewList.size - 1) {//已经到最后一个
+ mViewPager.post {
+ mViewPager.setCurrentItem(0, true)
+ }
+ } else {
+ mViewPager.post {
+ mViewPager.setCurrentItem(mViewPager.currentItem + 1, true)
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/AdvanceVideoView.kt b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/AdvanceVideoView.kt
new file mode 100644
index 0000000000..f6bc20e3cd
--- /dev/null
+++ b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/AdvanceVideoView.kt
@@ -0,0 +1,254 @@
+package com.mogo.och.bus.passenger.passenger.ui.widget.video
+
+import android.annotation.SuppressLint
+import android.content.Context
+import android.net.Uri
+import android.util.AttributeSet
+import android.widget.ImageView
+import android.widget.RelativeLayout
+import com.mogo.eagle.core.utilcode.download.*
+import com.mogo.eagle.core.utilcode.download.callback.*
+import com.mogo.eagle.core.utilcode.mogo.logger.Logger
+import com.mogo.eagle.core.utilcode.util.FileUtils
+import com.mogo.eagle.core.utilcode.util.ThreadUtils
+import com.mogo.eagle.core.utilcode.util.UiThreadHandler
+import com.mogo.och.bus.passenger.R
+import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
+import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
+import java.io.File
+
+/**
+ * @author: wangmingjun
+ * @date: 2023/2/8
+ */
+class AdvanceVideoView @JvmOverloads constructor(
+ context: Context, attrs: AttributeSet? = null
+) : RelativeLayout(context, attrs) {
+
+ private var videoRelativeLayout: RelativeLayout? = null
+ private var cacheImage: ImageView? = null
+
+ private var videoViewPlayer: AdvanceGSYVideoPlayer? = null
+ private var gsyVideoOptionBuilder: GSYVideoOptionBuilder? = null
+ private var mOnCompletionListener: GSYSampleCallBack? = null
+ private var downloadVideoName = ""
+ private var fileNetPath: String? = ""
+ private var cacheImageUrl: String? = ""
+ private var mVideoDirPath: String? = ""
+
+ init {
+ mVideoDirPath = context.filesDir.absolutePath + File.separator + "video" + File.separator
+// mVideoDirPath = Config.downLoadPath
+ initView()
+ }
+
+ private fun initView() {
+ initVideoView()
+ initCacheImgView()
+ }
+
+ private fun initCacheImgView() {
+ cacheImage = ImageView(context)
+ cacheImage?.scaleType = ImageView.ScaleType.FIT_XY
+// addView(cacheImage, LayoutParams(-1, -1))
+ }
+
+ private fun initVideoView() {
+ videoRelativeLayout = RelativeLayout(context)
+ val outLayout = LayoutParams(-1, -1)
+ addView(videoRelativeLayout, outLayout)
+
+ if (videoViewPlayer === null) {
+ //视频播放控件
+ videoViewPlayer = AdvanceGSYVideoPlayer(context)
+ }
+
+ val layoutParams = LayoutParams(-1, -1)
+ //设置videoview占满父view播放
+ layoutParams.addRule(ALIGN_PARENT_LEFT)
+ layoutParams.addRule(ALIGN_PARENT_RIGHT)
+ layoutParams.addRule(ALIGN_PARENT_TOP)
+ layoutParams.addRule(ALIGN_PARENT_BOTTOM)
+
+ videoRelativeLayout?.addView(videoViewPlayer, layoutParams)
+ }
+
+ fun setVideoPath(path: String, cacheImageUrl: String) {
+ // https://img.zhidaohulian.com/fileServer/online_car_hailing/1676357834634/5.m4v
+ // https://img.zhidaohulian.com/fileServer/online_car_hailing/1676360274126/10.mp4
+ this.fileNetPath = path
+ this.cacheImageUrl = cacheImageUrl
+ val pathList = path.split("/")
+ if (pathList.isNotEmpty()) {
+ this.downloadVideoName = pathList[pathList.size - 1]
+ }
+ }
+
+ private fun loadCacheImg() {
+ // BitmapHelper.getVideoThumbnail(path) /*获取第一帧图*
+// OCHThreadPoolManager.getsInstance().execute {
+// var bitmap = BitmapHelper.getVideoThumbnail(fileNetPath)
+ Logger.d(ImageAndVideoRotation.TAG, "setVideoPath")
+// ThreadUtils.runOnUiThread {
+// Logger.d(ImageAndVideoRotation.TAG, "bitmap加载")
+ cacheImage?.setImageResource(R.drawable.bus_p_m2_p_video_holder)
+// cacheImage?.let { //暂时去掉加载首帧图,加载视频时,用本地默认图
+// Glide.with(context).asBitmap().load(cacheImageUrl)
+// .apply(
+// RequestOptions().useUnlimitedSourceGeneratorsPool(true)
+// .placeholder(R.drawable.m2_p_video_holder)
+// .error(R.drawable.m2_p_video_holder)
+// .fallback(R.drawable.m2_p_video_holder)
+// .centerCrop()
+// )
+// .into(it)
+// }
+ videoViewPlayer?.thumbImageView = cacheImage
+// setCacheImageViewVisible()
+// }
+// }
+ }
+
+ fun clearLocalErrorVideo() {
+ if (downloadVideoName.isNotEmpty()
+ && FileUtils.isFileExists(mVideoDirPath + downloadVideoName)
+ ) {
+ FileUtils.delete(mVideoDirPath + downloadVideoName)
+ }
+ }
+
+ @SuppressLint("CheckResult")
+ fun setCacheImageViewVisible() {
+ UiThreadHandler.post {
+// cacheImage?.visibility = VISIBLE
+ videoViewPlayer?.setCacheImageViewVisible()
+ }
+ }
+
+ fun setCacheImageViewGone() {
+ UiThreadHandler.post {
+// cacheImage?.visibility = GONE
+ videoViewPlayer?.setCacheImageViewGone()
+ }
+
+ }
+
+ fun setVideo(onCompletionListener: GSYSampleCallBack) {
+ loadCacheImg()
+ Logger.d(ImageAndVideoRotation.TAG, "setVideo")
+ mOnCompletionListener = onCompletionListener
+ //判断是否已经下载
+ if (downloadVideoName.isNotEmpty()) {
+ Logger.d(
+ ImageAndVideoRotation.TAG,
+ "video local url = $mVideoDirPath$downloadVideoName"
+ )
+ if (FileUtils.isFileExists(mVideoDirPath + downloadVideoName)) {
+ Logger.d(ImageAndVideoRotation.TAG, "have cache startPlay")
+ startPlay(Uri.fromFile(File(mVideoDirPath + downloadVideoName)).toString())
+ return
+ }
+ startDownLoadVideo()
+ }
+ }
+
+ private fun startDownLoadVideo() {
+ //下载视频, 下载成功后再播放
+ Logger.d(ImageAndVideoRotation.TAG, "startDownLoadVideo")
+ FileUtils.createFileDir(mVideoDirPath)
+ val downloadUrl = fileNetPath
+ val downloadDir = mVideoDirPath
+ if (downloadUrl != null && downloadDir != null) {
+ DownloadUtils.downLoad(
+ context, downloadUrl, downloadDir, downloadVideoName, downListener
+ )
+ }
+ }
+
+ fun startPlay(localVideoPath: String?) {
+ if (localVideoPath === "") return
+ try {
+ Logger.d(ImageAndVideoRotation.TAG, "startPlay")
+ gsyVideoOptionBuilder = GSYVideoOptionBuilder()
+ gsyVideoOptionBuilder
+// ?.setUrl("file:///mnt/sdcard/downloads/$downloadVideoName")
+ ?.setUrl(localVideoPath) // "/data/user/0/com.mogo.launcher.f/files/video/"
+ ?.setPlayTag(downloadVideoName)
+ ?.setCacheWithPlay(false)
+ ?.setThumbPlay(false)
+ ?.build(videoViewPlayer)
+
+ videoViewPlayer?.isFocusableInTouchMode = false
+ videoViewPlayer?.setVideoAllCallBack(mOnCompletionListener)
+ videoViewPlayer?.startPlayLogic()
+ } catch (e: Exception) {
+ Logger.d(ImageAndVideoRotation.TAG, "startPlay e = ${e.message}")
+ }
+ }
+
+ fun onVideoReset() {
+ videoViewPlayer?.onVideoReset()
+ mOnCompletionListener = null
+ }
+
+ fun setPause() {
+ if (videoViewPlayer !== null) {
+ videoViewPlayer?.onVideoPause()
+ }
+ }
+
+ fun setResume() {
+ if (videoViewPlayer !== null) {
+ videoViewPlayer?.onVideoResume()
+ }
+ }
+
+ private val downListener = object : IDownloadListener {
+ override fun onStart(url: String) {
+ setCacheImageViewVisible()
+ Logger.d(ImageAndVideoRotation.TAG, "download-onStart")
+ }
+
+// override fun onPause(url: String, threadBean: ThreadBean?) {
+// Logger.d(ImageAndVideoRotation.TAG, "download-onPause")
+//// UiThreadHandler.postDelayed(Runnable {
+//// startDownLoadVideo()
+//// },DOWNLOAD_DELAY)
+// // todo 测试下网络断掉是否会走onpause,且网络回复也不会继续下载
+// }
+
+ override fun onProgress(url: String, downloaded: Long, total: Long) {
+ Logger.d(ImageAndVideoRotation.TAG, "download-onProgress== ${ (downloaded * 1.0f * 100/total).toInt() }")
+ }
+
+ override fun onFinished(url: String, path: String) {
+ Logger.d(ImageAndVideoRotation.TAG, "download-onFinished = $url")
+ if (url.equals(fileNetPath)) { //发现下载工具在断网又连网后,已完成的任务又都下载,跳转播放出现问题
+ //下载完成
+ ThreadUtils.runOnUiThread {
+ startPlay(Uri.fromFile(File(path)).toString())
+ }
+ } else {//如果当前文件不存在再次去下载当前的
+ Logger.d(
+ ImageAndVideoRotation.TAG, "download-onFinished = not current" +
+ ",currentUrl = $fileNetPath "
+ )
+ if (FileUtils.isFileExists(path)) {
+ Logger.d(ImageAndVideoRotation.TAG, "have download startPlay")
+ ThreadUtils.runOnUiThread {
+ startPlay(Uri.fromFile(File(path)).toString())
+ }
+ return
+ } else {
+ startDownLoadVideo()
+ }
+ }
+ }
+
+ override fun onError(url: String, error: String?) {
+ Logger.d(ImageAndVideoRotation.TAG, "download-onError-$error")
+ //出错再次下载
+ startDownLoadVideo()
+ }
+ }
+}
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/AdvanceViewPager.kt b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/AdvanceViewPager.kt
new file mode 100644
index 0000000000..7bcb5ac291
--- /dev/null
+++ b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/AdvanceViewPager.kt
@@ -0,0 +1,24 @@
+package com.mogo.och.bus.passenger.passenger.ui.widget.video
+
+import android.content.Context
+import android.util.AttributeSet
+import android.view.MotionEvent
+import androidx.viewpager.widget.ViewPager
+
+/**
+ * @author: wangmingjun
+ * @date: 2023/2/21
+ */
+class AdvanceViewPager: ViewPager{
+
+ constructor(context: Context) : super(context)
+ constructor(context: Context,attrs: AttributeSet?) : super(context,attrs)
+
+ override fun onTouchEvent(ev: MotionEvent?): Boolean {
+ return false
+ }
+
+ override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean {
+ return false
+ }
+}
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/ImageAndVideoRotation.kt b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/ImageAndVideoRotation.kt
new file mode 100644
index 0000000000..651b840c14
--- /dev/null
+++ b/OCH/bus/passenger/src/main/java/m2/com/mogo/och/bus/passenger/passenger/ui/widget/video/ImageAndVideoRotation.kt
@@ -0,0 +1,50 @@
+package com.mogo.och.bus.passenger.passenger.ui.widget.video
+
+import android.annotation.SuppressLint
+import android.content.Context
+import android.util.AttributeSet
+import android.widget.RelativeLayout
+import com.mogo.och.bus.passenger.passenger.ui.widget.video.AdvancePagerAdapter
+import com.mogo.och.bus.passenger.passenger.ui.widget.video.AdvanceViewPager
+import com.mogo.och.common.module.wigets.video.RotationItem
+
+/**
+ * @author: wangmingjun
+ * @date: 2023/2/6
+ */
+class ImageAndVideoRotation @JvmOverloads constructor(
+ context: Context, attrs: AttributeSet? = null
+) : RelativeLayout(context, attrs) {
+
+ private var viewPager: AdvanceViewPager? = null
+ private var pagerAdapter: AdvancePagerAdapter? = null
+
+ companion object {
+ const val TAG = "ImageAndVideoRotation"
+ }
+
+ init {
+ initView()
+ }
+
+ @SuppressLint("ClickableViewAccessibility")
+ private fun initView() {
+ viewPager = AdvanceViewPager(context)
+ pagerAdapter = AdvancePagerAdapter(context, viewPager!!)
+ viewPager?.adapter = pagerAdapter
+
+ addView(viewPager, LayoutParams(-1, -1))
+ }
+
+ fun setData(list: MutableList){
+ pagerAdapter?.setData(list)
+ }
+
+ fun setPause(){
+ pagerAdapter?.setPause()
+ }
+
+ fun setResume(){
+ pagerAdapter?.setResume()
+ }
+}
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_amap_arrived_road.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_amap_arrived_road.png
new file mode 100644
index 0000000000..f4d80f4cc7
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_amap_arrived_road.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_amap_arriving_road.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_amap_arriving_road.png
new file mode 100644
index 0000000000..a9aae488fb
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_amap_arriving_road.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_amap_custom_corner.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_amap_custom_corner.png
new file mode 100644
index 0000000000..6f0795edaf
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_amap_custom_corner.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_arrived_an_0.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_arrived_an_0.png
new file mode 100644
index 0000000000..62ed7bb92d
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_arrived_an_0.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_arrived_an_1.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_arrived_an_1.png
new file mode 100644
index 0000000000..34f7c0e1f2
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_arrived_an_1.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_arrived_an_2.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_arrived_an_2.png
new file mode 100644
index 0000000000..8b4b214814
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_arrived_an_2.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_auto_button_bg.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_auto_button_bg.png
new file mode 100644
index 0000000000..fb4ddc5279
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_auto_button_bg.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_bg_driving_info_image.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_bg_driving_info_image.png
new file mode 100644
index 0000000000..a829d5b88d
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_bg_driving_info_image.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_blue_tooth_close.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_blue_tooth_close.png
new file mode 100644
index 0000000000..0c292d2cf3
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_blue_tooth_close.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_blue_tooth_open.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_blue_tooth_open.png
new file mode 100644
index 0000000000..cccf9e10fa
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_blue_tooth_open.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_bottom_bg.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_bottom_bg.png
new file mode 100644
index 0000000000..cec9275411
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_bottom_bg.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_card_split.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_card_split.png
new file mode 100644
index 0000000000..5446226be7
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_card_split.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_clock_bg.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_clock_bg.png
new file mode 100644
index 0000000000..a380c3f3b7
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_clock_bg.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_img_drive_bg.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_img_drive_bg.png
new file mode 100644
index 0000000000..7412ab3c90
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_img_drive_bg.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_img_line_bg.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_img_line_bg.png
new file mode 100644
index 0000000000..dd78f6fc9e
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_img_line_bg.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_img_time_bg.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_img_time_bg.png
new file mode 100644
index 0000000000..ba735834b6
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_img_time_bg.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_light_green_nor.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_light_green_nor.png
new file mode 100644
index 0000000000..3135524a79
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_light_green_nor.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_light_red_nor.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_light_red_nor.png
new file mode 100644
index 0000000000..e873c2b85e
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_light_red_nor.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_light_yellow_nor.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_light_yellow_nor.png
new file mode 100644
index 0000000000..8046782601
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_light_yellow_nor.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_lightyellow_nor.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_lightyellow_nor.png
new file mode 100644
index 0000000000..bae01408fd
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_lightyellow_nor.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_line_name.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_line_name.png
new file mode 100644
index 0000000000..beed2f2ad2
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_line_name.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_line_noselect.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_line_noselect.png
new file mode 100644
index 0000000000..bda5e1d105
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_line_noselect.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_line_tile.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_line_tile.png
new file mode 100644
index 0000000000..44070336fa
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_line_tile.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_map_car_icon.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_map_car_icon.png
new file mode 100644
index 0000000000..b9c841cc83
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_map_car_icon.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_map_end_icon.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_map_end_icon.png
new file mode 100644
index 0000000000..39ffc9052f
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_map_end_icon.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_map_start_icon.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_map_start_icon.png
new file mode 100644
index 0000000000..c970699aac
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_map_start_icon.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_map_staton_arrived_icon.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_map_staton_arrived_icon.png
new file mode 100644
index 0000000000..39be18953c
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_map_staton_arrived_icon.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_map_staton_icon.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_map_staton_icon.png
new file mode 100644
index 0000000000..d90c5a2b71
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_map_staton_icon.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_p_video_holder.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_p_video_holder.png
new file mode 100644
index 0000000000..d8c5951e43
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_p_video_holder.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_sky_bg.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_sky_bg.png
new file mode 100644
index 0000000000..7b72c07390
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_sky_bg.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_status_bar_logo.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_status_bar_logo.png
new file mode 100644
index 0000000000..1f6ea692f5
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_status_bar_logo.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_video_bottom_left.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_video_bottom_left.png
new file mode 100644
index 0000000000..5e1fb2c752
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_video_bottom_left.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_video_bottom_right.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_video_bottom_right.png
new file mode 100644
index 0000000000..19ae887a57
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_video_bottom_right.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_video_top_left.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_video_top_left.png
new file mode 100644
index 0000000000..3fb0a40ce3
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_video_top_left.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_video_top_right.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_video_top_right.png
new file mode 100644
index 0000000000..dbc80b2254
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_video_top_right.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_youzhuan_open.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_youzhuan_open.png
new file mode 100644
index 0000000000..bbd2c12d90
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_youzhuan_open.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_youzhuan_un_open.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_youzhuan_un_open.png
new file mode 100644
index 0000000000..7c0dcaabe1
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_youzhuan_un_open.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_zuozhuan_open.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_zuozhuan_open.png
new file mode 100644
index 0000000000..9bbda22cb7
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_zuozhuan_open.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_zuozhuan_un_open.png b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_zuozhuan_un_open.png
new file mode 100644
index 0000000000..7c33fddbd9
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/drawable-nodpi/bus_p_m2_zuozhuan_un_open.png differ
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_driving_arrived_notice.xml b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_driving_arrived_notice.xml
new file mode 100644
index 0000000000..f9fea1ec61
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_driving_arrived_notice.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_driving_distance_lefttime.xml b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_driving_distance_lefttime.xml
new file mode 100644
index 0000000000..75670794d2
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_driving_distance_lefttime.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_driving_info.xml b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_driving_info.xml
new file mode 100644
index 0000000000..b99cfe6efd
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_driving_info.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_driving_selector.xml b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_driving_selector.xml
new file mode 100644
index 0000000000..21a6524032
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_driving_selector.xml
@@ -0,0 +1,8 @@
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_p_m2_arrived_station.xml b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_p_m2_arrived_station.xml
new file mode 100644
index 0000000000..1824c74bbf
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_p_m2_arrived_station.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_p_m2_auto.xml b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_p_m2_auto.xml
new file mode 100644
index 0000000000..0c40c7ee4b
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_p_m2_auto.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_p_m2_traffic_light.xml b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_p_m2_traffic_light.xml
new file mode 100644
index 0000000000..5a27da20e0
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_p_m2_traffic_light.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_pnc.xml b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_pnc.xml
new file mode 100644
index 0000000000..cf40e4a77b
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_bg_pnc.xml
@@ -0,0 +1,5 @@
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_brakelight_background_daytime.xml b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_brakelight_background_daytime.xml
new file mode 100644
index 0000000000..42320a2531
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_brakelight_background_daytime.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_power_seekbar_style.xml b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_power_seekbar_style.xml
new file mode 100644
index 0000000000..3ac0c761ba
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/drawable/bus_p_m2_power_seekbar_style.xml
@@ -0,0 +1,26 @@
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_driving_info_fragment.xml b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_driving_info_fragment.xml
new file mode 100644
index 0000000000..a290ef869b
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_driving_info_fragment.xml
@@ -0,0 +1,378 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_fragment.xml b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_fragment.xml
new file mode 100644
index 0000000000..2944a93384
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_fragment.xml
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_hpmap_fragment.xml b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_hpmap_fragment.xml
new file mode 100644
index 0000000000..5c9a902baa
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_hpmap_fragment.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_traffic_light_view.xml b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_traffic_light_view.xml
new file mode 100644
index 0000000000..3fd9e2e972
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_traffic_light_view.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_turn_light_status.xml b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_turn_light_status.xml
new file mode 100644
index 0000000000..ec5a62ef4d
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_turn_light_status.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_video_fragment.xml b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_video_fragment.xml
new file mode 100644
index 0000000000..66e95d9087
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_video_fragment.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_video_view.xml b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_video_view.xml
new file mode 100644
index 0000000000..9d75478ee1
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_video_view.xml
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_view_blue_tooth.xml b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_view_blue_tooth.xml
new file mode 100644
index 0000000000..6f8a5129f0
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_view_blue_tooth.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_view_status_bar.xml b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_view_status_bar.xml
new file mode 100644
index 0000000000..163bee4257
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/layout/bus_p_m2_view_status_bar.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/raw/star_marker.nt3d b/OCH/bus/passenger/src/main/res/m2/raw/star_marker.nt3d
new file mode 100644
index 0000000000..c6e546fc31
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/raw/star_marker.nt3d differ
diff --git a/OCH/bus/passenger/src/main/res/m2/raw/station_marker.nt3d b/OCH/bus/passenger/src/main/res/m2/raw/station_marker.nt3d
new file mode 100644
index 0000000000..a00207ba3f
Binary files /dev/null and b/OCH/bus/passenger/src/main/res/m2/raw/station_marker.nt3d differ
diff --git a/OCH/bus/passenger/src/main/res/m2/values/colors.xml b/OCH/bus/passenger/src/main/res/m2/values/colors.xml
new file mode 100644
index 0000000000..3c583e6cd4
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/values/colors.xml
@@ -0,0 +1,26 @@
+
+
+ #FFFFFF
+ #0B1E38
+ #BBDAFB
+ #0B1E38
+ #5D7199
+ #A5D8FF
+ #1B2546
+ #23355D
+ #8895B7
+
+
+ #C8EFFF
+ #203555
+ #17417B
+ #2D3E5F
+ #34A61F
+ #AEEDB8
+ #43CEFE
+ #1466FB
+ #7094AD
+
+ #99AFC9E7
+ #6617417B
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/values/dimens.xml b/OCH/bus/passenger/src/main/res/m2/values/dimens.xml
new file mode 100644
index 0000000000..55344e5192
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/values/dimens.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/OCH/bus/passenger/src/main/res/m2/values/strings.xml b/OCH/bus/passenger/src/main/res/m2/values/strings.xml
new file mode 100644
index 0000000000..7ee723e068
--- /dev/null
+++ b/OCH/bus/passenger/src/main/res/m2/values/strings.xml
@@ -0,0 +1,14 @@
+
+
+ KM/H
+ m2_map_style.data
+ m2_map_style_extra.data
+ AUTO
+ 已到站
+ 暂无站点
+ 前方到站
+ —公里
+ —分钟
+ 请按秩序下车
+ 暂无路线
+
\ No newline at end of file
diff --git a/OCH/shuttle/passenger/src/main/java/com/mogo/och/shuttle/passenger/MogoOCHShuttlePassenger.kt b/OCH/shuttle/passenger/src/main/java/com/mogo/och/shuttle/passenger/MogoOCHShuttlePassenger.kt
index ce15ccd1ca..9167b387ac 100644
--- a/OCH/shuttle/passenger/src/main/java/com/mogo/och/shuttle/passenger/MogoOCHShuttlePassenger.kt
+++ b/OCH/shuttle/passenger/src/main/java/com/mogo/och/shuttle/passenger/MogoOCHShuttlePassenger.kt
@@ -67,7 +67,7 @@ class MogoOCHShuttlePassenger : IMoGoFunctionProvider {
val fragmentByTag: Fragment? = supportFragmentManager?.findFragmentByTag(PM2BaseFragment.TAG)
- mPM2Fragment = if (fragmentByTag is PM2BaseFragment){
+ mPM2Fragment = if (fragmentByTag is Fragment){
fragmentByTag
}else{
if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)) {
diff --git a/OCH/shuttle/passenger/src/main/res/m2/layout/shuttle_p_m2_driving_info_fragment.xml b/OCH/shuttle/passenger/src/main/res/m2/layout/shuttle_p_m2_driving_info_fragment.xml
index 4233460588..52e19ded8c 100644
--- a/OCH/shuttle/passenger/src/main/res/m2/layout/shuttle_p_m2_driving_info_fragment.xml
+++ b/OCH/shuttle/passenger/src/main/res/m2/layout/shuttle_p_m2_driving_info_fragment.xml
@@ -285,7 +285,7 @@
app:layout_constraintBottom_toBottomOf="parent" />
-
-
diff --git a/app/script/flavorfilter/flavors.json b/app/script/flavorfilter/flavors.json
index b81368313a..d66e7df44f 100644
--- a/app/script/flavorfilter/flavors.json
+++ b/app/script/flavorfilter/flavors.json
@@ -15,8 +15,8 @@
"passenger": ["ochDFHQ"]
},
"bus" :{
- "driver": ["ochJL"],
- "passenger": ["ochJL"]
+ "driver": ["ochJL","ochM2"],
+ "passenger": ["ochJL","ochM2"]
},
"charter" :{
"driver": ["ochM1"],
@@ -56,8 +56,8 @@
"passenger": ["ochJL","ochM2"]
},
"bus" :{
- "driver": ["ochJL"],
- "passenger": ["ochJL"]
+ "driver": ["ochJL","ochM2"],
+ "passenger": ["ochJL","ochM2"]
},
"charter" :{
"driver": ["ochM1"],