Merge branch 'leftstee' into dev_robotaxi-d-app-module_265_220329_2.6.5
This commit is contained in:
@@ -60,6 +60,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_v2x
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_hmi
|
||||
}else {
|
||||
implementation project(":core:mogo-core-utils")
|
||||
implementation project(":foudations:mogo-commons")
|
||||
@@ -67,6 +68,7 @@ dependencies {
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:function-impl:mogo-core-function-v2x')
|
||||
implementation project(':core:function-impl:mogo-core-function-hmi')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SteeringWheelView
|
||||
android:id="@+id/steering_wheel"
|
||||
android:layout_width="@dimen/dp_300"
|
||||
android:layout_height="@dimen/dp_300"
|
||||
android:layout_marginLeft="@dimen/dp_90"
|
||||
android:layout_marginTop="@dimen/dp_90"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -170,7 +170,7 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<TextView
|
||||
android:id="@+id/switch_line_btn"
|
||||
android:id="@+id/switch_line_btn"fragment_och_bus.xml
|
||||
android:layout_width="@dimen/module_mogo_och_autopilot_order_bg_width"
|
||||
android:layout_height="@dimen/bus_switch_line_btn"
|
||||
android:text="@string/bus_switch_line_btn"
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Context
|
||||
import android.content.res.TypedArray
|
||||
import android.graphics.*
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import androidx.core.content.ContextCompat
|
||||
@@ -16,23 +17,28 @@ import com.mogo.eagle.core.function.hmi.R
|
||||
* @since: 2022/1/14
|
||||
*/
|
||||
class CircularProgressView @JvmOverloads constructor(
|
||||
context: Context, attrs: AttributeSet?, defStyleAttr : Int)
|
||||
: View(context, attrs, defStyleAttr){
|
||||
context: Context, attrs: AttributeSet?, defStyleAttr: Int)
|
||||
: View(context, attrs, defStyleAttr) {
|
||||
|
||||
val typedArray: TypedArray = context.obtainStyledAttributes(attrs, R.styleable.CircularProgressView)
|
||||
val TAG: String = "CircularProgressView"
|
||||
|
||||
val typedArray : TypedArray = context.obtainStyledAttributes(attrs, R.styleable.CircularProgressView)
|
||||
// 绘制画笔
|
||||
private val mBackPaint : Paint = Paint()
|
||||
private val mProgPaint : Paint = Paint()
|
||||
private val mBackPaint: Paint = Paint()
|
||||
private val mProgPaint: Paint = Paint()
|
||||
|
||||
// 绘制区域
|
||||
private var mRectF : RectF? = null
|
||||
private var mRectF: RectF? = null
|
||||
|
||||
// 圆环渐变色
|
||||
private var mColorArray : IntArray?=null
|
||||
private var mColorArray: IntArray? = null
|
||||
|
||||
// 圆环进度(0-100) 初始化进度
|
||||
private var mProgress : Int = typedArray.getInteger(R.styleable.CircularProgressView_progress, 0)
|
||||
private var mProgress: Int = typedArray.getInteger(R.styleable.CircularProgressView_progress, 0)
|
||||
|
||||
constructor(context : Context) : this(context,null)
|
||||
constructor(context: Context) : this(context, null)
|
||||
|
||||
constructor(context : Context,attrs : AttributeSet?) :this(context, attrs, 0)
|
||||
constructor(context: Context, attrs: AttributeSet?) : this(context, attrs, 0)
|
||||
|
||||
init {
|
||||
// 初始化背景圆环画笔
|
||||
@@ -52,9 +58,9 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
// 初始化进度圆环渐变色
|
||||
val startColor = typedArray.getColor(R.styleable.CircularProgressView_progStartColor, -1)
|
||||
val firstColor = typedArray.getColor(R.styleable.CircularProgressView_progFirstColor, -1)
|
||||
if(startColor != -1 && firstColor != -1){
|
||||
mColorArray = intArrayOf(startColor,firstColor)
|
||||
}else{
|
||||
if (startColor != -1 && firstColor != -1) {
|
||||
mColorArray = intArrayOf(startColor, firstColor)
|
||||
} else {
|
||||
mColorArray = null
|
||||
}
|
||||
|
||||
@@ -67,16 +73,17 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
val viewWide = getMeasuredWidth() - getPaddingLeft() - getPaddingRight();
|
||||
val viewHigh = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
|
||||
val mRectLength =
|
||||
((if (viewWide > viewHigh) viewHigh else viewWide) - if (mBackPaint.strokeWidth > mProgPaint.strokeWidth) mBackPaint.strokeWidth else mProgPaint.strokeWidth).toInt()
|
||||
((if (viewWide > viewHigh) viewHigh else viewWide) - if (mBackPaint.strokeWidth > mProgPaint.strokeWidth) mBackPaint.strokeWidth else mProgPaint.strokeWidth).toInt()
|
||||
val mRectL = getPaddingLeft() + (viewWide - mRectLength) / 2
|
||||
val mRectT = getPaddingTop() + (viewHigh - mRectLength) / 2
|
||||
mRectF = RectF(mRectL.toFloat(), mRectT.toFloat(), (mRectL + mRectLength).toFloat(),
|
||||
(mRectT + mRectLength).toFloat())
|
||||
(mRectT + mRectLength).toFloat())
|
||||
Log.d(TAG, "渐变色:" + mColorArray?.size.toString())
|
||||
// 设置进度圆环渐变色
|
||||
mColorArray?.let {
|
||||
mProgPaint.shader = LinearGradient(
|
||||
0.0f, 0.0f, 0.0f,
|
||||
measuredWidth.toFloat(), it, null, Shader.TileMode.MIRROR)
|
||||
0.0f, 0.0f, 0.0f,
|
||||
measuredWidth.toFloat(), it, null, Shader.TileMode.MIRROR)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -84,9 +91,11 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
override fun onDraw(canvas: Canvas?) {
|
||||
super.onDraw(canvas)
|
||||
canvas?.let {
|
||||
mRectF?.let { it1 -> it.drawArc(it1, 0.0f, 360.0f, false, mBackPaint) }
|
||||
mRectF?.let { it1 -> it.drawArc(it1, 275.0f,
|
||||
(360 * mProgress / 100).toFloat(), false, mProgPaint) }
|
||||
mRectF?.let { it1 -> it.drawArc(it1, 0.0f, 360.0f, false, mBackPaint) }
|
||||
mRectF?.let { it1 ->
|
||||
it.drawArc(it1, 275.0f,
|
||||
(360 * mProgress / 100).toFloat(), false, mProgPaint)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -95,7 +104,7 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
* 获取当前进度
|
||||
* @return 当前进度(0-100)
|
||||
*/
|
||||
fun getProgress() : Int{
|
||||
fun getProgress(): Int {
|
||||
return mProgress
|
||||
}
|
||||
|
||||
@@ -103,7 +112,7 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
* 设置当前进度
|
||||
* @param progress 当前进度(0-100)
|
||||
*/
|
||||
fun setProgress(progress : Int){
|
||||
fun setProgress(progress: Int) {
|
||||
mProgress = progress
|
||||
invalidate()
|
||||
}
|
||||
@@ -113,12 +122,12 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
* @param progress 当前进度(0-100)
|
||||
* @param animTime 动画时间(毫秒)
|
||||
*/
|
||||
fun setProgress(progress : Int, animTime : Long){
|
||||
if (animTime<=0){
|
||||
fun setProgress(progress: Int, animTime: Long) {
|
||||
if (animTime <= 0) {
|
||||
setProgress(progress)
|
||||
} else{
|
||||
} else {
|
||||
val animator = ValueAnimator.ofInt(mProgress, progress)
|
||||
animator.addUpdateListener{
|
||||
animator.addUpdateListener {
|
||||
mProgress = it.animatedValue as Int
|
||||
invalidate()
|
||||
}
|
||||
@@ -132,7 +141,7 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
* 设置背景圆环宽度
|
||||
* @param width 背景圆环宽度
|
||||
*/
|
||||
fun setBackWidth(width : Int){
|
||||
fun setBackWidth(width: Int) {
|
||||
mBackPaint.strokeWidth = width.toFloat()
|
||||
invalidate()
|
||||
}
|
||||
@@ -141,8 +150,8 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
* 设置背景圆环颜色
|
||||
* @param color 背景圆环颜色
|
||||
*/
|
||||
fun setBackColor(color : Int){
|
||||
mBackPaint.color = ContextCompat.getColor(context,color)
|
||||
fun setBackColor(color: Int) {
|
||||
mBackPaint.color = ContextCompat.getColor(context, color)
|
||||
invalidate()
|
||||
}
|
||||
|
||||
@@ -150,39 +159,50 @@ class CircularProgressView @JvmOverloads constructor(
|
||||
* 设置进度圆环宽度
|
||||
* @param width 进度圆环宽度
|
||||
*/
|
||||
fun setProgWidth(width : Int){
|
||||
fun setProgWidth(width: Int) {
|
||||
mProgPaint.strokeWidth = width.toFloat()
|
||||
invalidate()
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置进度圆环颜色
|
||||
* 设置进度圆环渐变色起始色
|
||||
* @param color 景圆环颜色
|
||||
*/
|
||||
fun setProgColor(color : Int){
|
||||
mProgPaint.color = ContextCompat.getColor(context,color)
|
||||
fun setProgColor(color: Int) {
|
||||
mProgPaint.color = ContextCompat.getColor(context, color)
|
||||
mProgPaint.shader = null
|
||||
invalidate()
|
||||
}
|
||||
|
||||
fun setProgColor(startColor : Int,endColor: Int){
|
||||
mColorArray = intArrayOf(ContextCompat.getColor(context,startColor),ContextCompat.getColor(context,endColor))
|
||||
|
||||
/**
|
||||
* 渐变色结束色
|
||||
*/
|
||||
fun setProgFirstColor(color: Int) {
|
||||
mProgPaint.color = ContextCompat.getColor(context, color)
|
||||
mProgPaint.shader = null
|
||||
invalidate()
|
||||
}
|
||||
|
||||
|
||||
fun setProgColor(startColor: Int, endColor: Int) {
|
||||
mColorArray = intArrayOf(ContextCompat.getColor(context, startColor), ContextCompat.getColor(context, endColor))
|
||||
mColorArray?.let {
|
||||
mProgPaint.shader = LinearGradient(0f, 0f, 0f,
|
||||
getMeasuredWidth().toFloat(), it, null, Shader.TileMode.MIRROR)
|
||||
getMeasuredWidth().toFloat(), it, null, Shader.TileMode.MIRROR)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun setProgColor(colorArray : IntArray){
|
||||
fun setProgColor(colorArray: IntArray) {
|
||||
colorArray.let {
|
||||
if(it.size<2){
|
||||
if (it.size < 2) {
|
||||
return
|
||||
}
|
||||
mColorArray = it.copyOf()
|
||||
mColorArray?.let{
|
||||
mColorArray?.let {
|
||||
mProgPaint.shader = LinearGradient(0f, 0f, 0f,
|
||||
getMeasuredWidth().toFloat(), it, null, Shader.TileMode.MIRROR)
|
||||
getMeasuredWidth().toFloat(), it, null, Shader.TileMode.MIRROR)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.view.animation.RotateAnimation;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import chassis.Chassis;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
* @description 方向盘
|
||||
* 方向盘跟随CAN数据做旋转
|
||||
* 档位随CAN数据做切换和高亮显示
|
||||
* @since: 4/7/22
|
||||
*/
|
||||
public class SteeringWheelView extends ConstraintLayout {
|
||||
private static final String TAG = "SteeringWheelView";
|
||||
private ImageView autopilotIV;
|
||||
private TextView steeringTV;
|
||||
private TapPositionView tapPositionView;
|
||||
private CircularProgressView steeringCircularV;
|
||||
private RotateAnimation rotateAnimation;
|
||||
private float fromDegrees = 0;//方向盘旋转起始位置
|
||||
|
||||
public SteeringWheelView(@NonNull Context context) {
|
||||
super(context);
|
||||
Log.d(TAG, "1");
|
||||
}
|
||||
|
||||
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
Log.d(TAG, "2");
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel, this);
|
||||
initView();
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener);
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
autopilotIV = (ImageView) findViewById(R.id.autopilot_iv);
|
||||
steeringTV = findViewById(R.id.steering_tv);
|
||||
tapPositionView = findViewById(R.id.tap_position);
|
||||
steeringCircularV = findViewById(R.id.steering_circular);
|
||||
steeringCircularV.setBackWidth(8);
|
||||
steeringCircularV.setBackColor(R.color.hmi_light_blue_00);
|
||||
steeringCircularV.setProgColor(R.color.hmi_light_blue, R.color.hmi_dark_blue);
|
||||
steeringCircularV.setProgress(10, 1000);
|
||||
}
|
||||
|
||||
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
Log.d(TAG, "3");
|
||||
}
|
||||
|
||||
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
Log.d(TAG, "4");
|
||||
}
|
||||
|
||||
private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener() {
|
||||
@Override
|
||||
public void onAutopilotArriveAtStation(@org.jetbrains.annotations.Nullable MessagePad.ArrivalNotification arrivalNotification) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
||||
if (autopilotStatusInfo == null) return;
|
||||
int state = autopilotStatusInfo.getState();
|
||||
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "state = %s", state);
|
||||
if (autopilotIV != null) {
|
||||
Log.d(TAG, "autopilotIV != null");
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
|
||||
autopilotIV.setImageResource(R.drawable.bg_auto);
|
||||
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
autopilotIV.setImageResource(R.drawable.bg_auto_nor);
|
||||
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
|
||||
autopilotIV.setImageResource(R.drawable.bg_auto_nor);
|
||||
}
|
||||
} else {
|
||||
Log.d(TAG, "autopilotIV=null");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotSNRequest() {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
private final IMoGoAutopilotVehicleStateListener mIMoGoAutopilotVehicleStateListener = new IMoGoAutopilotVehicleStateListener() {
|
||||
/**
|
||||
* 车辆转向灯
|
||||
* @param lightSwitch
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotLightSwitchData(@org.jetbrains.annotations.Nullable Chassis.LightSwitch lightSwitch) {
|
||||
Log.d(TAG, "车辆转向灯:" + lightSwitch.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 刹车灯
|
||||
* @param brakeLight
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotBrakeLightData(boolean brakeLight) {
|
||||
Log.d(TAG, "刹车灯:" + String.valueOf(brakeLight));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotSteeringData(float steering) {
|
||||
if (steeringTV != null && String.valueOf(steering) != null) {
|
||||
steeringTV.setText(String.valueOf(steering) + "°");
|
||||
steeringCircularV.setProgress((int) steering, 1000);
|
||||
animationWithSteeringData(steering);
|
||||
} else {
|
||||
Log.d(TAG, "steering未呈现");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 档位
|
||||
* @param gear
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
|
||||
Log.d(TAG, "档位" + gear.toString());
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGear(gear);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 方向盘随CAN数据做方向和角度旋转
|
||||
* 参数1从哪一个旋转角度开始
|
||||
* 参数2:转到什么角度
|
||||
* 后4个参数用于设置围绕着旋转的圆的圆心在哪里
|
||||
* 参数3:肯定x轴坐标的类型,有ABSOLUT绝对坐标、RELATIVE_TO_SELF相对于自身坐标、RELATIVE_TO_PARENT相对于父控件的坐标
|
||||
* 参数4:x轴的值,0.5f代表是以自身这个控件的一半长度为x轴
|
||||
* 参数5:肯定y轴坐标的类型
|
||||
* 参数6:y轴的值,0.5f代表是以自身这个控件的一半长度为x轴
|
||||
*
|
||||
* @param steering
|
||||
*/
|
||||
private void animationWithSteeringData(float steering) {
|
||||
Log.d(TAG, "方向盘转动" + String.valueOf(steering));
|
||||
rotateAnimation = new RotateAnimation(fromDegrees, steering,
|
||||
RotateAnimation.RELATIVE_TO_SELF, 0.5f,
|
||||
RotateAnimation.RELATIVE_TO_SELF, 0.5f);
|
||||
rotateAnimation.setDuration(1000);//旋转时长
|
||||
rotateAnimation.setFillAfter(true);//旋转后保持原状
|
||||
autopilotIV.clearAnimation();
|
||||
autopilotIV.startAnimation(rotateAnimation);
|
||||
fromDegrees = steering;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import chassis.Chassis;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
* @description 方向盘下方的档位
|
||||
* @since: 4/7/22
|
||||
*/
|
||||
public class TapPositionView extends ConstraintLayout {
|
||||
private static final String TAG = "TapPositionView";
|
||||
private TextView tabP;
|
||||
private TextView tabR;
|
||||
private TextView tabN;
|
||||
private TextView tabD;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public void updateWithGear(@NotNull Chassis.GearPosition gear) {
|
||||
if (tabP != null && tabR != null && tabN != null && tabD != null) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@+id/background">
|
||||
<shape
|
||||
android:innerRadius="@dimen/dp_85"
|
||||
android:shape="ring"
|
||||
android:thickness="4px"
|
||||
android:useLevel="false">
|
||||
<solid android:color="#BBCFF6" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_36"/>
|
||||
<gradient android:angle="315" android:endColor="#E6E9EFFC" android:startColor="#E6E9EFFC" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape
|
||||
android:innerRadiusRatio="3"
|
||||
android:shape="ring"
|
||||
android:thicknessRatio="8"
|
||||
android:useLevel="false">
|
||||
<gradient
|
||||
android:centerColor="#FF7121"
|
||||
android:centerY="0.50"
|
||||
android:endColor="#FFFF00"
|
||||
android:startColor="#6BD3FF"
|
||||
android:type="sweep"
|
||||
android:useLevel="false" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_steering_wheel">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/blue_circle"
|
||||
android:layout_width="@dimen/dp_180"
|
||||
android:layout_height="@dimen/dp_180"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginLeft="@dimen/dp_60"
|
||||
android:layout_marginTop="@dimen/dp_38"
|
||||
android:layout_marginRight="@dimen/dp_60"
|
||||
android:indeterminateDrawable="@drawable/bg_steering_outer"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/steering_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:gravity="right"
|
||||
android:text="18°"
|
||||
android:textColor="#415479"
|
||||
android:textSize="@dimen/dp_26"
|
||||
app:layout_constraintRight_toLeftOf="@+id/blue_circle"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CircularProgressView
|
||||
android:id="@+id/steering_circular"
|
||||
android:layout_width="@dimen/dp_180"
|
||||
android:layout_height="@dimen/dp_180"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:progWidth="8px"
|
||||
app:progress="0" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/autopilot_iv"
|
||||
android:layout_width="@dimen/dp_144"
|
||||
android:layout_height="@dimen/dp_144"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_54"
|
||||
android:src="@drawable/bg_auto"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:src="@drawable/icon_in_steering"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/autopilot_iv"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/autopilot_iv"
|
||||
app:layout_constraintRight_toRightOf="@+id/autopilot_iv"
|
||||
app:layout_constraintTop_toTopOf="@+id/autopilot_iv" />
|
||||
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.TapPositionView
|
||||
android:id="@+id/tap_position"
|
||||
android:layout_width="@dimen/dp_240"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_30"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/blue_circle" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tap_p"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="P"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#738FC4"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tap_r"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tap_r"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="R"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#738FC4"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tap_p"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tap_n"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tap_n"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="N"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#738FC4"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tap_r"
|
||||
app:layout_constraintRight_toLeftOf="@+id/tap_d"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tap_d"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="D"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#738FC4"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/tap_n"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -53,4 +53,7 @@
|
||||
<color name="hmi_traffic_light_green_color_down">#FF006D43</color>
|
||||
<color name="hmi_traffic_light_yellow_color_up">#FFFFE198</color>
|
||||
<color name="hmi_traffic_light_yellow_color_down">#FFFF9B00</color>
|
||||
<color name="hmi_light_blue">#45D3FF</color>
|
||||
<color name="hmi_dark_blue">#1B5BFF</color>
|
||||
<color name="hmi_light_blue_00">#0045D3FF</color>
|
||||
</resources>
|
||||
@@ -11,5 +11,6 @@
|
||||
<dimen name="module_v2x_brake_image_width">120px</dimen>
|
||||
<dimen name="module_v2x_brake_image_margin_left">37px</dimen>
|
||||
<dimen name="module_v2x_brake_image_margin_right">27px</dimen>
|
||||
|
||||
<dimen name="dp_144">144px</dimen>
|
||||
<dimen name="dp_300">300px</dimen>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user