diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/travelreality/TravelRealityModel.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/travelreality/TravelRealityModel.kt index cc4b539ae4..812bcafdff 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/travelreality/TravelRealityModel.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/travelreality/TravelRealityModel.kt @@ -12,6 +12,7 @@ import com.bumptech.glide.request.transition.Transition import com.mogo.commons.constants.HostConst import com.mogo.eagle.core.data.BaseResponse import com.mogo.eagle.core.data.Response +import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.road.RoadCameraLive import com.mogo.eagle.core.function.business.roadcross.net.BATCH_LIVE import com.mogo.eagle.core.function.business.roadcross.net.INDERoadCameraApiService @@ -22,6 +23,7 @@ import com.mogo.eagle.core.network.apiCall import com.mogo.eagle.core.network.apiResponseCall import com.mogo.eagle.core.network.cancel import com.mogo.eagle.core.network.request +import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils import com.mogo.eagle.core.utilcode.util.LocationUtils import com.mogo.eagle.core.utilcode.util.Md5Util @@ -309,21 +311,41 @@ class TravelRealityModel private constructor() { */ fun calculateAnchor(orientation: Int): Pair { // 0:左,1:上,2:右,3:下 - return when (orientation) { - 0 -> { - Pair(0.94f, 0.48f) - } + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + return when (orientation) { + 0 -> { + Pair(0.98f, 0.51f) + } - 1 -> { - Pair(0.49f, 0.94f) - } + 1 -> { + Pair(0.49f, 0.99f) + } - 2 -> { - Pair(0.05f, 0.47f) - } + 2 -> { + Pair(0.02f, 0.49f) + } - else -> { - Pair(0.50f, 0.04f) + else -> { + Pair(0.51f, 0.02f) + } + } + } else { + return when (orientation) { + 0 -> { + Pair(0.94f, 0.48f) + } + + 1 -> { + Pair(0.49f, 0.94f) + } + + 2 -> { + Pair(0.05f, 0.47f) + } + + else -> { + Pair(0.50f, 0.04f) + } } } } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/travelreality/view/EventVideoView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/travelreality/view/EventVideoView.kt index c38fb9c284..ca4de5deb5 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/travelreality/view/EventVideoView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/travelreality/view/EventVideoView.kt @@ -30,16 +30,32 @@ class EventVideoView @JvmOverloads constructor( // 0:左,1:上,2:右,3:下 when (orientation) { 0 -> { - LayoutInflater.from(context).inflate(R.layout.layout_event_toward_right_maker, this, true) + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + LayoutInflater.from(context).inflate(R.layout.layout_event_toward_right_d_maker, this, true) + } else { + LayoutInflater.from(context).inflate(R.layout.layout_event_toward_right_maker, this, true) + } } 1 -> { - LayoutInflater.from(context).inflate(R.layout.layout_event_toward_down_maker, this, true) + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + LayoutInflater.from(context).inflate(R.layout.layout_event_toward_down_d_maker, this, true) + } else { + LayoutInflater.from(context).inflate(R.layout.layout_event_toward_down_maker, this, true) + } } 2 -> { - LayoutInflater.from(context).inflate(R.layout.layout_event_toward_left_maker, this, true) + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + LayoutInflater.from(context).inflate(R.layout.layout_event_toward_left_d_maker, this, true) + } else { + LayoutInflater.from(context).inflate(R.layout.layout_event_toward_left_maker, this, true) + } } else -> { - LayoutInflater.from(context).inflate(R.layout.layout_event_toward_up_maker, this, true) + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + LayoutInflater.from(context).inflate(R.layout.layout_event_toward_up_d_maker, this, true) + } else { + LayoutInflater.from(context).inflate(R.layout.layout_event_toward_up_maker, this, true) + } } } initView() @@ -49,26 +65,7 @@ class EventVideoView @JvmOverloads constructor( private fun initView() { videoImgView = findViewById(R.id.videoImg) - val eventLayout = findViewById(R.id.eventMarkerLayout) val titleView = findViewById(R.id.tvTitle) - - if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - when (orientation) { - 0 -> { - eventLayout.setBackgroundResource(R.drawable.event_video_right_driver_bg) - } - 1 -> { - eventLayout.setBackgroundResource(R.drawable.event_video_down_driver_bg) - } - 2 -> { - eventLayout.setBackgroundResource(R.drawable.event_video_left_driver_bg) - } - else -> { - eventLayout.setBackgroundResource(R.drawable.event_video_up_driver_bg) - } - } - titleView.setTextColor(Color.WHITE) - } title?.let { titleView.text = it } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt index a04230295e..e6c6887e98 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/TravelRealityView.kt @@ -129,6 +129,7 @@ class TravelRealityView @JvmOverloads constructor( private var topPadding: Int = 150 private var rightPadding: Int = 100 private var bottomPadding: Int = 300 + private var isSmaller = false // 绘制智慧道路的范围 private var roadRange = 56f @@ -239,6 +240,7 @@ class TravelRealityView @JvmOverloads constructor( topPadding = typedArray.getInt(R.styleable.TravelRealityView_topPadding, 0) rightPadding = typedArray.getInt(R.styleable.TravelRealityView_rightPadding, 0) bottomPadding = typedArray.getInt(R.styleable.TravelRealityView_bottomPadding, 0) + isSmaller = typedArray.getBoolean(R.styleable.TravelRealityView_isSmaller, false) typedArray.recycle() initView(context) } catch (e: Exception) { diff --git a/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_logo_d_icon.png b/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_logo_d_icon.png new file mode 100644 index 0000000000..6c5073d2bb Binary files /dev/null and b/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_logo_d_icon.png differ diff --git a/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_down_d_maker.xml b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_down_d_maker.xml new file mode 100644 index 0000000000..15580527b3 --- /dev/null +++ b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_down_d_maker.xml @@ -0,0 +1,48 @@ + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_down_maker.xml b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_down_maker.xml index ade8905745..554db4dde0 100644 --- a/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_down_maker.xml +++ b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_down_maker.xml @@ -15,6 +15,7 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" android:layout_marginTop="15dp" + android:scaleType="fitXY" /> + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_right_d_maker.xml b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_right_d_maker.xml new file mode 100644 index 0000000000..cf88175489 --- /dev/null +++ b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_right_d_maker.xml @@ -0,0 +1,47 @@ + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_right_maker.xml b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_right_maker.xml index 8db1de80ff..a1ac58b92f 100644 --- a/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_right_maker.xml +++ b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_right_maker.xml @@ -15,6 +15,7 @@ app:layout_constraintTop_toTopOf="parent" android:layout_marginTop="15dp" android:layout_marginStart="20dp" + android:scaleType="fitXY" /> + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_up_maker.xml b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_up_maker.xml index 7a5af0f22a..798c3457be 100644 --- a/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_up_maker.xml +++ b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_up_maker.xml @@ -15,6 +15,7 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" android:layout_marginTop="87dp" + android:scaleType="fitXY" /> + + \ No newline at end of file