[add] 方向盘UI
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
* @description 方向盘
|
||||
* @since: 4/7/22
|
||||
*/
|
||||
public class SteeringWheelView extends ConstraintLayout {
|
||||
public SteeringWheelView(@NonNull Context context) {
|
||||
super(context);
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_steering_wheel, this);
|
||||
}
|
||||
|
||||
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public SteeringWheelView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
* @description 档位
|
||||
* @since: 4/7/22
|
||||
*/
|
||||
public class TapPositionView extends ConstraintLayout {
|
||||
private TextView tabP;
|
||||
private TextView tabR;
|
||||
private TextView tabN;
|
||||
private TextView tabD;
|
||||
|
||||
public TapPositionView(Context context) {
|
||||
super(context);
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_tap_position, this);
|
||||
}
|
||||
|
||||
public TapPositionView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public TapPositionView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public TapPositionView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="20px"
|
||||
android:bottomRightRadius="50px"
|
||||
android:topLeftRadius="50px"
|
||||
android:topRightRadius="20px" />
|
||||
<gradient android:angle="315" android:endColor="#1B5BFF" android:startColor="#45D3FF" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -1,41 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/dp_300"
|
||||
android:layout_height="@dimen/dp_300"
|
||||
android:background="@drawable/bg_steering_wheel">
|
||||
|
||||
<RelativeLayout
|
||||
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"
|
||||
android:background="@drawable/bg_steering_wheel"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="@dimen/dp_180"
|
||||
android:layout_height="@dimen/dp_180"
|
||||
android:layout_centerInParent="true"
|
||||
android:indeterminateDrawable="@drawable/bg_steering_outer" />
|
||||
<ProgressBar
|
||||
android:id="@+id/blue_circle"
|
||||
android:layout_width="@dimen/dp_180"
|
||||
android:layout_height="@dimen/dp_180"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_34"
|
||||
android:indeterminateDrawable="@drawable/bg_steering_outer" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CircularProgressView
|
||||
android:layout_width="@dimen/dp_190"
|
||||
android:layout_height="@dimen/dp_190"
|
||||
android:layout_centerInParent="true"
|
||||
app:progColor="@color/taxi_steering_wheel_color_selector"
|
||||
app:progWidth="8px"
|
||||
app:progress="0" />
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CircularProgressView
|
||||
android:layout_width="@dimen/dp_190"
|
||||
android:layout_height="@dimen/dp_190"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
app:progColor="@color/taxi_steering_wheel_color_selector"
|
||||
app:progWidth="8px"
|
||||
app:progress="0" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_och_autopilot_iv"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/taxi_p_un_auto_nor" />
|
||||
</RelativeLayout>
|
||||
<ImageView
|
||||
android:id="@+id/module_och_autopilot_iv"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_64"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/taxi_p_un_auto_nor" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.TapPositionView
|
||||
android:id="@+id/tap_position"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="@dimen/dp_30"/>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user