Merge branch 'local_282_navi' into feat_overview_mode_282

This commit is contained in:
liujing
2022-06-28 17:38:15 +08:00
14 changed files with 88 additions and 172 deletions

View File

@@ -73,8 +73,8 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
private FrameLayout flStationPanelContainer;
private Group groupTestPanel;
private FrameLayout flSpeed;
private BusArcView mouduleArc;
private TrafficDataView dataView;
// private BusArcView mouduleArc;
private TrafficDataView mouduleArc;
private ImageView mUpgradeTipIv;
// private BusTrafficLightView mTrafficLightView;
@@ -120,7 +120,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
tvOperationStatus = findViewById(R.id.module_mogo_och_operation_status);
flSpeed = (FrameLayout) findViewById(R.id.fl_speed);
mouduleArc = (BusArcView) findViewById(R.id.bus_arc);
mouduleArc = (TrafficDataView) findViewById(R.id.bus_arc);
panelView = LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flStationPanelContainer);
slidePanelView.setOnSlidePanelMoveToEndListener(onSlideToEndListener);
@@ -480,11 +480,11 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
*/
public void updateSpeedView(float newSpeed) {
int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值
// dataView.showWithSpeedValue(speed);
mouduleArc.showWithSpeedValue(speed);
mouduleArc.setArcColor(Color.parseColor(speed > 60 ? "#DB3137" : "#3E77F6"));
mouduleArc.setValues(speed);
flSpeed.setBackgroundResource(speed > 60 ? R.drawable.bus_yi_biao_pan_bg_speeding : R.drawable.bus_yi_biao_pan_bg_nor);
// mouduleArc.setArcColor(Color.parseColor(speed > 60 ? "#DB3137" : "#3E77F6"));
// mouduleArc.setValues(speed);
// flSpeed.setBackgroundResource(speed > 60 ? R.drawable.bus_yi_biao_pan_bg_speeding : R.drawable.bus_yi_biao_pan_bg_nor);
}
@Override

View File

@@ -17,16 +17,16 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.mogo.och.bus.view.BusArcView
android:id="@+id/bus_arc"
android:layout_width="@dimen/bus_ext_arcView_width"
android:layout_height="@dimen/bus_ext_arcView_height"
android:layout_gravity="center" />
<!-- <com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView-->
<!-- <com.mogo.och.bus.view.BusArcView-->
<!-- android:id="@+id/bus_arc"-->
<!-- android:layout_width="@dimen/dp_616"-->
<!-- android:layout_height="@dimen/dp_320"-->
<!-- android:layout_width="@dimen/bus_ext_arcView_width"-->
<!-- android:layout_height="@dimen/bus_ext_arcView_height"-->
<!-- android:layout_gravity="center" />-->
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView
android:id="@+id/bus_arc"
android:layout_width="@dimen/dp_616"
android:layout_height="@dimen/dp_320"
android:layout_gravity="center" />
</FrameLayout>

View File

@@ -218,7 +218,7 @@ public class SteeringWheelView extends ConstraintLayout {
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
Log.d(TAG, "档位" + gear.toString());
Log.d(TAG, "乘客屏档位" + gear.toString());
if (tapPositionView != null) {
tapPositionView.updateWithGear(gear);
}

View File

@@ -32,160 +32,56 @@ public class TapPositionView extends ConstraintLayout {
private TextView tabN;
private TextView tabD;
private TypedArray typedArray;
public TapPositionView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
Log.d(TAG, "2");
LayoutInflater.from(context).inflate(R.layout.hmi_tap_position, this);
tabP = findViewById(R.id.tap_p);
tabR = findViewById(R.id.tap_r);
tabN = findViewById(R.id.tap_n);
tabD = findViewById(R.id.tap_d);
typedArray = context.obtainStyledAttributes(attrs, R.styleable.CircularProgressView);
typedArray = context.obtainStyledAttributes(attrs, R.styleable.TapPositionView);
}
public void updateWithGear(@NotNull Chassis.GearPosition gear) {
if (tabP != null && tabR != null && tabN != null && tabD != null) {
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
taxiGear(gear);
} else {
busGear(gear);
int defaultColor = typedArray.getColor(R.styleable.TapPositionView_defaultColor, -1);
int selectColor = typedArray.getColor(R.styleable.TapPositionView_selectColor, -1);
Log.d(TAG, "gear:" + gear);
switch (gear) {
case GEAR_NONE:
tabP.setTextColor(defaultColor);
tabR.setTextColor(defaultColor);
tabN.setTextColor(defaultColor);
tabD.setTextColor(defaultColor);
break;
case GEAR_P:
tabP.setTextColor(selectColor);
tabR.setTextColor(defaultColor);
tabN.setTextColor(defaultColor);
tabD.setTextColor(defaultColor);
break;
case GEAR_R:
tabR.setTextColor(selectColor);
tabP.setTextColor(defaultColor);
tabN.setTextColor(defaultColor);
tabD.setTextColor(defaultColor);
break;
case GEAR_N:
tabN.setTextColor(selectColor);
tabR.setTextColor(defaultColor);
tabP.setTextColor(defaultColor);
tabD.setTextColor(defaultColor);
break;
case GEAR_D:
tabD.setTextColor(selectColor);
tabN.setTextColor(defaultColor);
tabR.setTextColor(defaultColor);
tabP.setTextColor(defaultColor);
break;
default:
break;
}
}
}
private void busGear(@NotNull Chassis.GearPosition gear) {
switch (gear) {
case GEAR_NONE:
tabP.setTextColor(Color.parseColor("#6E8EC9"));
tabR.setTextColor(Color.parseColor("#6E8EC9"));
tabN.setTextColor(Color.parseColor("#6E8EC9"));
tabD.setTextColor(Color.parseColor("#6E8EC9"));
break;
case GEAR_P:
tabP.setTextColor(Color.parseColor("#0043FF"));
tabR.setTextColor(Color.parseColor("#6E8EC9"));
tabN.setTextColor(Color.parseColor("#6E8EC9"));
tabD.setTextColor(Color.parseColor("#6E8EC9"));
break;
case GEAR_R:
tabR.setTextColor(Color.parseColor("#0043FF"));
tabP.setTextColor(Color.parseColor("#6E8EC9"));
tabN.setTextColor(Color.parseColor("#6E8EC9"));
tabD.setTextColor(Color.parseColor("#6E8EC9"));
break;
case GEAR_N:
tabN.setTextColor(Color.parseColor("#0043FF"));
tabR.setTextColor(Color.parseColor("#6E8EC9"));
tabP.setTextColor(Color.parseColor("#6E8EC9"));
tabD.setTextColor(Color.parseColor("#6E8EC9"));
break;
case GEAR_D:
tabD.setTextColor(Color.parseColor("#0043FF"));
tabN.setTextColor(Color.parseColor("#6E8EC9"));
tabR.setTextColor(Color.parseColor("#6E8EC9"));
tabP.setTextColor(Color.parseColor("#6E8EC9"));
break;
default:
break;
}
}
private void taxiGear(@NotNull Chassis.GearPosition gear) {
switch (gear) {
case GEAR_NONE:
tabP.setTextColor(Color.parseColor("#FF6E8EC9"));
tabR.setTextColor(Color.parseColor("#FF6E8EC9"));
tabN.setTextColor(Color.parseColor("#FF6E8EC9"));
tabD.setTextColor(Color.parseColor("#FF6E8EC9"));
break;
case GEAR_P:
tabP.setTextColor(Color.parseColor("#FFFFFFFF"));
tabR.setTextColor(Color.parseColor("#FF6E8EC9"));
tabN.setTextColor(Color.parseColor("#FF6E8EC9"));
tabD.setTextColor(Color.parseColor("#FF6E8EC9"));
break;
case GEAR_R:
tabR.setTextColor(Color.parseColor("#FFFFFFFF"));
tabP.setTextColor(Color.parseColor("#FF6E8EC9"));
tabN.setTextColor(Color.parseColor("#FF6E8EC9"));
tabD.setTextColor(Color.parseColor("#FF6E8EC9"));
break;
case GEAR_N:
tabN.setTextColor(Color.parseColor("#FFFFFFFF"));
tabR.setTextColor(Color.parseColor("#FF6E8EC9"));
tabP.setTextColor(Color.parseColor("#FF6E8EC9"));
tabD.setTextColor(Color.parseColor("#FF6E8EC9"));
break;
case GEAR_D:
tabD.setTextColor(Color.parseColor("#FFFFFFFF"));
tabN.setTextColor(Color.parseColor("#FF6E8EC9"));
tabR.setTextColor(Color.parseColor("#FF6E8EC9"));
tabP.setTextColor(Color.parseColor("#FF6E8EC9"));
break;
default:
break;
}
}
/**
* 司机屏档位信息
*/
public void updateWithGearForDriverPanel(@NotNull Chassis.GearPosition gear) {
if (tabP != null && tabR != null && tabN != null && tabD != null) {
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
busDriverPanel(gear);
} else {
busDriverPanel(gear);
}
}
}
private void busDriverPanel(@NotNull Chassis.GearPosition gear) {
Log.d(TAG, "gear" + gear.toString());
tabP.setTextSize(36f);
tabR.setTextSize(36f);
tabN.setTextSize(36f);
tabD.setTextSize(36f);
int defaultColor = typedArray.getColor(R.styleable.TapPositionView_defaultColor, -1);
int selectColor = typedArray.getColor(R.styleable.TapPositionView_selectColor, -1);
switch (gear) {
case GEAR_NONE:
tabP.setTextColor(Color.parseColor("#FFF"));
tabR.setTextColor(Color.parseColor("#FFF"));
tabN.setTextColor(Color.parseColor("#FFF"));
tabD.setTextColor(Color.parseColor("#FFF"));
break;
case GEAR_P:
tabP.setTextColor(Color.parseColor("#343c63"));
tabR.setTextColor(Color.parseColor("#FFF"));
tabN.setTextColor(Color.parseColor("#FFF"));
tabD.setTextColor(Color.parseColor("#FFF"));
break;
case GEAR_R:
tabR.setTextColor(Color.parseColor("#343c63"));
tabP.setTextColor(Color.parseColor("#FFF"));
tabN.setTextColor(Color.parseColor("#FFF"));
tabD.setTextColor(Color.parseColor("#FFF"));
break;
case GEAR_N:
tabN.setTextColor(Color.parseColor("#343c63"));
tabR.setTextColor(Color.parseColor("#FFF"));
tabP.setTextColor(Color.parseColor("#FFF"));
tabD.setTextColor(Color.parseColor("#FFF"));
break;
case GEAR_D:
tabD.setTextColor(selectColor);
tabN.setTextColor(defaultColor);
tabR.setTextColor(defaultColor);
tabP.setTextColor(defaultColor);
break;
default:
break;
}
}
}

View File

@@ -5,6 +5,8 @@ import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -29,6 +31,9 @@ import chassis.Chassis;
public class TrafficDataView extends ConstraintLayout {
private static final String TAG = "TrafficDataView";
private TapPositionView tapPositionView;
private TextView speedTextView;
private TextView accTextView;
private ImageView speedImage;
//圆弧颜色
private int mArcColor;
@@ -52,15 +57,17 @@ public class TrafficDataView extends ConstraintLayout {
private void initView(@NonNull Context context) {
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
LayoutInflater.from(context).inflate(R.layout.hmi_traffic_data, this);
// LayoutInflater.from(context).inflate(R.layout.hmi_traffic_data, this);
} else {
}
LayoutInflater.from(context).inflate(R.layout.hmi_traffic_data, this);
tapPositionView = findViewById(R.id.traffic_position);
speedImage = findViewById(R.id.speedImage);
speedTextView = findViewById(R.id.speedTextView);
accTextView = findViewById(R.id.speedAccTextView);
}
private final IMoGoAutopilotVehicleStateListener mIMoGoAutopilotVehicleStateListener = new IMoGoAutopilotVehicleStateListener() {
/**
* 车辆转向灯
* @param lightSwitch
@@ -110,7 +117,7 @@ public class TrafficDataView extends ConstraintLayout {
public void run() {
Log.d(TAG, "司机屏档位" + gear.toString());
if (tapPositionView != null) {
tapPositionView.updateWithGearForDriverPanel(gear);
tapPositionView.updateWithGear(gear);
}
}
});
@@ -144,8 +151,9 @@ public class TrafficDataView extends ConstraintLayout {
/**
* 车速过快
*/
public void showWithSpeedValue(int newSpeed){
public void showWithSpeedValue(int newSpeed) {
speedTextView.setText(newSpeed);
speedImage.setBackgroundResource(newSpeed > 60 ? R.drawable.traffic_data_speed_warning : R.drawable.traffic_data_speed);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@@ -87,6 +87,8 @@
android:layout_width="@dimen/dp_390"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_42"
app:defaultColor = "@color/bus_p_default_txt_color"
app:selectColor="@color/bus_p_select_txt_color"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"

View File

@@ -88,6 +88,8 @@
android:layout_width="@dimen/dp_272"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30"
app:defaultColor="@color/taxi_p_default_txt_color"
app:selectColor="@color/dark_mode_select_txt_color"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/steering_circular_alpha" />

View File

@@ -12,7 +12,7 @@
android:gravity="center"
android:text="P"
android:textAlignment="center"
android:textColor="#6E8EC9"
android:textSize="@dimen/dp_46"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
@@ -27,7 +27,7 @@
android:gravity="center"
android:text="R"
android:textAlignment="center"
android:textColor="#6E8EC9"
android:textSize="@dimen/dp_46"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
@@ -42,7 +42,7 @@
android:gravity="center"
android:text="N"
android:textAlignment="center"
android:textColor="#6E8EC9"
android:textSize="@dimen/dp_46"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
@@ -57,7 +57,7 @@
android:gravity="center"
android:text="D"
android:textAlignment="center"
android:textColor="#0043FF"
android:textSize="@dimen/dp_46"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"

View File

@@ -46,8 +46,8 @@
<com.mogo.eagle.core.function.hmi.ui.widget.TapPositionView
android:id="@+id/traffic_position"
android:layout_width="@dimen/dp_220"
app:defaultColor="@color/text_color_343c63"
app:selectColor="#FFF"
app:defaultColor="@color/acc_default_txt_color"
app:selectColor="@color/dark_mode_select_txt_color"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_28"
android:layout_marginTop="@dimen/dp_80"

View File

@@ -6,5 +6,5 @@
<color name="notice_check_dialog_bg_color">#E63B4577</color>
<color name="notice_traffic_line">#555C7E</color>
<color name="notice_dialog_back">#3B4577</color>
<color name="text_color_343c63">#FF343C63</color>
<color name="acc_default_txt_color">#FF343C63</color>
</resources>

View File

@@ -60,5 +60,10 @@
<color name="hmi_light_blue_alpha_00">#D945D3FF</color>
<color name="hmi_light_blue_alpha_ff">#D93261B6</color>
<color name="hmi_clear_00">#00FFFFFF</color>
<color name="text_color_343c63">#FF343C63</color>
<color name="acc_default_txt_color">#FF343C63</color>
<color name="bus_p_select_txt_color">#0043FF</color>
<color name="bus_p_default_txt_color">#6E8EC9</color>
<color name="taxi_p_default_txt_color">#FF6E8EC9</color>
<color name="dark_mode_select_txt_color">#FFFFFFFF</color>
</resources>

View File

@@ -282,7 +282,7 @@ public class AMapCustomView
//导航全程光柱
options.setTrafficBarEnabled(false);
//指南针
options.setCompassEnabled(false);
// options.setCompassEnabled(false);
options.setTilt((int) tilt);
//自车车标
options.setCarBitmap(BitmapFactory.decodeResource(this.getResources(), R.drawable.module_small_map_view_my_location_logo));
@@ -295,7 +295,10 @@ public class AMapCustomView
//路线纹理自定义
RouteOverlayOptions routeOverlayOptions = new RouteOverlayOptions();
routeOverlayOptions.setTurnArrowIs3D(false);
routeOverlayOptions.setUnknownTraffic(BitmapFactory.decodeResource(getResources(),R.drawable.custtexture_no));//未知路段
routeOverlayOptions.setSmoothTraffic(BitmapFactory.decodeResource(getResources(), R.drawable.amap_custom_smooth_route));
routeOverlayOptions.setJamTraffic(BitmapFactory.decodeResource(getResources(), R.drawable.custtexture_bad));//拥堵路段
routeOverlayOptions.setVeryJamTraffic(BitmapFactory.decodeResource(getResources(), R.drawable.custtexture_grayred));//超级拥堵路段
routeOverlayOptions.setPassRoute(BitmapFactory.decodeResource(getResources(), R.drawable.custtexture_slow));//走过的路段
options.setRouteOverlayOptions(routeOverlayOptions);
mAMapNaviView.setViewOptions(options);

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B