Merge branch 'dev_robo_240612_6.5.0_tmp' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robo_240612_6.5.0_tmp

This commit is contained in:
aibingbing
2024-06-27 19:24:36 +08:00
60 changed files with 1413 additions and 334 deletions

View File

@@ -67,8 +67,9 @@ dependencies {
kapt rootProject.ext.dependencies.androidxroomcompiler
implementation rootProject.ext.dependencies.androidxroomktx
implementation rootProject.ext.dependencies.localbroadcastmanager
implementation rootProject.ext.dependencies.jts_core
compileOnly project(':core:function-impl:mogo-core-function-map')
compileOnly project(":libraries:mogo-map")
implementation project(':foudations:mogo-commons')
implementation project(':core:mogo-core-utils')
implementation project(':core:mogo-core-network')

View File

@@ -26,19 +26,25 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListen
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager.V2NCarTypeCheck
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.hmi.CallerRoadV2NEventWindowListenerManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager.saveMsgBox
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.CoordinateTransform
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
import com.mogo.eagle.function.biz.v2x.V2XBizTrace
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker.Marker
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2NUtils
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager
import com.mogo.map.entities.Lane
import mogo.telematics.pad.MessagePad.Header
import mogo.telematics.pad.MessagePad.TrackedObject
import mogo.v2x.MogoV2X
import mogo.v2x.MogoV2X.RSI_PB
import mogo.v2x.MogoV2X.RTEData_PB
import java.lang.Math.abs
/**
* V2N上车相关事件绘制
@@ -64,7 +70,7 @@ internal object V2NIdentifyDrawer {
Log.d("V2NIdentifyDrawer", "---callback -- drawShiGu --- 1 ---")
}
val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
val filtered = events.filterIsInstance(TrackedObject::class.java).filter { itx ->
val filtered = events.filterIsInstance<TrackedObject>().filter { itx ->
DrivingDirectionUtils.getDegreeOfCar2Poi(
car.longitude,
car.latitude,
@@ -140,33 +146,62 @@ internal object V2NIdentifyDrawer {
)
)
)
CallerHmiManager.warningV2X(
poiType,
alertContent,
ttsContent,
object : IMoGoWarningStatusListener {
override fun onShow() {
super.onShow()
runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), State.START) }
CallerVisualAngleManager.changeAngle(
RoadEvent(
itx.longitude,
itx.latitude,
itx.angle
)
)
// CallerHmiManager.warningV2X(
// poiType,
// alertContent,
// ttsContent,
// object : IMoGoWarningStatusListener {
// override fun onShow() {
// super.onShow()
// runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), State.START) }
// CallerVisualAngleManager.changeAngle(
// RoadEvent(
// itx.longitude,
// itx.latitude,
// itx.angle
// )
// )
// }
//
// override fun onDismiss() {
// super.onDismiss()
// runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), State.STOP) }
// CallerVisualAngleManager.changeAngle(Default())
// }
// },
// ALERT_WARNING_TOP,
// 10000,
// false
// )
if (polygon.isNotEmpty()) {
val decision = V2NUtils.computeOccupyLanesInfo(Triple(car.longitude, car.latitude, car.heading.toFloat()), Triple(itx.longitude, itx.latitude, itx.heading.toFloat()), polygon.map { kotlin.Pair(it.first, it.second) })
if (decision != null) {
val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
val total = decision.total
val occupy = decision.occupy
val laneId = decision.laneId
val sb = StringBuilder()
if (laneId != null) {
val isOccupy = occupy.find { it.id == laneId } != null
if (isOccupy) {
if (isDriver) {
val bestLane = computeBestLane(laneId, occupy, total)
sb.append("发现前方${distance.toInt()}${ if (poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType) "车道施工" else "车道事故" }, 蘑菇建议您尽快${bestLane.second}")
} else {
sb.append("发现前方${distance.toInt()}${ if (poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType) "车道施工" else "车道事故" }, 蘑菇时刻为您守护")
}
} else {
if (isDriver) {
sb.append("发现前方${distance.toInt()}${ if (poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType) "车道施工" else "车道事故" }, 蘑菇提醒您小心${ if (computeDirection(laneId, occupy) > 0) "右侧" else "左侧" }行人及来车")
} else {
sb.append("发现前方${distance.toInt()}${ if (poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType) "车道施工" else "车道事故" }, 蘑菇时刻为您守护")
}
}
}
override fun onDismiss() {
super.onDismiss()
runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), State.STOP) }
CallerVisualAngleManager.changeAngle(Default())
}
},
ALERT_WARNING_TOP,
10000,
false
)
val alert = sb.toString()
CallerRoadV2NEventWindowListenerManager.show("${itx.longitude}-${itx.latitude}", itx.systemTime.toLong(), EventTypeEnumNew.getMarker3DRes(poiType), alert, isDriver, itx.cameraIp, itx.longitude, itx.latitude)
}
}
//消息埋点
V2XEventAnalyticsManager.triggerV2XEvent(
poiType, alertContent, ttsContent,
@@ -184,7 +219,7 @@ internal object V2NIdentifyDrawer {
return@Callback true
}
val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
val filtered = events.filterIsInstance(MogoV2X.RTEData_PB::class.java).filter { itx ->
val filtered = events.filterIsInstance<RTEData_PB>().filter { itx ->
val eventLon =
itx.eventPos?.offsetLL?.positionLatLon?.lon?.let { it * 1.0 / 10_000_000 }
?: 0.0
@@ -291,6 +326,55 @@ internal object V2NIdentifyDrawer {
true
}
private fun computeDirection(laneId: Int, occupy: List<Lane>): Int {
val left = occupy.first()
return if (laneId <= left.id) {
1
} else {
-1
}
}
private fun computeBestLane(laneId: Int, occupy: List<Lane>, total: List<Lane>): kotlin.Pair<Int, String> {
if (occupy.size == total.size) {
return kotlin.Pair(Int.MIN_VALUE, "更换路线")
}
val map = HashMap<Int, String>()
if (total.size % 2 == 0) {
val half = total.size / 2
for (i in 0 until half) {
val left = total[i]
val right = total[half + i]
map[left.id] = "驶入左${i + 1}车道"
map[right.id] = "驶入右${i + 1}车道"
}
} else {
val middle = total.size / 2
map[total[middle].id] = "驶入中间车道"
for (i in 0 until middle) {
val left = total[i]
val right = total[middle + i + 1]
map[left.id] = "驶入左${i + 1}车道"
map[right.id] = "驶入右${i + 1}车道"
}
}
val ids = occupy.map { it.id }
val freeLanes = total.filter { itx -> !ids.contains(itx.id) }
if (freeLanes.isNotEmpty()) {
var best = Int.MIN_VALUE
var delta = Int.MAX_VALUE
for (lane in freeLanes) {
val abs = kotlin.math.abs(lane.id - laneId)
if (abs < delta && lane.id != laneId) {
best = lane.id
delta = abs
}
}
return kotlin.Pair(best, map[best] ?: "更换路线")
}
return kotlin.Pair(Int.MIN_VALUE, "更换路线")
}
private fun getTtsContent(poiType: String, distance: Double): String {
return when (poiType) {
EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType -> {

View File

@@ -5,17 +5,16 @@ import android.graphics.Color
import android.os.Handler
import android.os.HandlerThread
import android.os.Looper
import android.util.Log
import android.view.animation.DecelerateInterpolator
import androidx.core.util.Pair
import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerRoadV2NEventWindowListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
import com.mogo.eagle.function.biz.v2x.V2XBizTrace
import com.mogo.eagle.function.biz.v2x.v2n.V2XEventManager
import com.mogo.eagle.function.biz.v2x.v2n.consts.V2XConst
import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerRemoveManager
import com.mogo.eagle.function.biz.v2x.v2n.remove.MarkerWrapper
@@ -232,7 +231,10 @@ class AiRoadMarker {
wrapper.addLine(line)
}
wrapper.onRemoved = { id ->
aiMakers.remove(id)
aiMakers.remove(id)?.also {
val m = it.marker.get()
CallerRoadV2NEventWindowListenerManager.dismiss("${m.poi_lon}-${m.poi_lat}")
}
}
MarkerRemoveManager.addMarker(wrapper)
countDown.set(0)
@@ -257,6 +259,7 @@ class AiRoadMarker {
roadMarker.removeMarkers()
handler.removeCallbacks(checkExpiredTask)
aiMakers.remove(marker.id)
CallerRoadV2NEventWindowListenerManager.dismiss("${marker.poi_lon}-${marker.poi_lat}")
}
}

View File

@@ -0,0 +1,45 @@
package com.mogo.eagle.function.biz.v2x.v2n.utils
import android.util.Log
import androidx.annotation.WorkerThread
import com.mogo.map.MapDataWrapper
import com.mogo.map.entities.Lane
import com.zhidaoauto.map.data.road.CenterLine
import org.locationtech.jts.geom.Coordinate
import org.locationtech.jts.geom.GeometryFactory
import java.util.concurrent.CountDownLatch
object V2NUtils {
private const val TAG = "V2NUtils"
@WorkerThread
fun computeOccupyLanesInfo(car: Triple<Double, Double, Float>, point: Triple<Double, Double, Float> ,polygon: List<Pair<Double, Double>>): Decision? {
val roadInfo = MapDataWrapper.getRoadInfo(point.first, point.second, point.third)
Log.d(TAG, "road_info:$roadInfo")
val lanes = MapDataWrapper.getLaneInfo(roadInfo.tileId, roadInfo.roadId)
Log.d(TAG, "lanes: ${lanes.joinToString(",") { itx -> itx.points.joinToString(",") { "${it.first}, ${it.second}" } } }")
if (lanes.isEmpty()) {
return null
}
val occupy = ArrayList<Lane>()
val factory = GeometryFactory()
for (lane in lanes) {
val p1 = factory.createPolygon(polygon.map { Coordinate(it.first, it.second) }.toTypedArray())
val p2 = factory.createLineString(lane.points.map { Coordinate(it.first, it.second) }.toTypedArray()).buffer((lane.width.toDouble() * 0.7 * (1e-5)) / 2.0)
if (p1.intersects(p2)) {
occupy += lane
}
}
val latch = CountDownLatch(1)
var centerLine: CenterLine? = null
MapDataWrapper.getCenterLineInfo(car.first, car.second, car.third) {
centerLine = it
latch.countDown()
}
latch.await()
return Decision(centerLine?.lane_id?.toInt() , lanes, occupy)
}
data class Decision(val laneId: Int? = null,val total: List<Lane>, val occupy: List<Lane>)
}

View File

@@ -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)
}

View File

@@ -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()
}
}

View File

@@ -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)
//展示状态中心

View File

@@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -127,4 +127,6 @@
<string name="exploration_title">正在为您探查前方道路</string>
<string name="exploration_close">自动探索关闭按钮</string>
<string name="road_cross_live_tip">蘑菇为您实时护航中,请放心驾驶!</string>
</resources>

View File

@@ -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')

View File

@@ -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()

View File

@@ -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查询设备直播流与缩略图

View File

@@ -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)

View File

@@ -172,9 +172,9 @@ public class RouteOverlayDrawer {
}
double lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude();
double lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude();
if (points.size() > 0) {
if (!points.isEmpty()) {
MogoLatLng top = null;
while (points.size() != 0) {
while (!points.isEmpty()) {
MogoLatLng first = points.peek();
if (first == null) {
continue;
@@ -194,7 +194,7 @@ public class RouteOverlayDrawer {
}
top = first;
}
if (points.size() == 0) {
if (points.isEmpty()) {
isExcept = true;
return;
}
@@ -251,7 +251,7 @@ public class RouteOverlayDrawer {
if (isExcept) {
setVisible(false);
}
if (points.size() > 0) {
if (!points.isEmpty()) {
for (int i = 0; i < points.size(); i++) {
MogoLatLng latLng = points.get(i);
if (latLng == null) {

View File

@@ -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) {

View File

@@ -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
}

View File

@@ -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()
}
}

View File

@@ -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(1,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)
}
}

View File

@@ -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)
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -1,3 +1,4 @@
<resources>
<string name="app_name">mogo-core-function-map</string>
<string name="road_cross_roam_tip">前方即将进入全息路口\n为您全面扫描潜在风险</string>
</resources>