From 563764d9aa217e95e3b2cbddfbd43dfaf878ed91 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Fri, 19 Jul 2024 15:44:15 +0800 Subject: [PATCH] =?UTF-8?q?[6.5.0][Opt]=E4=BC=98=E5=8C=96=E4=B8=8B?= =?UTF-8?q?=E5=8F=B8=E6=9C=BA=E5=B1=8FUI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../travelreality/TravelRealityModel.kt | 46 ++++++++++++----- .../travelreality/view/EventVideoView.kt | 43 ++++++++-------- .../core/function/view/TravelRealityView.kt | 2 + .../res/drawable-xhdpi/event_logo_d_icon.png | Bin 0 -> 1638 bytes .../layout_event_toward_down_d_maker.xml | 48 ++++++++++++++++++ .../layout/layout_event_toward_down_maker.xml | 1 + .../layout_event_toward_left_d_maker.xml | 48 ++++++++++++++++++ .../layout_event_toward_right_d_maker.xml | 47 +++++++++++++++++ .../layout_event_toward_right_maker.xml | 1 + .../layout/layout_event_toward_up_d_maker.xml | 48 ++++++++++++++++++ .../layout/layout_event_toward_up_maker.xml | 1 + .../src/main/res/values/attrs.xml | 2 + 12 files changed, 252 insertions(+), 35 deletions(-) create mode 100644 core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_logo_d_icon.png create mode 100644 core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_down_d_maker.xml create mode 100644 core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_left_d_maker.xml create mode 100644 core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_right_d_maker.xml create mode 100644 core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_up_d_maker.xml 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 0000000000000000000000000000000000000000..6c5073d2bbdcd8d90c975feccc7d9277826c7de8 GIT binary patch literal 1638 zcmV-s2ATPZP)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t`7KDe-v$l=jNp z_IY8C;T1m7l}w_ml#I5a)HMwkL~wc_Rikynwa`zIhk%o`kJ8qr=@zV~twkxJzaZ;d zGbD7a5Kd%XeG)!@M|d} zT;*aJ(0nR8z0qaCWzzw;OmaPRD}K6BBHhjn39)N!ic7an^VUlnd)+XoNl-D1llp)) z_FP7*GJwG)B-k?z8h4MtxF(n_-WH3`Ge^SxSC3Swh@<5Slw>)io#<4fodfzYe`O7J z#Ezr3d3Ik4*+ly3^Rq5lv&RPU{ux7yCwXJqrNeh<;Ab-6R>V4(c*fAU3;%Sr!15z? ke4WV%R@=e56ThU)pElHt=Y8$w?*IS*07*qoM6N<$g6z@sZvX%Q literal 0 HcmV?d00001 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