[清扫车]清扫车子任务view封装处理
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.mogo.och.sweeper.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mogo.och.sweeper.R;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
public class SubTaskView extends ConstraintLayout {
|
||||
private ImageView ivSubTask;
|
||||
private TextView tvSubTaskName;
|
||||
private TextView tvSubTaskDesc;
|
||||
private ImageView ivSubTaskRightDownArrow;
|
||||
public SubTaskView(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public SubTaskView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public SubTaskView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public SubTaskView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
private void initView(@NonNull Context context) {
|
||||
LayoutInflater.from(context).inflate(R.layout.sweeper_subtask_view, this);
|
||||
ivSubTask = findViewById(R.id.ivSubTask);
|
||||
tvSubTaskName = findViewById(R.id.tvSubTaskName);
|
||||
tvSubTaskDesc = findViewById(R.id.tvSubTaskDesc);
|
||||
ivSubTaskRightDownArrow = findViewById(R.id.ivRightDownArrow);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 351 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 338 B After Width: | Height: | Size: 338 B |
@@ -0,0 +1,51 @@
|
||||
<?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">
|
||||
<TextView
|
||||
android:id="@+id/tvSubTaskName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="惠新西街南口地铁"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_87"
|
||||
android:maxLines="2"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/ivSubTask"
|
||||
android:layout_width="@dimen/dp_40"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:src="@drawable/sweeper_icon_current_subtask"
|
||||
app:layout_constraintTop_toTopOf="@+id/tvSubTaskName"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tvSubTaskName"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tvSubTaskName"
|
||||
android:layout_marginEnd="@dimen/dp_17"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/tvSubTaskDesc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvSubTaskName"
|
||||
app:layout_constraintStart_toStartOf="@+id/tvSubTaskName"
|
||||
android:textColor="#A6CEFF"
|
||||
android:text="全程约384米,预计耗时19分钟"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/ivRightDownArrow"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_70"
|
||||
android:src="@drawable/icon_right_down_arrow"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivSubTask"
|
||||
android:layout_marginStart="@dimen/dp_46"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -47,7 +47,7 @@
|
||||
android:id="@+id/switch_line_start_greenDot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/sweeper_icon_arrived_station"
|
||||
android:src="@drawable/sweeper_icon_current_subtask"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/switch_line_start_station"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/switch_line_name"
|
||||
app:layout_constraintTop_toTopOf="@+id/switch_line_start_station" />
|
||||
|
||||
Reference in New Issue
Block a user