Merge branch 'dev_robotaxi-d-app-module_2110_220915_2.11.0' into 'test_robotaxi-d-app-module_2110_220915_2.11.0.1'

Dev robotaxi d app module 2110 220915 2.11.0

See merge request zhjt/AndroidApp/MoGoEagleEye!283
This commit is contained in:
wangmingjun
2022-10-19 13:42:10 +00:00
7 changed files with 34 additions and 32 deletions

View File

@@ -35,8 +35,8 @@ class DevaToolsProvider : IDevaToolsProvider {
}
override fun initBiz() {
bizConfigCenter.init(mContext!!)
FuncConfigImpl.init()
// bizConfigCenter.init(mContext!!)
// FuncConfigImpl.init()
traceManager.init(mContext!!)
MogoLogCatchManager.init(mContext!!)
}

View File

@@ -49,9 +49,19 @@ internal class GpsImpl(ctx: Context): IFlow<GpsStatus>(ctx) {
false
}
private val onStateListener = object : IAppStateListener {
override fun onAppStateChanged(isForeground: Boolean) {
if (isForeground) {
send(isLocationEnabled(), isGrandFineLocation())
}
}
}
override fun onCreate() {
val isGranted = isGrandFineLocation()
AppStateManager.registerAppStateListener(onStateListener)
send(isLocationEnabled(), isGranted)
if (!isGranted) {
PermissionUtils.requestAccessFineLocation(object : SimpleCallback {
@@ -88,6 +98,7 @@ internal class GpsImpl(ctx: Context): IFlow<GpsStatus>(ctx) {
} catch (t: Throwable) {
t.printStackTrace()
}
AppStateManager.unRegisterAppStateListener(onStateListener)
}
}

View File

@@ -26,12 +26,17 @@ class VipIdentificationView @JvmOverloads constructor(
override fun onAttachedToWindow() {
super.onAttachedToWindow()
val lp = this.layoutParams as LayoutParams
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_bus).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_bus).toInt()
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_bus_passenger).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_passenger).toInt()
} else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_taxi_passenger).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_passenger).toInt()
} else {
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_taxi).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_taxi).toInt()
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left).toInt()
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top).toInt()
}
this.layoutParams = lp
invalidate()

View File

@@ -6,11 +6,12 @@
<dimen name="module_vip_width">104px</dimen>
<dimen name="module_vip_height">104px</dimen>
<dimen name="module_vip_margin_left_bus">540px</dimen>
<dimen name="module_vip_margin_top_bus">40px</dimen>
<dimen name="module_vip_margin_left_taxi">640px</dimen>
<dimen name="module_vip_margin_top_taxi">80px</dimen>
<dimen name="module_vip_margin_left">640px</dimen>
<dimen name="module_vip_margin_top">80px</dimen>
<dimen name="module_vip_margin_left_taxi_passenger">540px</dimen>
<dimen name="module_vip_margin_left_bus_passenger">640px</dimen>
<dimen name="module_vip_margin_top_passenger">40px</dimen>
<dimen name="module_ext_speed_width_sm_radius">30px</dimen>
<dimen name="module_ext_speed_width_big_radius">130px</dimen>

View File

@@ -14,11 +14,12 @@
<dimen name="module_vip_width">104px</dimen>
<dimen name="module_vip_height">104px</dimen>
<dimen name="module_vip_margin_left_bus">380px</dimen>
<dimen name="module_vip_margin_top_bus">40px</dimen>
<dimen name="module_vip_margin_left_taxi">380px</dimen>
<dimen name="module_vip_margin_top_taxi">40px</dimen>
<dimen name="module_vip_margin_left">380px</dimen>
<dimen name="module_vip_margin_top">40px</dimen>
<dimen name="module_vip_margin_left_taxi_passenger">380px</dimen>
<dimen name="module_vip_margin_left_bus_passenger">380px</dimen>
<dimen name="module_vip_margin_top_passenger">40px</dimen>
<dimen name="module_ext_speed_width_sm_radius">20px</dimen>
<dimen name="module_ext_speed_width_big_radius">110px</dimen>

View File

@@ -74,14 +74,12 @@ public class MogoRouteOverlayManager implements
if (from != 1 || location == null) {
return;
}
if (isArriveAtStation.get()) {
Logger.d(TAG, "--- onLocationChanged 1 -- [isDemo1: " + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData + ",isDemo2:" +FunctionBuildConfig.isDemoMode + ",isGps:" + isGps + ",mode:" + autopilotMode.get() + ",lon:" + location.getLongitude() + ",lat:" + location.getLatitude() + ",angle:" + location.getBearing() + "]");
if (isArriveAtStation.get() && autopilotMode.get() != 1) {
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
return;
}
boolean force = FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData;
if (!force && autopilotMode.get() != 1) {
Logger.d(TAG, "--- onLocationChanged 2 -- [isDemo1: " + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData + ",isDemo2:" +FunctionBuildConfig.isDemoMode + ",isGps:" + isGps + ",mode:" + autopilotMode.get() + ",lon:" + location.getLongitude() + ",lat:" + location.getLatitude() + ",angle:" + location.getBearing() + "]");
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
return;
}
@@ -89,7 +87,6 @@ public class MogoRouteOverlayManager implements
if (!queue.isEmpty()) {
List<MessagePad.TrajectoryPoint> items = queue.pollLast();
if (items != null && !items.isEmpty()) {
Logger.d(TAG, "--- onLocationChanged -- [isDemo1: " + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData + ",isDemo2:" +FunctionBuildConfig.isDemoMode + ",isGps:" + isGps + ",mode:" + autopilotMode.get() + ",lon:" + location.getLongitude() + ",lat:" + location.getLatitude() + ",angle:" + location.getBearing() + "]");
RouteOverlayDrawer.getInstance().drawTrajectoryList(items, location.getBearing());
}
}

View File

@@ -100,7 +100,6 @@ public class RouteOverlayDrawer {
pps.clear();
List<MessagePad.TrajectoryPoint> routes = this.routeList;
if (routes == null || (total = routes.size()) < 2) {
Log.d("Route", "--- 2 ---");
isExcept = true;
return;
}
@@ -135,9 +134,6 @@ public class RouteOverlayDrawer {
}
double lon = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon();
double lat = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat();
StringBuilder sb = new StringBuilder();
sb.append(lon).append(",").append(lat).append(",");
int removeCount = 0;
if (points.size() > 0) {
MogoLatLng top = null;
while (points.size() != 0) {
@@ -155,13 +151,11 @@ public class RouteOverlayDrawer {
RouteStrategy.INSTANCE.remove(first.acc);
pools.release(first);
points.poll();
removeCount++;
}
top = first;
}
if (points.size() == 0) {
isExcept = true;
Log.d("Route", "--- 3 ---");
return;
}
MogoLatLng self = pools.acquire();
@@ -203,19 +197,12 @@ public class RouteOverlayDrawer {
mMoGoPolyline.setVisible(true);
}
} else {
Log.d("Route", "--- 4 ---");
isExcept = true;
}
for (MogoLatLng p : points) {
sb.append(p.lon).append(",").append(p.lat);
}
Log.d("Route", "--- draw: removeCount:" + removeCount + ", data:" + sb);
} catch (Throwable t) {
Log.d("Route", "--- draw error ---: error:" + t.getMessage());
t.printStackTrace();
} finally {
if (isExcept) {
Log.d("Route", "--- 5 ---");
setVisible(false);
}
if (points.size() > 0) {