[6.5.0] merge
@@ -28,7 +28,7 @@
|
||||
android:layout_height="@dimen/dp_269"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--V2X预警红色边框-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
|
||||
@@ -101,11 +101,31 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_71"
|
||||
app:layout_constraintEnd_toEndOf="@+id/viewLimitingVelocity"
|
||||
app:layout_goneMarginEnd="40dp"
|
||||
app:layout_goneMarginTop="@dimen/dp_236"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity"/>
|
||||
app:layout_constraintEnd_toEndOf="@+id/viewLimitingVelocity"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity"
|
||||
app:layout_goneMarginEnd="40dp"
|
||||
app:layout_goneMarginTop="@dimen/dp_236" />
|
||||
|
||||
<!-- 前方路况探查 -->
|
||||
<com.mogo.eagle.core.function.view.RoadCrossRoamView
|
||||
android:layout_width="@dimen/dp_600"
|
||||
android:layout_height="@dimen/dp_740"
|
||||
android:layout_marginTop="@dimen/dp_350"
|
||||
android:layout_marginRight="@dimen/dp_50"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- 地图marker点击触发路侧直播 -->
|
||||
<com.mogo.eagle.core.function.hmi.ui.camera.RoadCrossLiveView
|
||||
android:layout_width="@dimen/dp_800"
|
||||
android:layout_height="@dimen/dp_560"
|
||||
android:layout_marginTop="@dimen/dp_333"
|
||||
android:layout_marginEnd="@dimen/dp_50"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--消息盒子选择入口-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
||||
@@ -163,10 +183,10 @@
|
||||
android:layout_height="@dimen/dp_185"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:layout_marginTop="-31dp"
|
||||
android:paddingTop="@dimen/dp_27"
|
||||
android:paddingBottom="@dimen/dp_32"
|
||||
android:background="@drawable/bus_autopilot_0_1_status_bg"
|
||||
android:gravity="center"
|
||||
android:paddingTop="@dimen/dp_27"
|
||||
android:paddingBottom="@dimen/dp_32"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fl_speed"
|
||||
tools:visibility="visible">
|
||||
@@ -200,8 +220,7 @@
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginTop="-24dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/module_mogo_och_autopilot_status" />
|
||||
<!--订单调试页面-->
|
||||
<include
|
||||
android:id="@+id/module_mogo_och_bus_test_bar"
|
||||
@@ -217,8 +236,8 @@
|
||||
android:id="@+id/module_mogo_och_arrived_tv"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/dp_19"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:background="@drawable/common_arrive_station_selector"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
@@ -230,39 +249,39 @@
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.toolsview.ToolsView
|
||||
android:id="@+id/toolsView"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
android:layout_marginStart="-10dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_arrived_tv"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_arrived_tv" />
|
||||
|
||||
<!--切换地图远近事件 @dimen/module_switch_map -->
|
||||
<com.mogo.och.common.module.wigets.map.switchvisual.VisualView
|
||||
android:id="@+id/switch_visual_view"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/toolsView"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
android:layout_marginStart="-10dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/toolsView" />
|
||||
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.reportworkorder.ReportWorkOrderView
|
||||
android:id="@+id/reportworkorderview"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
android:layout_marginStart="-10dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/switch_visual_view"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
app:layout_constraintLeft_toRightOf="@id/switch_visual_view" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaTaxiView
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="-10dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/reportworkorderview"
|
||||
app:roma_close_bg="@drawable/common_driverroma_normal"
|
||||
app:roma_open_bg="@drawable/common_driver_roma_press" />
|
||||
@@ -305,7 +324,7 @@
|
||||
|
||||
<com.mogo.och.common.module.wigets.LoadingMapStatusView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.ConnectionProcessView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -313,8 +332,7 @@
|
||||
android:layout_marginBottom="@dimen/dp_18"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewVersionName"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -31,6 +31,7 @@ import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
||||
import com.mogo.eagle.core.function.view.MapBizView;
|
||||
import com.mogo.eagle.core.function.smp.view.SmallMapView;
|
||||
import com.mogo.eagle.core.function.view.MapRoamView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
@@ -56,6 +57,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
protected FrameLayout flStationPanelContainer;
|
||||
private FrameLayout flNaviPanelContainer;
|
||||
private MapBizView mapBizView;
|
||||
private MapRoamView mapRoamView;
|
||||
private Group groupTestPanel;
|
||||
private FrameLayout mSpeedView;
|
||||
private ImageView mAutopilotImage;
|
||||
@@ -81,6 +83,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mapBizView = findViewById(R.id.mapBizView);
|
||||
mapRoamView = findViewById(R.id.mapRoamView);
|
||||
groupTestPanel = findViewById(R.id.groupTestPanel);
|
||||
ctvAutopilotStatusRL = findViewById(R.id.module_mogo_och_autopilot_status);
|
||||
ctvAutopilotStatusRL.setBackground(getResources().getDrawable(R.drawable.taxi_autopilot_bg_selector));
|
||||
@@ -184,6 +187,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
protected void initViews(Bundle savedInstanceState) {
|
||||
super.initViews(savedInstanceState);
|
||||
mapBizView.onCreate(savedInstanceState);
|
||||
mapRoamView.onCreate(savedInstanceState);
|
||||
smallMapView.onCreateView(savedInstanceState);
|
||||
}
|
||||
|
||||
@@ -191,6 +195,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mapBizView.onResume();
|
||||
mapRoamView.onResume();
|
||||
smallMapView.onResume();
|
||||
}
|
||||
|
||||
@@ -198,6 +203,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
mapBizView.onPause();
|
||||
mapRoamView.onPause();
|
||||
smallMapView.onPause();
|
||||
}
|
||||
|
||||
@@ -209,17 +215,20 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
mapBizView.onLowMemory();
|
||||
mapRoamView.onLowMemory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
mapBizView.onSaveInstanceState(outState);
|
||||
mapRoamView.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
mapBizView.onDestroy();
|
||||
mapRoamView.onDestroy();
|
||||
if(smallMapView != null){
|
||||
smallMapView.onDestroy();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
android:layout_height="@dimen/dp_269"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_autopilot_status"
|
||||
@@ -35,13 +35,12 @@
|
||||
android:layout_height="@dimen/dp_180"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginTop="-31dp"
|
||||
android:background="@drawable/taxi_autopilot_bg_selector"
|
||||
android:gravity="center"
|
||||
android:paddingTop="@dimen/dp_27"
|
||||
android:paddingBottom="@dimen/dp_32"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/taxi_autopilot_bg_selector"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/taxi_speed_contain"
|
||||
>
|
||||
app:layout_constraintTop_toBottomOf="@+id/taxi_speed_contain">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_och_autopilot_iv"
|
||||
@@ -134,11 +133,31 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_71"
|
||||
app:layout_constraintEnd_toEndOf="@+id/viewLimitingVelocity"
|
||||
app:layout_goneMarginEnd="40dp"
|
||||
app:layout_goneMarginTop="@dimen/dp_236"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity"/>
|
||||
app:layout_constraintEnd_toEndOf="@+id/viewLimitingVelocity"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity"
|
||||
app:layout_goneMarginEnd="40dp"
|
||||
app:layout_goneMarginTop="@dimen/dp_236" />
|
||||
|
||||
<!-- 前方路况探查 -->
|
||||
<com.mogo.eagle.core.function.view.RoadCrossRoamView
|
||||
android:layout_width="@dimen/dp_600"
|
||||
android:layout_height="@dimen/dp_740"
|
||||
android:layout_marginTop="@dimen/dp_350"
|
||||
android:layout_marginRight="@dimen/dp_50"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- 地图marker点击触发路侧直播 -->
|
||||
<com.mogo.eagle.core.function.hmi.ui.camera.RoadCrossLiveView
|
||||
android:layout_width="@dimen/dp_800"
|
||||
android:layout_height="@dimen/dp_560"
|
||||
android:layout_marginTop="@dimen/dp_333"
|
||||
android:layout_marginEnd="@dimen/dp_50"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--消息盒子选择入口-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
||||
@@ -194,21 +213,21 @@
|
||||
android:id="@+id/module_mogo_och_station_panel_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginTop="-25dp"
|
||||
android:background="@android:color/transparent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_mogo_och_autopilot_status"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.orderstatus.OrderStatusView
|
||||
android:id="@+id/module_mogo_och_operation_status"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/dp_19"
|
||||
android:layout_width="@dimen/dp_316"
|
||||
android:layout_height="@dimen/dp_144"/>
|
||||
android:layout_height="@dimen/dp_144"
|
||||
android:layout_marginStart="@dimen/dp_19"
|
||||
android:layout_marginBottom="@dimen/dp_16"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/taxi_driver_role_tv"
|
||||
@@ -224,38 +243,38 @@
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.toolsview.ToolsView
|
||||
android:id="@+id/toolsView"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
android:layout_marginStart="-11dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_operation_status"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
app:layout_constraintLeft_toRightOf="@id/module_mogo_och_operation_status" />
|
||||
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.switchvisual.VisualView
|
||||
android:id="@+id/switch_visual_view"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/toolsView"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
android:layout_marginStart="-10dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/toolsView" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.map.reportworkorder.ReportWorkOrderView
|
||||
android:id="@+id/reportworkorderview"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
android:layout_marginStart="-10dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/switch_visual_view"
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"/>
|
||||
app:layout_constraintLeft_toRightOf="@id/switch_visual_view" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaTaxiView
|
||||
android:layout_width="@dimen/dp_142"
|
||||
android:layout_height="@dimen/dp_142"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="-10dp"
|
||||
android:layout_marginBottom="@dimen/dp_17"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/reportworkorderview"
|
||||
app:roma_close_bg="@drawable/common_driverroma_normal"
|
||||
app:roma_open_bg="@drawable/common_driver_roma_press" />
|
||||
@@ -349,7 +368,7 @@
|
||||
|
||||
<com.mogo.och.common.module.wigets.LoadingMapStatusView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.ConnectionProcessView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -357,8 +376,7 @@
|
||||
android:layout_marginBottom="@dimen/dp_18"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewVersionName"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -8,7 +8,7 @@ apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
|
||||
apply from: rootProject.file('gradle/bytex/bytex.gradle')
|
||||
//apply from: rootProject.file('gradle/bytex/bytex.gradle')
|
||||
|
||||
Properties properties = new Properties()
|
||||
properties.load(project.rootProject.file("gradle.properties").newDataInputStream())
|
||||
|
||||
@@ -27,7 +27,7 @@ class CameraListAdapter : Adapter<CameraListAdapter.CameraListHolder> {
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CameraListHolder {
|
||||
var view = LayoutInflater.from(parent.context)
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_camera_info, parent, false)
|
||||
return CameraListHolder(view)
|
||||
}
|
||||
|
||||
@@ -1,26 +1,179 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.camera
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.PorterDuff
|
||||
import android.graphics.PorterDuffColorFilter
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.Message
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.mogo.eagle.core.data.road.RoadCameraLive
|
||||
import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.model.VideoOptionModel
|
||||
import com.shuyu.gsyvideoplayer.player.IjkPlayerManager
|
||||
import com.shuyu.gsyvideoplayer.player.PlayerFactory
|
||||
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
|
||||
import com.zhidaoauto.map.data.road.RoadCross
|
||||
import kotlinx.android.synthetic.main.view_road_cross_live.view.roadCrossLiveClose
|
||||
import kotlinx.android.synthetic.main.view_road_cross_live.view.roadCrossLivePB
|
||||
import kotlinx.android.synthetic.main.view_road_cross_live.view.roadCrossLivePlayer
|
||||
import tv.danmaku.ijk.media.player.IjkMediaPlayer
|
||||
|
||||
class RoadCrossLiveView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoMapRoadListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "RoadCrossLiveView"
|
||||
private const val CLOSE_VIEW_DELAY_TIME = 10_000L
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var curLiveDevice: String? = null
|
||||
|
||||
private val gsyVideoOptionBuilder by lazy {
|
||||
GSYVideoOptionBuilder()
|
||||
}
|
||||
|
||||
private val handler = object : Handler(Looper.getMainLooper()) {
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
if (this@RoadCrossLiveView.visibility == View.VISIBLE) {
|
||||
closeView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_road_cross_live, this, true)
|
||||
val res = when (CallerSkinModeListenerManager.getMode()) {
|
||||
0 -> R.layout.view_road_cross_live
|
||||
1 -> R.layout.view_road_cross_live_light
|
||||
else -> R.layout.view_road_cross_live
|
||||
}
|
||||
LayoutInflater.from(context).inflate(res, this, true)
|
||||
initVideoPlayer()
|
||||
roadCrossLivePB.indeterminateDrawable.colorFilter = PorterDuffColorFilter(
|
||||
ContextCompat.getColor(context, R.color.notice_blue),
|
||||
PorterDuff.Mode.MULTIPLY
|
||||
)
|
||||
roadCrossLiveClose.setOnClickListener {
|
||||
HmiActionLog.hmiAction("关闭路侧视频流", "")
|
||||
closeView()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun initVideoPlayer() {
|
||||
val list: MutableList<VideoOptionModel> = ArrayList()
|
||||
list.add(VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "reconnect", 3))
|
||||
GSYVideoManager.instance().optionModelList = list
|
||||
GSYVideoType.setShowType(GSYVideoType.SCREEN_TYPE_16_9)
|
||||
PlayerFactory.setPlayManager(IjkPlayerManager::class.java)
|
||||
roadCrossLivePlayer.outLinePixel = 12f
|
||||
roadCrossLivePlayer.setPlayListener(object : SimpleVideoPlayer.PlayListener {
|
||||
override fun onPlayEvent(event: Int) {
|
||||
CallerLogger.d("$M_HMI$TAG", "onPlayEvent: event is:$event")
|
||||
when (event) {
|
||||
SimpleVideoPlayer.PLAY_EVT_PLAY_LOADING -> {
|
||||
// 会出现临时中断后又可以继续播放,需要停掉倒计时
|
||||
}
|
||||
|
||||
SimpleVideoPlayer.PLAY_EVT_PLAY_BEGIN -> {
|
||||
roadCrossLivePB.visibility = View.GONE
|
||||
roadCrossLivePlayer.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
else -> {
|
||||
CallerLogger.w("$M_HMI$TAG", "播放视频异常,event is:$event")
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerMapRoadListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onRoadChange(cross: Boolean, roadCross: RoadCross?) {
|
||||
super.onRoadChange(cross, roadCross)
|
||||
// 离开路口,进入路段,发送handler3秒后隐藏播放器
|
||||
if (!cross) {
|
||||
handler.sendEmptyMessageDelayed(0, CLOSE_VIEW_DELAY_TIME)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onRoadCrossClick() {
|
||||
super.onRoadCrossClick()
|
||||
if (this.visibility == View.VISIBLE) {
|
||||
return
|
||||
}
|
||||
resetView()
|
||||
}
|
||||
|
||||
override fun onCrossLiveInfo(info: RoadCameraLive) {
|
||||
super.onCrossLiveInfo(info)
|
||||
if (curLiveDevice != null && curLiveDevice == info.ip) {
|
||||
CallerLogger.w("$M_HMI$TAG", "播放视频异常,当前播放设备与上次相同,ip:${info.ip}")
|
||||
return
|
||||
}
|
||||
curLiveDevice = info.ip
|
||||
ThreadUtils.runOnUiThread {
|
||||
HmiActionLog.hmiAction("触发marker点击,播放路侧视频流", info.toString())
|
||||
gsyVideoPlay(info.imageUrl, info.liveUrl)
|
||||
}
|
||||
}
|
||||
|
||||
private fun gsyVideoPlay(img: String, live: String) {
|
||||
resetView()
|
||||
gsyVideoOptionBuilder.setUrl(live)
|
||||
.setCacheWithPlay(false)
|
||||
.setAutoFullWithSize(false)
|
||||
.setIsTouchWigetFull(false)
|
||||
.setIsTouchWiget(false)
|
||||
.setPlayTag(TAG).build(roadCrossLivePlayer)
|
||||
roadCrossLivePlayer.startButton.performClick()
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置视图,播放下一个
|
||||
*/
|
||||
private fun resetView() {
|
||||
this.visibility = View.VISIBLE
|
||||
roadCrossLivePB.visibility = View.VISIBLE
|
||||
roadCrossLivePlayer.onVideoReset()
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏view,释放视频控制器
|
||||
*/
|
||||
private fun closeView() {
|
||||
this.visibility = View.GONE
|
||||
roadCrossLivePlayer.visibility = View.GONE
|
||||
curLiveDevice = null
|
||||
GSYVideoManager.releaseAllVideos()
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerMapRoadListenerManager.removeListener(TAG)
|
||||
closeView()
|
||||
}
|
||||
}
|
||||
@@ -419,8 +419,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
* 状态中心
|
||||
*/
|
||||
tbStatusCenter.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
val cross = RoadCross()
|
||||
// CallerMapRoadListenerManager.invokeRoadChange(0, cross)
|
||||
if (isChecked) {
|
||||
buttonView.setCompoundDrawables(null, null, iconDown, null)
|
||||
//展示状态中心
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_12"/>
|
||||
<solid android:color="@color/color_252B3F"/>
|
||||
</shape>
|
||||
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
@@ -1,6 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_road_cross_live">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/roadCrossLiveBg"
|
||||
android:layout_width="@dimen/dp_760"
|
||||
android:layout_height="@dimen/dp_428"
|
||||
android:layout_margin="@dimen/dp_20"
|
||||
android:background="@drawable/bg_road_cross_empty"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/bg_road_cross_logo"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer
|
||||
android:id="@+id/roadCrossLivePlayer"
|
||||
android:layout_width="@dimen/dp_760"
|
||||
android:layout_height="@dimen/dp_428"
|
||||
android:layout_margin="@dimen/dp_20"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.core.widget.ContentLoadingProgressBar
|
||||
android:id="@+id/roadCrossLivePB"
|
||||
style="?android:attr/progressBarStyleSmall"
|
||||
android:layout_width="@dimen/dp_55"
|
||||
android:layout_height="@dimen/dp_55"
|
||||
android:layout_marginTop="@dimen/dp_214"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/roadCrossLiveClose"
|
||||
android:layout_width="@dimen/dp_70"
|
||||
android:layout_height="@dimen/dp_70"
|
||||
android:src="@drawable/bg_road_cross_live_close"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_63"
|
||||
android:layout_height="@dimen/dp_46"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_480"
|
||||
android:src="@drawable/bg_road_cross_xiaozhi"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_90"
|
||||
android:layout_marginTop="@dimen/dp_473"
|
||||
android:text="@string/road_cross_live_tip"
|
||||
android:textColor="@color/color_50E8E4"
|
||||
android:textSize="@dimen/dp_30"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -23,6 +23,8 @@
|
||||
<color name="color_2C2E30">#2C2E30</color>
|
||||
<color name="color_2D3E5F">#2D3E5F</color>
|
||||
<color name="color_D4D8DC">#D4D8DC</color>
|
||||
<color name="color_50E8E4">#50E8E4</color>
|
||||
<color name="color_252B3F">#252B3F</color>
|
||||
<color name="color_27FFFFFF">#27FFFFFF</color>
|
||||
<color name="color_1E111111">#1E111111</color>
|
||||
<color name="color_FF213757">#FF213757</color>
|
||||
|
||||
@@ -127,4 +127,6 @@
|
||||
<string name="exploration_title">正在为您探查前方道路</string>
|
||||
<string name="exploration_close">自动探索关闭按钮</string>
|
||||
|
||||
|
||||
<string name="road_cross_live_tip">蘑菇为您实时护航中,请放心驾驶!</string>
|
||||
</resources>
|
||||
|
||||
@@ -70,6 +70,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.androidxroomktx
|
||||
implementation rootProject.ext.dependencies.view_model_scope
|
||||
implementation rootProject.ext.dependencies.lifecycle_extension
|
||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||
|
||||
implementation project(':foudations:mogo-commons')
|
||||
implementation project(':core:mogo-core-res')
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.mogo.eagle.core.function.business.roadcross
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.Message
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.road.CameraDeviceInfo
|
||||
@@ -14,6 +16,7 @@ import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.view.CameraMarkerView
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.map.overlay.core.Level
|
||||
import com.mogo.map.overlay.point.Point
|
||||
@@ -26,6 +29,7 @@ class RoadCrossCameraManager : IMoGoMapRoadListener {
|
||||
companion object {
|
||||
|
||||
private const val TAG = "RoadCrossCameraManager"
|
||||
private const val REMOVE_MARKER_DELAY_TIME = 10_000L
|
||||
|
||||
val instance: RoadCrossCameraManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
RoadCrossCameraManager()
|
||||
@@ -42,18 +46,24 @@ class RoadCrossCameraManager : IMoGoMapRoadListener {
|
||||
|
||||
private val overlayManager = CallerMapUIServiceManager.getOverlayManager()
|
||||
|
||||
private val handler = object :Handler(Looper.getMainLooper()){
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
overlayManager?.removeAllPointsInOwner(TAG)
|
||||
}
|
||||
}
|
||||
|
||||
fun init(context: Context?) {
|
||||
mContext = context
|
||||
CallerMapRoadListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
//todo 记录方法执行时间
|
||||
private var distance: Double by Delegates.observable(0.0) { _, _, newV ->
|
||||
if (!isCameraRequest && newV < 100) {
|
||||
isCameraRequest = true
|
||||
val roadCrossEnd = CallerMapRoadListenerManager.getCrossInfo()?.cross_id_end
|
||||
Log.d(
|
||||
"emArrow",
|
||||
val roadCrossEnd = CallerMapRoadListenerManager.getCrossEndInfo()
|
||||
CallerLogger.d(
|
||||
"$M_MAP$TAG",
|
||||
"触发接口调用 dis: $distance , roadCrossEnd: ${roadCrossEnd ?: "null"} "
|
||||
)
|
||||
if (roadCrossEnd != null) {
|
||||
@@ -69,8 +79,10 @@ class RoadCrossCameraManager : IMoGoMapRoadListener {
|
||||
}
|
||||
roadCrossCameraList = it.deviceInfoList
|
||||
// 地图上打marker(注意marker方向),marker点击获取对应ip
|
||||
it.deviceInfoList.forEach { deviceInfo ->
|
||||
addCameraDeviceMarker(deviceInfo)
|
||||
ThreadUtils.runOnUiThread {
|
||||
it.deviceInfoList.forEach { deviceInfo ->
|
||||
addCameraDeviceMarker(deviceInfo)
|
||||
}
|
||||
}
|
||||
},
|
||||
onError = {
|
||||
@@ -80,12 +92,12 @@ class RoadCrossCameraManager : IMoGoMapRoadListener {
|
||||
traceError("roadCross is null")
|
||||
}
|
||||
} else {
|
||||
Log.d("emArrow", "distance:$distance")
|
||||
CallerLogger.d("$M_MAP$TAG", "distance:$distance")
|
||||
}
|
||||
}
|
||||
|
||||
private fun addCameraDeviceMarker(cameraDeviceInfo: CameraDeviceInfo) {
|
||||
Log.d("emArrow","add marker:${cameraDeviceInfo.deviceIp}")
|
||||
CallerLogger.d("$M_MAP$TAG", "add marker:${cameraDeviceInfo.deviceIp}")
|
||||
mContext?.let {
|
||||
val builder =
|
||||
Point.Options.Builder(TAG, Level.MAP_MARKER)
|
||||
@@ -100,16 +112,16 @@ class RoadCrossCameraManager : IMoGoMapRoadListener {
|
||||
.longitude(cameraDeviceInfo.lon)
|
||||
.latitude(cameraDeviceInfo.lat)
|
||||
.onClick { id ->
|
||||
Log.d("emArrow", "Marker click :$id")
|
||||
CallerLogger.d("$M_MAP$TAG", "Marker click :$id")
|
||||
CallerMapRoadListenerManager.invokeRoadCrossClick()
|
||||
ndeRoadCameraNetWorkModel.singleRequestCrossLive(id,
|
||||
onSuccess = { live ->
|
||||
CallerMapRoadListenerManager.invokeRoadCrossLive(live)
|
||||
},
|
||||
onError = {errorMsg ->
|
||||
onError = { errorMsg ->
|
||||
traceError(" ${cameraDeviceInfo.deviceIp} click request error :$errorMsg")
|
||||
})
|
||||
}
|
||||
CallerLogger.d("$M_MAP$TAG", "new road cross camera=$overlayManager")
|
||||
overlayManager?.showOrUpdatePoint(builder.build())
|
||||
}
|
||||
}
|
||||
@@ -135,32 +147,21 @@ class RoadCrossCameraManager : IMoGoMapRoadListener {
|
||||
|
||||
override fun onRoadChange(cross: Boolean, roadCross: RoadCross?) {
|
||||
super.onRoadChange(cross, roadCross)
|
||||
val data = CameraDeviceInfo("172.18.1.60", 112.582913287, 26.9320508672) //todo emArrow test
|
||||
addCameraDeviceMarker(data)
|
||||
val data1 = CameraDeviceInfo("172.18.1.42", 112.582947017, 26.9328373092)
|
||||
addCameraDeviceMarker(data1)
|
||||
val data2 = CameraDeviceInfo("172.18.1.72", 112.582421, 26.932519)
|
||||
addCameraDeviceMarker(data2)
|
||||
|
||||
// 出路口
|
||||
if (!cross) {
|
||||
// 停止请求摄像头数据
|
||||
ndeRoadCameraNetWorkModel.cancelRequest("roadCross")
|
||||
// 清除marker
|
||||
roadCrossCameraList?.let {
|
||||
it.forEach { camera ->
|
||||
Log.d("emArrow","remove marker:${camera.deviceIp}")
|
||||
overlayManager?.removePoint(camera.deviceIp)
|
||||
}
|
||||
}
|
||||
CallerLogger.d("$M_MAP$TAG", "remove marker")
|
||||
handler.sendEmptyMessageDelayed(0, REMOVE_MARKER_DELAY_TIME)
|
||||
// 释放控制
|
||||
isCameraRequest = false
|
||||
Log.d("emArrow", "经过路口,释放控制")
|
||||
CallerLogger.d("$M_MAP$TAG", "经过路口,释放控制")
|
||||
}
|
||||
}
|
||||
|
||||
private fun traceError(msg: String) {
|
||||
if(DebugConfig.isDebug()){
|
||||
if (DebugConfig.isDebug()) {
|
||||
ToastUtils.showLong(msg)
|
||||
}
|
||||
val loc = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
|
||||
@@ -23,7 +23,8 @@ interface INDERoadCameraApiService {
|
||||
@Header("MogoReqTime") time: String,
|
||||
@Query("roadUniqueId") roadId: String,
|
||||
@Query("lon") lon: Double,
|
||||
@Query("lat") lat: Double
|
||||
@Query("lat") lat: Double,
|
||||
@Query("cityCode") cityCode: String
|
||||
): BaseResponse<List<RoadCrossCamera>>
|
||||
|
||||
// 单ip查询设备直播流与缩略图
|
||||
@@ -33,7 +34,8 @@ interface INDERoadCameraApiService {
|
||||
@Header("MogoReqTime") time: String,
|
||||
@Query("ip") ip: String,
|
||||
@Query("lon") lon: Double,
|
||||
@Query("lat") lat: Double
|
||||
@Query("lat") lat: Double,
|
||||
@Query("cityCode") cityCode: String
|
||||
): BaseResponse<RoadCameraLive>
|
||||
|
||||
// 批量ip查询设备直播流与缩略图
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.data.road.RoadCameraLive
|
||||
import com.mogo.eagle.core.data.road.RoadCrossCamera
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.network.apiCall
|
||||
import com.mogo.eagle.core.network.cancel
|
||||
@@ -40,14 +41,15 @@ class NDERoadCameraNetWorkModel private constructor() {
|
||||
pair.second,
|
||||
crossID,
|
||||
loc.longitude,
|
||||
loc.latitude
|
||||
loc.latitude,
|
||||
CallerMapUIServiceManager.getCityCode() ?: ""
|
||||
)
|
||||
}
|
||||
}
|
||||
onSuccess {
|
||||
if(it.result.isNotEmpty()){
|
||||
if (it.result.isNotEmpty()) {
|
||||
onSuccess.invoke(it.result[0])
|
||||
}else{
|
||||
} else {
|
||||
onError.invoke("getRoadCrossInfo empty camera info")
|
||||
}
|
||||
}
|
||||
@@ -71,7 +73,8 @@ class NDERoadCameraNetWorkModel private constructor() {
|
||||
pair.second,
|
||||
ip,
|
||||
loc.longitude,
|
||||
loc.latitude
|
||||
loc.latitude,
|
||||
CallerMapUIServiceManager.getCityCode() ?: ""
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -92,10 +95,12 @@ class NDERoadCameraNetWorkModel private constructor() {
|
||||
loader {
|
||||
apiCall {
|
||||
val loc = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
val cityCode = CallerMapUIServiceManager.getCityCode() ?: ""
|
||||
val map = mutableMapOf(
|
||||
"lon" to loc.longitude,
|
||||
"lat" to loc.latitude,
|
||||
"ipList" to list
|
||||
"ipList" to list,
|
||||
"cityCode" to cityCode
|
||||
)
|
||||
val pair = getAuth(BATCH_LIVE)
|
||||
getNetWorkApi().cameraLiveBatchRequest(pair.first, pair.second, map)
|
||||
|
||||
@@ -4,9 +4,9 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.ViewGroup
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.map.R
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class CameraMarkerView(context: Context, attrs: AttributeSet? = null, defStyleAt
|
||||
)
|
||||
)
|
||||
}
|
||||
modeChange(CallerMoGoUiSettingManager.getDayMode())
|
||||
modeChange(CallerSkinModeListenerManager.getMode())
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
@@ -36,7 +36,9 @@ class CameraMarkerView(context: Context, attrs: AttributeSet? = null, defStyleAt
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
modeChange(skinMode)
|
||||
ThreadUtils.runOnUiThread {
|
||||
modeChange(skinMode)
|
||||
}
|
||||
}
|
||||
|
||||
private fun modeChange(mode: Int) {
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84Lis
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.map.MogoMapView
|
||||
import com.mogo.map.overlay.line.Polyline
|
||||
import com.mogo.map.overlay.point.Point
|
||||
@@ -59,10 +60,14 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
|
||||
//设置倾斜手势是否可用。
|
||||
it.setTiltGesturesEnabled(false)
|
||||
//设置双指缩放手势是否可用。
|
||||
it.setZoomGesturesEnabled(false) //true todo emArrow test
|
||||
it.setZoomGesturesEnabled(false)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getInstanceTag(): String {
|
||||
return MogoMap.DEFAULT
|
||||
}
|
||||
|
||||
fun getUI(): IMogoMapUIController? {
|
||||
return map?.uiController
|
||||
}
|
||||
@@ -109,10 +114,7 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
// 跟新地图控件 112.582776,26.931655
|
||||
// gnssInfo.longitude = 112.582776
|
||||
// gnssInfo.latitude = 26.931655 //todo emArrow test
|
||||
// gnssInfo.heading = 15.0
|
||||
// 跟新地图控件
|
||||
setExtraGPSData(gnssInfo)
|
||||
accLimit = gnssInfo.acceleration < accThreshold
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.mogo.eagle.core.function.view
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
|
||||
import com.mogo.map.MogoMap.Companion.MAP_ROAM
|
||||
import com.mogo.map.MogoMapView
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
|
||||
|
||||
class MapRoamView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, attrs),
|
||||
IMoGoSkinModeChangeListener,
|
||||
LifecycleObserver, IMoGoMapRoadListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "MapRoamView"
|
||||
}
|
||||
|
||||
override fun onCreate(bundle: Bundle?) {
|
||||
super.onCreate(bundle)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
initMapView()
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
CallerMapRoadListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
private fun initMapView() {
|
||||
map?.uiController?.showMyLocation(false)
|
||||
map?.uiSettings?.let {
|
||||
it.setAllGesturesEnabled(false)
|
||||
//设置指南针是否可见。
|
||||
it.setCompassEnabled(false)
|
||||
//设置室内地图楼层切换控件是否可见。
|
||||
it.setIndoorSwitchEnabled(false)
|
||||
//设置定位按钮是否可见。
|
||||
it.setMyLocationButtonEnabled(false)
|
||||
//设置比例尺控件是否可见
|
||||
it.setScaleControlsEnabled(false)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getInstanceTag(): String {
|
||||
return MAP_ROAM
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
super.onSaveInstanceState(outState)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
}
|
||||
|
||||
private fun getUI(): IMogoMapUIController? {
|
||||
return map?.uiController
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
if (skinMode == 0) {
|
||||
getUI()?.stepInDayMode(false)
|
||||
} else if (skinMode == 1) {
|
||||
getUI()?.stepInDayMode(true)
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("ObsoleteSdkInt")
|
||||
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
||||
super.onSizeChanged(w, h, oldw, oldh)
|
||||
this.outlineProvider = TextureVideoViewOutlineProvider(12f)
|
||||
this.clipToOutline = true
|
||||
}
|
||||
|
||||
fun openRoam() {
|
||||
this.onResume()
|
||||
// 更新地图视角 - 高视角
|
||||
getUI()?.changeMapVisualAngle(VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP, null)
|
||||
// 更新路口位置
|
||||
val latLng = CallerMapRoadListenerManager.getStopLineLatLng()
|
||||
Log.i("emArrow","$TAG 开始漫游 latLng:${latLng.toString()}")
|
||||
latLng?.let {
|
||||
val loc = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
loc.latitude = latLng.first
|
||||
loc.longitude = latLng.second
|
||||
setExtraGPSData(loc)
|
||||
}
|
||||
// 开始漫游
|
||||
|
||||
}
|
||||
|
||||
fun closeRoam(){
|
||||
this.onPause()
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
// 先取消注册数据,再onDestroy
|
||||
CallerSkinModeListenerManager.removeListener(TAG)
|
||||
CallerMapRoadListenerManager.removeListener(TAG)
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.mogo.eagle.core.function.view
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.function.map.R
|
||||
import kotlin.random.Random
|
||||
|
||||
|
||||
class RoadCrossRoamListAdapter(private val mContext: Context) : RecyclerView.Adapter<RoadCrossRoamListAdapter.ViewHolder>() {
|
||||
|
||||
private val items: MutableList<String> = mutableListOf()
|
||||
|
||||
init {
|
||||
items.add("前方路况拥堵分析")
|
||||
items.add("路口危险车辆分析")
|
||||
items.add("路口交通事故分析")
|
||||
items.add("路口行人碰撞分析")
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view: View = LayoutInflater.from(mContext).inflate(R.layout.item_road_cross_roam_tip, parent, false)
|
||||
return ViewHolder(view)
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return items.size
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val item = items[position]
|
||||
holder.textView.text = item
|
||||
// 随机决定是否显示ProgressBar
|
||||
// if (Random.nextBoolean()) { // 50%的几率显示ProgressBar
|
||||
holder.progressBar.visibility = View.VISIBLE
|
||||
holder.checkIcon.visibility = View.GONE
|
||||
|
||||
val r = Random.nextInt(3,6)
|
||||
// 模拟加载完成
|
||||
holder.itemView.postDelayed({
|
||||
holder.progressBar.visibility = View.GONE
|
||||
holder.checkIcon.visibility = View.VISIBLE
|
||||
},r * 1000L)
|
||||
// } else {
|
||||
// holder.progressBar.visibility = View.GONE
|
||||
// holder.checkIcon.visibility = View.VISIBLE
|
||||
// }
|
||||
}
|
||||
|
||||
class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
var textView: TextView = itemView.findViewById(R.id.tvRoadItemTip)
|
||||
var progressBar: ProgressBar = itemView.findViewById(R.id.pbRoadItemTip)
|
||||
var checkIcon: ImageView = itemView.findViewById(R.id.ivRoadItemTip)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.mogo.eagle.core.function.view
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.animation.ValueAnimator
|
||||
import android.content.Context
|
||||
import android.graphics.Rect
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.map.R
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.zhidaoauto.map.data.road.StopLine
|
||||
import kotlinx.android.synthetic.main.view_road_cross_roam.view.ivCoverRoam
|
||||
import kotlinx.android.synthetic.main.view_road_cross_roam.view.ivRoadRoamClose
|
||||
import kotlinx.android.synthetic.main.view_road_cross_roam.view.lvRoadCrossRoamTip
|
||||
import kotlinx.android.synthetic.main.view_road_cross_roam.view.mapRoamView
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
class RoadCrossRoamView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoMapRoadListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "RoadCrossRoamView"
|
||||
}
|
||||
|
||||
private var showState by Delegates.observable(false) { _, oldV, newV ->
|
||||
if (oldV != newV) {
|
||||
updateView(newV)
|
||||
}
|
||||
}
|
||||
|
||||
private var animator: ObjectAnimator? = null
|
||||
|
||||
init {
|
||||
val res = when (CallerSkinModeListenerManager.getMode()) {
|
||||
0 -> R.layout.view_road_cross_roam
|
||||
1 -> R.layout.view_road_cross_roam_light
|
||||
else -> R.layout.view_road_cross_roam
|
||||
}
|
||||
LayoutInflater.from(context).inflate(res, this, true)
|
||||
lvRoadCrossRoamTip.layoutManager = LinearLayoutManager(context)
|
||||
lvRoadCrossRoamTip.addItemDecoration(object : RecyclerView.ItemDecoration() {
|
||||
override fun getItemOffsets(
|
||||
outRect: Rect,
|
||||
view: View,
|
||||
parent: RecyclerView,
|
||||
state: RecyclerView.State
|
||||
) {
|
||||
super.getItemOffsets(outRect, view, parent, state)
|
||||
outRect.bottom = 24
|
||||
}
|
||||
})
|
||||
ivRoadRoamClose.setOnClickListener {
|
||||
detachView()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerMapRoadListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
private fun updateView(state: Boolean) {
|
||||
// 切换线程
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (state) {
|
||||
attachView()
|
||||
} else {
|
||||
detachView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStopLineInfo(info: StopLine) {
|
||||
super.onStopLineInfo(info)
|
||||
showState = info.distance < 200 && info.distance > 100
|
||||
Log.i("emArrow","showState $showState , distance:${info.distance}")
|
||||
}
|
||||
|
||||
private fun attachView() {
|
||||
this.visibility = View.VISIBLE
|
||||
mapRoamView.openRoam()
|
||||
lvRoadCrossRoamTip.adapter = RoadCrossRoamListAdapter(context)
|
||||
// 创建横向移动的动画
|
||||
if (animator == null) {
|
||||
animator =
|
||||
ObjectAnimator.ofFloat(
|
||||
ivCoverRoam,
|
||||
"translationX",
|
||||
-120f,
|
||||
540f
|
||||
)
|
||||
}
|
||||
animator?.duration = 1500 // 设置动画持续时间,单位为毫秒
|
||||
animator?.repeatCount = ValueAnimator.INFINITE // 设置动画无限重复
|
||||
animator?.repeatMode = ValueAnimator.RESTART // 设置动画来回移动
|
||||
animator?.start()
|
||||
}
|
||||
|
||||
private fun detachView() {
|
||||
mapRoamView.closeRoam()
|
||||
lvRoadCrossRoamTip.adapter = null
|
||||
animator?.cancel()
|
||||
this.visibility = View.GONE
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
animator?.cancel()
|
||||
CallerMapRoadListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
After Width: | Height: | Size: 377 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 77 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 996 B |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_30">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvRoadItemTip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:textSize="@dimen/dp_22"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pbRoadItemTip"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:progressDrawable="@drawable/icon_road_roam_progress"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivRoadItemTip"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_road_roam_tip"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_road_cross_roam">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivRoadRoamClose"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:src="@drawable/icon_road_roam_close"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivZhiRoadRoamView"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/bg_road_roam_xiaozhi"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:text="@string/road_cross_roam_tip"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_30"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivZhiRoadRoamView"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapRoamView
|
||||
android:id="@+id/mapRoamView"
|
||||
android:layout_width="@dimen/dp_540"
|
||||
android:layout_height="@dimen/dp_300"
|
||||
android:layout_marginTop="@dimen/dp_160"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="@dimen/dp_540"
|
||||
android:layout_height="@dimen/dp_300"
|
||||
android:layout_marginTop="@dimen/dp_160"
|
||||
android:layout_marginStart="@dimen/dp_32"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivCoverRoam"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_300"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:src="@drawable/icon_cover_road_roam"
|
||||
tools:ignore="ContentDescription" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/lvRoadCrossRoamTip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_200"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_marginLeft="@dimen/dp_30"
|
||||
android:layout_marginRight="@dimen/dp_30"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/mapRoamView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,3 +1,4 @@
|
||||
<resources>
|
||||
<string name="app_name">mogo-core-function-map</string>
|
||||
<string name="road_cross_roam_tip">前方即将进入全息路口\n为您全面扫描潜在风险</string>
|
||||
</resources>
|
||||
|
||||
@@ -17,5 +17,6 @@ interface IMoGoMapRoadListener {
|
||||
|
||||
fun onCrossLiveInfo(info: RoadCameraLive) {}
|
||||
|
||||
fun onRoadCrossClick() {}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.call.map
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.road.RoadCameraLive
|
||||
import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener
|
||||
@@ -38,7 +39,7 @@ object CallerMapRoadListenerManager : CallerBase<IMoGoMapRoadListener>() {
|
||||
mStopLine?.let {
|
||||
listener.onStopLineInfo(it)
|
||||
}
|
||||
if(mCross != -1 && mRoadCross != null){
|
||||
if (mCross != -1 && mRoadCross != null) {
|
||||
listener.onRoadChange(mRoadChange, mRoadCross)
|
||||
}
|
||||
}
|
||||
@@ -57,8 +58,16 @@ object CallerMapRoadListenerManager : CallerBase<IMoGoMapRoadListener>() {
|
||||
}
|
||||
}
|
||||
|
||||
fun getCrossInfo(): RoadCross? {
|
||||
return mRoadCross
|
||||
fun getCrossEndInfo(): String? {
|
||||
return mRoadCross?.cross_id_end
|
||||
}
|
||||
|
||||
fun getStopLineLatLng(): Pair<Double, Double>? {
|
||||
return if (mStopLine == null) {
|
||||
null
|
||||
} else {
|
||||
Pair(mStopLine!!.points[0].latitude, mStopLine!!.points[0].longitude)
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
@@ -77,13 +86,19 @@ object CallerMapRoadListenerManager : CallerBase<IMoGoMapRoadListener>() {
|
||||
|
||||
}
|
||||
|
||||
fun invokeRoadCrossClick() {
|
||||
M_LISTENERS.forEach { entry ->
|
||||
entry.value.onRoadCrossClick()
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_MAP,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_HD_MAP_ROAD_LIVE,
|
||||
paramIndexes = [0]
|
||||
)
|
||||
fun invokeRoadCrossLive(info: RoadCameraLive){
|
||||
fun invokeRoadCrossLive(info: RoadCameraLive) {
|
||||
M_LISTENERS.forEach { entry ->
|
||||
entry.value.onCrossLiveInfo(info)
|
||||
}
|
||||
|
||||
@@ -25,4 +25,8 @@ object CallerSkinModeListenerManager : CallerBase<IMoGoSkinModeChangeListener>()
|
||||
}
|
||||
}
|
||||
|
||||
fun getMode():Int{
|
||||
return CallerMoGoUiSettingManager.getDayMode()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -42,6 +42,11 @@ class SimpleVideoPlayer : StandardGSYVideoPlayer {
|
||||
*/
|
||||
var enableshowProgressDialog = true
|
||||
|
||||
/**
|
||||
* 圆角尺寸
|
||||
*/
|
||||
var outLinePixel = 0f
|
||||
|
||||
interface PlayListener {
|
||||
fun onPlayEvent(event: Int)
|
||||
}
|
||||
@@ -152,10 +157,10 @@ class SimpleVideoPlayer : StandardGSYVideoPlayer {
|
||||
}
|
||||
|
||||
@Suppress("SENSELESS_COMPARISON")
|
||||
private var runnable = object :Runnable {
|
||||
private var runnable = object : Runnable {
|
||||
override fun run() {
|
||||
// 外层对象倍回收 延时继续运行 慎重删除
|
||||
if(this@SimpleVideoPlayer==null){
|
||||
if (this@SimpleVideoPlayer == null) {
|
||||
return
|
||||
}
|
||||
updateTimer++
|
||||
@@ -216,22 +221,42 @@ class SimpleVideoPlayer : StandardGSYVideoPlayer {
|
||||
}
|
||||
|
||||
override fun touchDoubleUp() {
|
||||
if(enableDoubleClick) {
|
||||
if (enableDoubleClick) {
|
||||
super.touchDoubleUp()
|
||||
}
|
||||
}
|
||||
|
||||
override fun showProgressDialog(deltaX: Float, seekTime: String?, seekTimePosition: Int, totalTime: String?, totalTimeDuration: Int) {
|
||||
if(enableshowProgressDialog) {
|
||||
super.showProgressDialog(deltaX, seekTime, seekTimePosition, totalTime, totalTimeDuration)
|
||||
override fun showProgressDialog(
|
||||
deltaX: Float,
|
||||
seekTime: String?,
|
||||
seekTimePosition: Int,
|
||||
totalTime: String?,
|
||||
totalTimeDuration: Int
|
||||
) {
|
||||
if (enableshowProgressDialog) {
|
||||
super.showProgressDialog(
|
||||
deltaX,
|
||||
seekTime,
|
||||
seekTimePosition,
|
||||
totalTime,
|
||||
totalTimeDuration
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun dismissProgressDialog() {
|
||||
if(enableshowProgressDialog) {
|
||||
if (enableshowProgressDialog) {
|
||||
super.dismissProgressDialog()
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("ObsoleteSdkInt")
|
||||
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
||||
super.onSizeChanged(w, h, oldw, oldh)
|
||||
if (!mIfCurrentIsFullscreen && outLinePixel > 0) {
|
||||
this.outlineProvider = TextureVideoViewOutlineProvider(outLinePixel)
|
||||
this.clipToOutline = true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -45,6 +45,7 @@ class MyLocationStyle(
|
||||
private var is3D: Boolean = false
|
||||
private var carId: Int = 0
|
||||
private var isDisplayAnim: Boolean = true
|
||||
private var showSelfMarker:Boolean = true // 前置调用/或后置更新draw
|
||||
private var mMarker: Marker? = null
|
||||
|
||||
private var lastExecuteTime = -1L
|
||||
@@ -236,6 +237,9 @@ class MyLocationStyle(
|
||||
options.animMarkerRes(guangquanResId, mMapController)
|
||||
}
|
||||
mMarker = mMarkerController?.addSelfCar(options)
|
||||
if(!showSelfMarker){
|
||||
mMarker?.setVisible(false)
|
||||
}
|
||||
carId = resId
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.i(
|
||||
@@ -335,10 +339,12 @@ class MyLocationStyle(
|
||||
|
||||
|
||||
fun hideCar() {
|
||||
showSelfMarker = false
|
||||
mMarker?.setVisible(false)
|
||||
}
|
||||
|
||||
fun showCar() {
|
||||
showSelfMarker = true
|
||||
mMarker?.setVisible(true)
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ object BitmapDescriptorFactory {
|
||||
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
|
||||
)
|
||||
view.layout(0, 0, view.measuredWidth, view.measuredHeight)
|
||||
val bitmap = Bitmap.createBitmap(view.width, view.height, Bitmap.Config.ARGB_8888);
|
||||
val bitmap = Bitmap.createBitmap(view.width, view.height, Bitmap.Config.ARGB_8888)
|
||||
val canvas = Canvas(bitmap)
|
||||
// canvas.drawColor(Color.WHITE);
|
||||
view.draw(canvas);
|
||||
|
||||
@@ -10,6 +10,7 @@ class MogoMap private constructor() {
|
||||
private const val TAG = "MogoMap"
|
||||
|
||||
const val DEFAULT = "Default"
|
||||
const val MAP_ROAM = "MapRoam" //漫游地图实例
|
||||
|
||||
@JvmStatic
|
||||
val mapInstance by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
|
||||
@@ -36,7 +36,6 @@ import com.mogo.map.listener.MogoMapListenerHandler.Companion.mogoMapListenerHan
|
||||
import com.mogo.map.uicontroller.*
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MODE_MEDIUM_SIGHT
|
||||
import com.mogo.map.utils.MapTraceUtil
|
||||
import com.mogo.map.utils.MogoMapUtils
|
||||
import com.mogo.map.utils.MogoMapUtils.getLatLngBounds
|
||||
import com.mogo.map.utils.ObjectUtils
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
@@ -387,18 +386,22 @@ class AMapViewWrapper(mMapView: MapAutoView) : IMogoMapView, IMogoMapUIControlle
|
||||
override fun showMyLocation(visible: Boolean) {
|
||||
d(M_MAP + TAG, "showMyLocation1 $visible")
|
||||
// 如果是VR模式
|
||||
if (isVrMold) {
|
||||
return
|
||||
}
|
||||
// if (isVrMold) {
|
||||
// return
|
||||
// }
|
||||
// 不是VR模式情况强制刷新下
|
||||
if (checkAMapView()) {
|
||||
val style = mMapView.getMapAutoViewHelper()!!
|
||||
.getMyLocationStyle()
|
||||
if (visible) {
|
||||
// 强制刷新一遍车标
|
||||
style!!.myLocationIcon(mCarCursorOption!!.carCursorRes)
|
||||
style?.let {
|
||||
if (visible) {
|
||||
// 强制刷新一遍车标
|
||||
it.myLocationIcon(mCarCursorOption!!.carCursorRes)
|
||||
}else{
|
||||
it.hideCar()
|
||||
}
|
||||
mMapView.getMapAutoViewHelper()!!.setMyLocationStyle(style)
|
||||
}
|
||||
mMapView.getMapAutoViewHelper()!!.setMyLocationStyle(style!!)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ class AMapWrapper(map: MapAutoViewHelper?, mapView: MapAutoView, controller: IMo
|
||||
return AMapPolylineWrapper(options.id, delegate, mMapView)
|
||||
}
|
||||
|
||||
var batchMarkerOptions = BatchMarkerOptions()
|
||||
private val batchMarkerOptions = BatchMarkerOptions()
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
override fun updateBatchMarkerPosition(optionsArrayList: HashMap<String, TrackedObject>?) {
|
||||
|
||||
@@ -52,6 +52,10 @@ open class MogoMapView : MogoBaseMapView, ILifeCycle {
|
||||
}
|
||||
}
|
||||
|
||||
override fun getInstanceTag(): String {
|
||||
return ""
|
||||
}
|
||||
|
||||
/**
|
||||
* 子类实现
|
||||
* 代码StyleParams和XML初始化设置同时仅支持一种
|
||||
@@ -61,10 +65,6 @@ open class MogoMapView : MogoBaseMapView, ILifeCycle {
|
||||
protected val styleParams: MapStyleParams?
|
||||
protected get() = null
|
||||
|
||||
override fun getInstanceTag(): String {
|
||||
return MogoMap.DEFAULT
|
||||
}
|
||||
|
||||
override fun onCreate(bundle: Bundle?) {
|
||||
super.onCreate(bundle)
|
||||
d(TAG, "onCreate")
|
||||
|
||||