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 7b14131b7d..c38fb9c284 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 @@ -3,12 +3,15 @@ package com.mogo.eagle.core.function.business.travelreality.view import android.annotation.SuppressLint import android.content.Context import android.graphics.Bitmap +import android.graphics.Color import android.util.AttributeSet import android.view.LayoutInflater import android.widget.ImageView import android.widget.TextView import androidx.constraintlayout.widget.ConstraintLayout +import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.function.map.R +import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils @SuppressLint("ViewConstructor") class EventVideoView @JvmOverloads constructor( @@ -46,8 +49,26 @@ 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 0b4171b191..ef11387aa9 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 @@ -341,11 +341,11 @@ class TravelRealityView @JvmOverloads constructor( override fun onAttachedToWindow() { super.onAttachedToWindow() + initHandlers() + advanceRequest() CallerPlanningRottingListenerManager.addListener(TAG, this) // 注册定位监听 CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this) - initHandlers() - advanceRequest() } override fun onDetachedFromWindow() { @@ -1078,7 +1078,7 @@ class TravelRealityView @JvmOverloads constructor( lastTime = System.currentTimeMillis() } globalPathResp?.let { globalPath -> - nonFrequentHandler?.removeCallbacksAndMessages(null) +// nonFrequentHandler?.removeCallbacksAndMessages(null) travelNetWorkModel.cancelAllRequest() val pointList = ArrayList() diff --git a/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_video_down_driver_bg.png b/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_video_down_driver_bg.png new file mode 100644 index 0000000000..920cdd8523 Binary files /dev/null and b/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_video_down_driver_bg.png differ diff --git a/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_video_left_driver_bg.png b/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_video_left_driver_bg.png new file mode 100644 index 0000000000..a56673ecb2 Binary files /dev/null and b/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_video_left_driver_bg.png differ diff --git a/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_video_right_driver_bg.png b/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_video_right_driver_bg.png new file mode 100644 index 0000000000..406e0585fc Binary files /dev/null and b/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_video_right_driver_bg.png differ diff --git a/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_video_up_driver_bg.png b/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_video_up_driver_bg.png new file mode 100644 index 0000000000..62661f529a Binary files /dev/null and b/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi/event_video_up_driver_bg.png differ 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 4f03120e6b..ade8905745 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 @@ -2,6 +2,7 @@ diff --git a/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_left_maker.xml b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_left_maker.xml index 225cdd109a..e3485fae2a 100644 --- a/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_left_maker.xml +++ b/core/function-impl/mogo-core-function-map/src/main/res/layout/layout_event_toward_left_maker.xml @@ -2,6 +2,7 @@ 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 98f8b48e9a..8db1de80ff 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 @@ -2,6 +2,7 @@ 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 fe668d1160..7a5af0f22a 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 @@ -2,6 +2,7 @@ diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/MapDataWrapper.kt b/libraries/mogo-map/src/main/java/com/mogo/map/MapDataWrapper.kt index 14077336b2..3c581ec2ce 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/MapDataWrapper.kt +++ b/libraries/mogo-map/src/main/java/com/mogo/map/MapDataWrapper.kt @@ -1,5 +1,6 @@ package com.mogo.map +import android.os.Looper import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i import com.mogo.eagle.core.utilcode.mogo.logger.Logger @@ -23,6 +24,7 @@ import com.zhidaoauto.map.sdk.open.abs.OnHdDataDownByCityListener import com.zhidaoauto.map.sdk.open.data.CityInfo import com.zhidaoauto.map.sdk.open.data.MapDataApi import java.util.concurrent.CountDownLatch +import java.util.concurrent.TimeUnit.SECONDS import java.util.concurrent.atomic.AtomicReference /** @@ -258,20 +260,33 @@ object MapDataWrapper : IMogoData { lat: Double, angle: Float ): com.mogo.map.entities.RoadInfo { + if (Looper.getMainLooper() == Looper.myLooper()) { + throw AssertionError() + } val latch = CountDownLatch(1) var tempCode: Int = Int.MIN_VALUE var tempData: RoadNameInfo? = null Logger.d(TAG, "getRoadInfo --- 1 ---") MapDataApi.getRoadName(lon, lat, angle, object : IResult { override fun result(code: Int, result: RoadNameInfo?) { - Logger.d(TAG, "getRoadInfo ==> code: $code, result: $result") - tempCode = code - tempData = result - latch.countDown() + try { + Logger.d(TAG, "getRoadInfo ==> code: $code, result: $result") + tempCode = code + tempData = result + } finally { + latch.countDown() + } } }) - latch.await() - Logger.d(TAG, "getRoadInfo --- 2 ---: code -> $tempCode, data -> $tempData") + try { + if (latch.await(5, SECONDS)) { + Logger.d(TAG, "getRoadInfo --- 2 ---: code -> $tempCode, data -> $tempData") + } else { + Logger.d(TAG, "getRoadInfo --- 3 ---: code -> $tempCode, data -> $tempData") + } + } catch (e: InterruptedException) { + e.printStackTrace() + } return com.mogo.map.entities.RoadInfo( tempCode, tempData?.tile_id?.toLong() ?: 0L, @@ -306,16 +321,33 @@ object MapDataWrapper : IMogoData { } override fun getCrossRoad(lon: Double, lat: Double, angle: Double): CrossRoad? { + if (Looper.getMainLooper() == Looper.myLooper()) { + throw AssertionError() + } val latch = CountDownLatch(1) + Logger.d(TAG, "getCrossRoad --- 1 ---") val temp = AtomicReference() MapDataApi.getCrossRoad(lon, lat, angle.toFloat(), object : IResult { override fun result(code: Int, result: RoadCross?) { - temp.set(CrossRoad(result?.status ?: 0, result?.tile_id ?: "", result?.cross_id ?: "", result?.tile_id_end ?: "", result?.cross_id_end ?: "")) - latch.countDown() + try { + Logger.d(TAG, "getCrossRoad --- 1 - 1 ---") + temp.set(CrossRoad(result?.status ?: 0, result?.tile_id ?: "", result?.cross_id ?: "", result?.tile_id_end ?: "", result?.cross_id_end ?: "")) + } finally { + latch.countDown() + } } }) - latch.await() + try { + Logger.d(TAG, "getCrossRoad --- 2 ---") + if (latch.await(5, SECONDS)) { + Logger.d(TAG, "getCrossRoad --- 3 ---") + } else { + Logger.d(TAG, "getCrossRoad --- 4 ---") + } + } catch (e: InterruptedException) { + e.printStackTrace() + } return temp.get() } } \ No newline at end of file