[6.2.6][车前引导线] taxi乘客屏专属引导线效果
This commit is contained in:
@@ -8,15 +8,23 @@ import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.util.Log;
|
||||
import androidx.core.util.Pools;
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.map.overlay.core.Level;
|
||||
import com.mogo.map.overlay.line.Polyline;
|
||||
import com.zhidaoauto.map.sdk.open.tools.MapTools;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import kotlin.Pair;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
public class RouteOverlayDrawer {
|
||||
@@ -32,6 +40,9 @@ public class RouteOverlayDrawer {
|
||||
private static final int COLOR_LIGHT = Color.parseColor("#BAEBF5");
|
||||
|
||||
|
||||
//用于taxi乘客屏渐变颜色集合
|
||||
private static List<Integer> colors = null;
|
||||
|
||||
private RouteOverlayDrawer() {
|
||||
// 渐变色
|
||||
mogoOverlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
||||
@@ -110,7 +121,25 @@ public class RouteOverlayDrawer {
|
||||
isExcept = true;
|
||||
return;
|
||||
}
|
||||
RouteStrategy.INSTANCE.start();
|
||||
boolean isColorfulStrategy = !AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) || !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode);
|
||||
if (isColorfulStrategy) {
|
||||
RouteStrategy.INSTANCE.start();
|
||||
} else {
|
||||
if (colors == null) {
|
||||
ArrayList<Pair<Integer, Integer>> temps = new ArrayList<>();
|
||||
temps.add(new Pair<>(0, 51));
|
||||
temps.add(new Pair<>(10, 102));
|
||||
temps.add(new Pair<>(30, 51));
|
||||
temps.add(new Pair<>(100, 0));
|
||||
List<Integer> alphas = MapTools.INSTANCE.getColorAlpha(temps);
|
||||
if (alphas != null && !alphas.isEmpty()) {
|
||||
colors = new ArrayList<>();
|
||||
for (int i : alphas) {
|
||||
colors.add(Color.argb(i, 48,203,251));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < total; i++) {
|
||||
MessagePad.TrajectoryPoint route = null;
|
||||
try {
|
||||
@@ -137,7 +166,9 @@ public class RouteOverlayDrawer {
|
||||
acquire.acc = route.getAcceleration();
|
||||
acquire.speed = route.getVelocity();
|
||||
pps.add(acquire);
|
||||
RouteStrategy.INSTANCE.check(route.getVelocity(), route.getAcceleration(), routeList.size());
|
||||
if (isColorfulStrategy) {
|
||||
RouteStrategy.INSTANCE.check(route.getVelocity(), route.getAcceleration(), routeList.size());
|
||||
}
|
||||
}
|
||||
double lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude();
|
||||
double lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude();
|
||||
@@ -155,7 +186,9 @@ public class RouteOverlayDrawer {
|
||||
lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude();
|
||||
long angle = isPointOnCarFront(lon, lat, bearing, first.lon, first.lat);
|
||||
if (angle >= 90) {
|
||||
RouteStrategy.INSTANCE.remove(first.acc);
|
||||
if (isColorfulStrategy) {
|
||||
RouteStrategy.INSTANCE.remove(first.acc);
|
||||
}
|
||||
pools.release(first);
|
||||
points.poll();
|
||||
}
|
||||
@@ -173,10 +206,7 @@ public class RouteOverlayDrawer {
|
||||
self.lon = lon;
|
||||
}
|
||||
points.addFirst(self);
|
||||
RouteStrategy.INSTANCE.end();
|
||||
Strategy strategy = RouteStrategy.INSTANCE.getStrategy();
|
||||
List<Integer> colors = strategy.getColors();
|
||||
boolean isLightOn = strategy instanceof ColorfulStrategy && ((ColorfulStrategy) strategy).isLightOn();
|
||||
|
||||
Polyline.Options.Builder builder;
|
||||
if (mPolylineOptions == null) {
|
||||
builder = new Polyline.Options.Builder("router_overlay", Level.GUIDE_ROUTE_LINE)
|
||||
@@ -186,15 +216,24 @@ public class RouteOverlayDrawer {
|
||||
} else {
|
||||
builder = mPolylineOptions.builder();
|
||||
}
|
||||
builder.points(points);
|
||||
builder.colors(colors);
|
||||
if (isLightOn) {
|
||||
builder.setLightOn(true);
|
||||
|
||||
if (isColorfulStrategy) {
|
||||
RouteStrategy.INSTANCE.end();
|
||||
Strategy strategy = RouteStrategy.INSTANCE.getStrategy();
|
||||
List<Integer> colors = strategy.getColors();
|
||||
boolean isLightOn = strategy instanceof ColorfulStrategy && ((ColorfulStrategy) strategy).isLightOn();
|
||||
builder.colors(colors);
|
||||
builder.setLightOn(isLightOn);
|
||||
builder.setLightColor(COLOR_LIGHT);
|
||||
builder.setLightSpeed(0.5f);
|
||||
} else {
|
||||
builder.setLightOn(false);
|
||||
} else {
|
||||
if (colors != null && !colors.isEmpty()) {
|
||||
builder.colors(colors);
|
||||
builder.setIsGradient(true);
|
||||
builder.setLightOn(false);
|
||||
}
|
||||
}
|
||||
builder.points(points);
|
||||
builder.setVisible(true);
|
||||
Polyline.Options options = builder.build();
|
||||
if (mPolylineOptions == null) {
|
||||
|
||||
Reference in New Issue
Block a user