From 89ed9838a3eb42dc93f8e060b7f907589790e047 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Fri, 17 Feb 2023 14:21:18 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20[Change]=20[=201?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E5=A4=8DEB5=E5=89=AF=E5=B1=8F=E5=B9=95?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../location/MoGoLocationDispatcher.kt | 2 ++ .../core/utilcode/util/MultiDisplayUtils.kt | 21 ++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt index 4c43812fbe..93e8d1f7f2 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt @@ -17,6 +17,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84Lis import com.mogo.eagle.core.function.call.obu.CallerObuLocationWGS84ListenerManager import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr import com.mogo.eagle.core.utilcode.util.CoordinateTransform +import com.mogo.eagle.core.utilcode.util.MultiDisplayUtils import com.mogo.eagle.core.utilcode.util.TimeUtils import com.mogo.eagle.core.utilcode.util.Utils import com.mogo.support.obu.model.MogoObuHvBasicsData @@ -124,6 +125,7 @@ object MoGoLocationDispatcher : DataSourceType.TELEMATIC ) } + MultiDisplayUtils.getOtherDisplay() } /** diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/MultiDisplayUtils.kt b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/MultiDisplayUtils.kt index e14d16cc03..4010261abe 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/MultiDisplayUtils.kt +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/MultiDisplayUtils.kt @@ -39,10 +39,11 @@ object MultiDisplayUtils { // 获取除了内置屏幕(主屏幕)的其它屏幕 val displays = mDisplayManager.getDisplays(DisplayManager.DISPLAY_CATEGORY_PRESENTATION) // 初始化新的集合进行接收排序后的屏幕信息 - val displaysList = arrayOfNulls(displays.size) + var displaysList = arrayOfNulls(displays.size) // 判断副屏个数 if (displays.isNotEmpty()) { + displaysList = arrayOfNulls(displays.size) // 循环出来副屏幕进行重新排序 for (i in displays.indices) { // 这里如果需要固定某个屏幕, 使用 if( display.toString().indexOf("port=1")!=-1) ) 而不是使用 display[i] @@ -62,6 +63,18 @@ object MultiDisplayUtils { } } } + // 处理EB5副屏幕 + else { + if (mDisplayManager.displays.isNotEmpty()) { + displaysList = arrayOfNulls(1) + // EB5目前副屏幕ID为固定4096 + for (i in mDisplayManager.displays.indices) { + if (mDisplayManager.displays[i].displayId == 4096) { + displaysList[0] = mDisplayManager.displays[i] + } + } + } + } return displaysList } @@ -83,11 +96,9 @@ object MultiDisplayUtils { * @param activity 要在第二个屏幕启动的页面 */ fun startActWithSecond(context: Context, activity: Class<*>) { - val launchDisplayId: Int if (isSupportMultiDisplay(context)) { - if (getOtherDisplay().size > 1 && getOtherDisplay()[0] != null) { - launchDisplayId = getOtherDisplay()[0]!!.displayId - + if (getOtherDisplay().isNotEmpty() && getOtherDisplay()[0] != null) { + val launchDisplayId = getOtherDisplay()[0]!!.displayId // 要加上Intent.FLAG_ACTIVITY_NEW_TASK val options = ActivityOptions.makeBasic() options.launchDisplayId = launchDisplayId From d96170e45bc9302797a9bf778829e09092f2fe28 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Fri, 17 Feb 2023 14:41:23 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[Opt]=E5=85=A8=E8=A7=88=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=B8=85=E9=99=A4=E5=B7=B2=E8=B5=B0=E8=BF=87?= =?UTF-8?q?=E7=9A=84=E8=BD=A8=E8=BF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/core/function/view/OverMapView.kt | 50 ++++++++++++++++--- .../src/main/res/values/attrs.xml | 6 +++ 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt index 880661cafd..f26b486ee8 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt @@ -1,5 +1,6 @@ package com.mogo.eagle.core.function.view +import android.annotation.SuppressLint import android.content.Context import android.graphics.Bitmap import android.graphics.Canvas @@ -12,6 +13,7 @@ import android.view.View import android.widget.RelativeLayout import android.widget.TextView import androidx.annotation.MainThread +import androidx.core.graphics.drawable.toBitmap import ch.hsr.geohash.GeoHash import com.amap.api.maps.AMap import com.amap.api.maps.CameraUpdate @@ -66,6 +68,9 @@ class OverMapView @JvmOverloads constructor( private var arrivedDrawable: Int = -1 private var unArrivedDrawable: Int = -1 private var resetDrawable: Int = -1 + private var resetDrawableMarginRight: Int = -1 + private var resetDrawableMarginBottom: Int = -1 + private var isClearArrived: Boolean = false private var mMapView: TextureMapView? = null private var mAMap: AMap? = null @@ -92,6 +97,7 @@ class OverMapView @JvmOverloads constructor( // 计算索引并设置对应的Bitmap var arrivedBitmap: BitmapDescriptor? = null var unArrivedBitmap: BitmapDescriptor? = null + var transparentBitmap: BitmapDescriptor? = null // 绘制轨迹线的集合 private val textureList: MutableList = ArrayList() @@ -121,6 +127,15 @@ class OverMapView @JvmOverloads constructor( unArrivedDrawable = typedArray.getResourceId(R.styleable.OverMapView_unArrivedDrawable, -1) resetDrawable = typedArray.getResourceId(R.styleable.OverMapView_resetDrawable, -1) + resetDrawableMarginRight = typedArray.getResourceId( + R.styleable.OverMapView_resetDrawableMarginRight, + AutoSizeUtils.dp2px(context, 40f) + ) + resetDrawableMarginBottom = typedArray.getResourceId( + R.styleable.OverMapView_resetDrawableMarginBottom, + AutoSizeUtils.dp2px(context, 40f) + ) + isClearArrived = typedArray.getBoolean(R.styleable.OverMapView_isClearArrived, false) typedArray.recycle() initView(context) } catch (e: Exception) { @@ -170,7 +185,12 @@ class OverMapView @JvmOverloads constructor( * (anchorX,anchorY)为锚点坐标,各自取值范围为[0,1],默认值为(0.5,1) */ @MainThread - fun drawSiteMarkers(siteLatLngs: List?, bitmap: Bitmap, anchorX: Float, anchorY: Float) { + fun drawSiteMarkers( + siteLatLngs: List?, + bitmap: Bitmap, + anchorX: Float, + anchorY: Float + ) { if (siteLatLngs.isNullOrEmpty()) return clearSiteMarkers() val markerOptionsList = ArrayList() @@ -210,6 +230,7 @@ class OverMapView @JvmOverloads constructor( mEndMarker?.isVisible = false } + @SuppressLint("UseCompatLoadingForDrawables") private fun initView(context: Context) { mContext = context val smpView = LayoutInflater.from(context).inflate(R.layout.module_overview_map_view, this) @@ -221,12 +242,25 @@ class OverMapView @JvmOverloads constructor( BitmapDescriptorFactory.fromResource(if (arrivedDrawable != -1) arrivedDrawable else R.drawable.taxi_map_arrow_arrived) unArrivedBitmap = BitmapDescriptorFactory.fromResource(if (unArrivedDrawable != -1) unArrivedDrawable else R.drawable.taxi_map_arrow_un_arrive) + transparentBitmap = BitmapDescriptorFactory.fromBitmap( + resources.getDrawable(R.drawable.transparent_background, null) + .toBitmap(AutoSizeUtils.dp2px(context, 32f), AutoSizeUtils.dp2px(context, 230f)) + ) CallerPlanningRottingListenerManager.addListener(TAG, this) initAMapView(context) // 注册定位监听 CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this) //设置全览模式 overLayerView?.setOnClickListener { displayCustomOverView() } + overLayerView?.let { + it.background = + resources.getDrawable(if (resetDrawable != -1) resetDrawable else R.drawable.amap_reset) + val layoutParams = it.layoutParams + layoutParams as RelativeLayout.LayoutParams + layoutParams.rightMargin = resetDrawableMarginRight + layoutParams.bottomMargin = resetDrawableMarginBottom + it.layoutParams = layoutParams + } } private fun initAMapView(context: Context) { @@ -511,7 +545,7 @@ class OverMapView @JvmOverloads constructor( */ private fun displayCustomOverView() { val linePointsLatLng = planningPoints - if (linePointsLatLng.size > 1) { + if (linePointsLatLng.size > 1 && mLocation != null) { //圈定地图显示范围 //存放经纬度 val boundsBuilder = LatLngBounds.Builder() @@ -595,15 +629,15 @@ class OverMapView @JvmOverloads constructor( } for (i in coordinates.indices) { if (i <= locIndex) { - // 已走过的置灰 - arrivedBitmap?.let { - textureList.add(it) + if (isClearArrived) { + textureList.add(transparentBitmap) + } else { + // 已走过的置灰 + textureList.add(arrivedBitmap) } } else { // 未走过的纹理 - unArrivedBitmap?.let { - textureList.add(it) - } + textureList.add(unArrivedBitmap) } texIndexList.add(i) } diff --git a/core/function-impl/mogo-core-function-map/src/main/res/values/attrs.xml b/core/function-impl/mogo-core-function-map/src/main/res/values/attrs.xml index 8fd1ef1348..0d3349fc35 100644 --- a/core/function-impl/mogo-core-function-map/src/main/res/values/attrs.xml +++ b/core/function-impl/mogo-core-function-map/src/main/res/values/attrs.xml @@ -18,5 +18,11 @@ + + + + + + \ No newline at end of file From 38c5d1f660fc8983031b0aec7e85d13ef40f788c Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Fri, 17 Feb 2023 15:10:53 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[opt=203.0][adas=20lib]=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0BUS=20R=E6=A1=A3=E4=B8=8D=E8=83=BD=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=A9=BE=E9=A9=B6=E6=8B=A6=E6=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../support/adas/high/common/AutopilotAbilityManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/AutopilotAbilityManager.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/AutopilotAbilityManager.java index 733e87d82a..03ec76b745 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/AutopilotAbilityManager.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/AutopilotAbilityManager.java @@ -213,7 +213,7 @@ public class AutopilotAbilityManager { if (!IDENTITY_MODE.BUS_DRIVER_VAN.equalsIgnoreCase(identityMode)) { //金旅Bus和清扫车 档位不正常 if (IDENTITY_MODE.BUS_DRIVER_BASE.equalsIgnoreCase(identityMode) || IDENTITY_MODE.SWEEPER_DRIVER_FT.equalsIgnoreCase(identityMode)) { - if (gear == Chassis.GearPosition.GEAR_N) { + if (gear == Chassis.GearPosition.GEAR_N || gear == Chassis.GearPosition.GEAR_R) { isAutopilotAbility = false; unableAutopilotReason = "挡位不正常"; }