Merge remote-tracking branch 'origin/dev_MogoAP_eagle-1030_211020_8.0.14' into dev_MogoAP_eagle-1030_211020_8.0.14
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
android:id="@+id/module_push_dialog_acc_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_54"
|
||||
android:layout_marginTop="@dimen/dp_58"
|
||||
android:text="官方公告"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_56"
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.v2x.trafficlight.core
|
||||
import android.content.Context
|
||||
import android.location.Location
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightDetail
|
||||
@@ -14,7 +15,6 @@ import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightThreadHand
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_CROSS_ROAD
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT
|
||||
import com.mogo.eagle.core.function.v2x.trafficlight.network.TrafficLightNetWorkModel
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.utils.logger.Logger
|
||||
@@ -43,58 +43,60 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 {
|
||||
MogoApisHandler.getInstance().apis
|
||||
.registerCenterApi.registerCarLocationChangedListener(TAG, this)
|
||||
mThreadHandler =
|
||||
TrafficLightThreadHandler(WorkThreadHandler.newInstance("TrafficLight").looper,
|
||||
{
|
||||
Logger.d(TAG, "loop search roadID , mLocation : $mLocation")
|
||||
TrafficLightThreadHandler(Looper.getMainLooper(), {
|
||||
Logger.d(TAG, "loop search roadID , mLocation : $mLocation")
|
||||
|
||||
//查询路口时,如果红绿灯显示,则隐藏掉
|
||||
if(TrafficLightHMIManager.INSTANCE.isWarningTrafficLightShow()){
|
||||
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
|
||||
CallTrafficLightListenerManager.resetTrafficLightData()
|
||||
}
|
||||
//查询路口时,如果红绿灯显示,则隐藏掉
|
||||
if (TrafficLightHMIManager.INSTANCE.isWarningTrafficLightShow()) {
|
||||
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
|
||||
CallTrafficLightListenerManager.resetTrafficLightData()
|
||||
}
|
||||
|
||||
mLocation?.let { it ->
|
||||
val tileId = MogoApisHandler.getInstance().apis
|
||||
.mapServiceApi.mapUIController.getTileId(it.longitude, it.latitude)
|
||||
trafficLightNetWorkModel.requestRoadID(
|
||||
tileId, it.latitude, it.longitude, it.bearing.toDouble(), {
|
||||
mThreadHandler?.sendEmptyMessage(MSG_WHAT_STOP_SEARCH_CROSS_ROAD)
|
||||
roadId = it
|
||||
},
|
||||
{
|
||||
Logger.d(TAG, "request road id error : $it")
|
||||
})
|
||||
}
|
||||
}, {
|
||||
//stop loop search road id
|
||||
trafficLightNetWorkModel.cancelRequestRoadID()
|
||||
//开始请求红绿灯
|
||||
mThreadHandler?.sendEmptyMessage(MSG_WHAT_LOOP_SEARCH_TRAFFIC_LIGHT)
|
||||
}, {
|
||||
//start loop traffic light
|
||||
mLocation?.let {
|
||||
val road = if (roadId.isNullOrBlank()) "" else roadId!!
|
||||
trafficLightNetWorkModel.requestTrafficLight(
|
||||
it.latitude, it.longitude, it.bearing.toDouble(), road, { result ->
|
||||
trafficLightResult = result
|
||||
TrafficLightHMIManager.INSTANCE.updateTrafficLight(result)
|
||||
CallTrafficLightListenerManager.invokeTrafficLightStatus(result)
|
||||
},
|
||||
{ errorMsg ->
|
||||
//如果没有获取到正确的红绿灯数据,则取消读灯,继续读路口,防止出现一直读灯的情况
|
||||
Logger.d(TAG, "request Traffic Light error : $errorMsg")
|
||||
//stop loop traffic light
|
||||
trafficLightNetWorkModel.cancelRequestTrafficLight()
|
||||
//未查到红绿灯,加入2秒延时请求路口ID
|
||||
mThreadHandler?.sendEmptyMessageDelayed(MSG_WHAT_LOOP_SEARCH_CROSS_ROAD, 2_000L)
|
||||
})
|
||||
}
|
||||
}, {
|
||||
//stop loop traffic light
|
||||
trafficLightNetWorkModel.cancelRequestTrafficLight()
|
||||
//刚经过红绿灯,加入3秒延时请求路口ID
|
||||
mThreadHandler?.sendEmptyMessageDelayed(MSG_WHAT_LOOP_SEARCH_CROSS_ROAD, 3_000L)
|
||||
})
|
||||
mLocation?.let { it ->
|
||||
val tileId = MogoApisHandler.getInstance().apis
|
||||
.mapServiceApi.mapUIController.getTileId(it.longitude, it.latitude)
|
||||
trafficLightNetWorkModel.requestRoadID(
|
||||
tileId, it.latitude, it.longitude, it.bearing.toDouble(), {
|
||||
mThreadHandler?.sendEmptyMessage(MSG_WHAT_STOP_SEARCH_CROSS_ROAD)
|
||||
roadId = it
|
||||
},
|
||||
{
|
||||
Logger.d(TAG, "request road id error : $it")
|
||||
})
|
||||
}
|
||||
}, {
|
||||
//stop loop search road id
|
||||
trafficLightNetWorkModel.cancelRequestRoadID()
|
||||
//开始请求红绿灯
|
||||
mThreadHandler?.sendEmptyMessage(MSG_WHAT_LOOP_SEARCH_TRAFFIC_LIGHT)
|
||||
}, {
|
||||
//start loop traffic light
|
||||
mLocation?.let {
|
||||
val road = if (roadId.isNullOrBlank()) "" else roadId!!
|
||||
trafficLightNetWorkModel.requestTrafficLight(
|
||||
it.latitude, it.longitude, it.bearing.toDouble(), road, { result ->
|
||||
trafficLightResult = result
|
||||
TrafficLightHMIManager.INSTANCE.updateTrafficLight(result)
|
||||
CallTrafficLightListenerManager.invokeTrafficLightStatus(result)
|
||||
},
|
||||
{ errorMsg ->
|
||||
//如果没有获取到正确的红绿灯数据,则取消读灯,继续读路口,防止出现一直读灯的情况
|
||||
Logger.d(TAG, "request Traffic Light error : $errorMsg")
|
||||
//stop loop traffic light
|
||||
trafficLightNetWorkModel.cancelRequestTrafficLight()
|
||||
//未查到红绿灯,加入2秒延时请求路口ID
|
||||
mThreadHandler?.sendEmptyMessageDelayed(
|
||||
MSG_WHAT_LOOP_SEARCH_CROSS_ROAD,
|
||||
2_000L
|
||||
)
|
||||
})
|
||||
}
|
||||
}, {
|
||||
//stop loop traffic light
|
||||
trafficLightNetWorkModel.cancelRequestTrafficLight()
|
||||
//刚经过红绿灯,加入3秒延时请求路口ID
|
||||
mThreadHandler?.sendEmptyMessageDelayed(MSG_WHAT_LOOP_SEARCH_CROSS_ROAD, 3_000L)
|
||||
})
|
||||
mThreadHandler?.sendEmptyMessageDelayed(MSG_WHAT_LOOP_SEARCH_CROSS_ROAD, 5_000L)
|
||||
}
|
||||
|
||||
@@ -130,7 +132,7 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 {
|
||||
trafficLightResult!!.lon, trafficLightResult!!.lat
|
||||
) < 10)
|
||||
) {
|
||||
Logger.d(TAG,"开过路口")
|
||||
Logger.d(TAG, "开过路口")
|
||||
trafficLightResult = null
|
||||
TrafficLightHMIManager.INSTANCE.hideTrafficLight()
|
||||
CallTrafficLightListenerManager.resetTrafficLightData()
|
||||
|
||||
@@ -30,27 +30,25 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="@dimen/layout_margin_bottom"
|
||||
android:gravity="bottom"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/start"
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:layout_width="@dimen/notice_play_height"
|
||||
android:layout_height="@dimen/notice_play_height"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginLeft="@dimen/notice_play_marginleft"
|
||||
android:layout_marginRight="@dimen/notice_play_marginright"
|
||||
android:layout_marginBottom="@dimen/notice_play_bottom"
|
||||
android:layout_marginLeft="@dimen/notice_play_marginleft"
|
||||
android:layout_marginRight="@dimen/notice_play_marginleft"
|
||||
android:src="@drawable/notice_video_pause" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/current"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginRight="@dimen/notice_current_time_margin"
|
||||
android:gravity="bottom"
|
||||
android:layout_marginBottom="@dimen/notice_time_bottom"
|
||||
android:gravity="center_vertical"
|
||||
android:text="02:23"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/time_textsize" />
|
||||
@@ -71,10 +69,8 @@
|
||||
android:id="@+id/total"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginLeft="@dimen/notice_current_time_margin"
|
||||
android:gravity="bottom"
|
||||
android:layout_marginBottom="@dimen/notice_time_bottom"
|
||||
android:gravity="center_vertical"
|
||||
android:text="08:66"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/time_textsize" />
|
||||
@@ -83,6 +79,7 @@
|
||||
android:id="@+id/fullscreen"
|
||||
android:layout_width="@dimen/notice_fullscreen_bt"
|
||||
android:layout_height="@dimen/notice_fullscreen_bt"
|
||||
android:visibility="gone"
|
||||
android:scaleType="centerInside" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -30,17 +30,16 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="@dimen/layout_margin_bottom"
|
||||
android:gravity="bottom"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/start"
|
||||
android:layout_width="@dimen/dp_52"
|
||||
android:layout_height="@dimen/dp_52"
|
||||
android:layout_width="@dimen/notice_play_height"
|
||||
android:layout_height="@dimen/notice_play_height"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginLeft="@dimen/notice_play_marginleft_small"
|
||||
android:layout_marginRight="@dimen/notice_play_marginright_small"
|
||||
|
||||
android:layout_marginBottom="@dimen/notice_play_bottom"
|
||||
android:src="@drawable/notice_video_pause" />
|
||||
|
||||
@@ -48,9 +47,8 @@
|
||||
android:id="@+id/current"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:gravity="bottom"
|
||||
android:layout_marginBottom="@dimen/notice_time_bottom"
|
||||
android:gravity="center_vertical"
|
||||
android:text="02:23"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/time_textsize" />
|
||||
@@ -71,9 +69,8 @@
|
||||
android:id="@+id/total"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginBottom="@dimen/notice_time_bottom"
|
||||
android:gravity="center_vertical"
|
||||
android:gravity="bottom"
|
||||
android:text="08:66"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/time_textsize" />
|
||||
|
||||
@@ -50,8 +50,8 @@
|
||||
<dimen name="module_switch_image_circle">38px</dimen>
|
||||
|
||||
<!--player-->
|
||||
<dimen name="notice_play_height">52px</dimen>
|
||||
<dimen name="notice_play_marginleft">56px</dimen>
|
||||
<dimen name="notice_play_height">50px</dimen>
|
||||
<dimen name="notice_play_marginleft">66px</dimen>
|
||||
<dimen name="notice_play_marginright">50px</dimen>
|
||||
<dimen name="notice_current_time_margin">30px</dimen>
|
||||
<dimen name="notice_seekbar_width">990px</dimen>
|
||||
@@ -64,7 +64,7 @@
|
||||
<dimen name="notice_play_marginright_small">26px</dimen>
|
||||
<dimen name="notice_seekbar_width_small">600px</dimen>
|
||||
<dimen name="notice_seekbar_bottom">30px</dimen>
|
||||
<dimen name="notice_time_bottom">18px</dimen>
|
||||
<dimen name="notice_play_bottom">28px</dimen>
|
||||
<dimen name="notice_time_bottom">20px</dimen>
|
||||
<dimen name="notice_play_bottom">30px</dimen>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user