Merge remote-tracking branch 'origin/asv2022.3.1' into asv2022.3.1
commit
c96d8f2234
@ -0,0 +1,79 @@
|
||||
package com.example.tyre.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.tyre.BR;
|
||||
import com.example.tyre.R;
|
||||
import com.example.tyre.databinding.ItemCarRecordBinding;
|
||||
import com.example.tyre.entity.CarMaintenanceLifecycleDTO;
|
||||
import com.example.tyre.maintenance.been.CheckInstanceFiles;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wanghao
|
||||
* @date 2024/3/11
|
||||
*/
|
||||
public class CarRecordAdapter extends RecyclerView.Adapter<CarRecordAdapter.MyViewHolder> {
|
||||
private List<CarMaintenanceLifecycleDTO> list;
|
||||
private static Context context;
|
||||
private LayoutInflater inflater;
|
||||
private ItemClickCall clickCall;
|
||||
|
||||
|
||||
|
||||
|
||||
public CarRecordAdapter(Context context, ItemClickCall clickCall) {
|
||||
this.context = context;
|
||||
this.clickCall = clickCall;
|
||||
inflater = LayoutInflater.from(context);
|
||||
}
|
||||
|
||||
public void setList(List<CarMaintenanceLifecycleDTO> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
ItemCarRecordBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_car_record, parent, false);
|
||||
return new MyViewHolder(binding);
|
||||
}
|
||||
|
||||
// @SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
|
||||
var item = list.get(position);
|
||||
var binding = holder.binding;
|
||||
binding.setVariable(BR.item, item);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
|
||||
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
private ItemCarRecordBinding binding;
|
||||
|
||||
public MyViewHolder(ItemCarRecordBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public interface ItemClickCall {
|
||||
void onClick(int position);
|
||||
}
|
||||
}
|
||||
@ -1,17 +1,193 @@
|
||||
package com.example.tyre.maintenance;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.example.tyre.R;
|
||||
import com.example.tyre.databinding.ActivityTireScrapBinding;
|
||||
import com.example.tyre.maintenance.base.BaseActivity;
|
||||
import com.example.tyre.maintenance.base.MyRecultCall;
|
||||
import com.example.tyre.maintenance.base.MyResult;
|
||||
import com.example.tyre.maintenance.been.BaseTyre;
|
||||
import com.example.tyre.maintenance.been.BizOrderTireDetail;
|
||||
import com.example.tyre.maintenance.been.Order;
|
||||
import com.example.tyre.util.MyUrl;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
import com.lzy.okgo.model.Response;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
public class TireScrapActivity extends BaseActivity {
|
||||
|
||||
private ActivityTireScrapBinding binding;
|
||||
private Order order;
|
||||
private String carNo;
|
||||
private Map<String, BaseTyre> tyreMap;
|
||||
private List<BaseTyre> baseTyreList;
|
||||
private List<String> positionList;
|
||||
private ArrayAdapter<String> positionAdapter;
|
||||
|
||||
// Photos
|
||||
private int currentPhotoIndex = -1;
|
||||
private List<File> fileList;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_tire_scrap);
|
||||
binding = DataBindingUtil.setContentView(this, R.layout.activity_tire_scrap);
|
||||
|
||||
tyreMap = new HashMap<>();
|
||||
positionList = new ArrayList<>();
|
||||
fileList = new ArrayList<>();
|
||||
|
||||
Intent intent = getIntent();
|
||||
carNo = intent.getStringExtra("carNo");
|
||||
String site = intent.getStringExtra("site");
|
||||
order = gson.fromJson(intent.getStringExtra("json"), Order.class);
|
||||
|
||||
binding.setCarNo(carNo);
|
||||
binding.setSite(site);
|
||||
|
||||
positionAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, positionList);
|
||||
positionAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
binding.spinnerScrapPosition.setAdapter(positionAdapter);
|
||||
|
||||
selectTire(carNo);
|
||||
}
|
||||
|
||||
// 查询轮胎信息
|
||||
private void selectTire(String carNo) {
|
||||
OkGo.<String>post(MyUrl.url + "/tyre/tyre/getCarBingTire").tag(this).params("carNo", carNo).execute(new StringCallback() {
|
||||
@Override
|
||||
public void onSuccess(Response<String> response) {
|
||||
baseTyreList = gson.fromJson(response.body(), new TypeToken<List<BaseTyre>>() {
|
||||
}.getType());
|
||||
if (baseTyreList == null || baseTyreList.isEmpty()) {
|
||||
Toast.makeText(context, "该车无绑定轮胎", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
positionList.clear();
|
||||
tyreMap.clear();
|
||||
for (BaseTyre tire : baseTyreList) {
|
||||
String wheelPostion = tire.getWheelPostion();
|
||||
if (wheelPostion != null && !wheelPostion.isEmpty()) {
|
||||
positionList.add(wheelPostion);
|
||||
tyreMap.put(wheelPostion, tire);
|
||||
}
|
||||
}
|
||||
positionAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void takePhoto1(View view) {
|
||||
currentPhotoIndex = 1;
|
||||
try {
|
||||
teke_photo();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void takePhoto2(View view) {
|
||||
currentPhotoIndex = 2;
|
||||
try {
|
||||
teke_photo();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void takePhoto3(View view) {
|
||||
currentPhotoIndex = 3;
|
||||
try {
|
||||
teke_photo();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tekePhotoResult(String fileUrl, File file) {
|
||||
super.tekePhotoResult(fileUrl, file);
|
||||
if (file != null) {
|
||||
fileList.add(file);
|
||||
if (currentPhotoIndex == 1) {
|
||||
binding.ivPhoto1.setImageResource(R.mipmap.ic_duihao);
|
||||
} else if (currentPhotoIndex == 2) {
|
||||
binding.ivPhoto2.setImageResource(R.mipmap.ic_duihao);
|
||||
} else if (currentPhotoIndex == 3) {
|
||||
binding.ivPhoto3.setImageResource(R.mipmap.ic_duihao);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void saveScrapOrder(View view) {
|
||||
if (positionList.isEmpty()) {
|
||||
Toast.makeText(context, "无可报废的轮胎", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (fileList.isEmpty()) {
|
||||
Toast.makeText(context, "请至少拍摄一张报废照片", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
String selectedPosition = (String) binding.spinnerScrapPosition.getSelectedItem();
|
||||
BaseTyre selectedTire = tyreMap.get(selectedPosition);
|
||||
if (selectedTire == null) {
|
||||
Toast.makeText(context, "选择的轮位无效", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
String remark = binding.dialogTireRemark1.getText().toString().trim();
|
||||
|
||||
BizOrderTireDetail scrapDetail = new BizOrderTireDetail();
|
||||
scrapDetail.setOrderId(order.getOrderId());
|
||||
scrapDetail.setTireId(selectedTire.getTyreId());
|
||||
scrapDetail.setTireCode(selectedTire.getTyreNo());
|
||||
scrapDetail.setPositionName(selectedTire.getWheelPostion());
|
||||
scrapDetail.setDataType("报废");
|
||||
scrapDetail.setTireStatus("报废");
|
||||
scrapDetail.setRemark(remark);
|
||||
|
||||
List<BizOrderTireDetail> tireDetails = new ArrayList<>();
|
||||
tireDetails.add(scrapDetail);
|
||||
|
||||
Map<String, Object> orderSubmitMap = new HashMap<>();
|
||||
orderSubmitMap.put("order", order);
|
||||
orderSubmitMap.put("tireDetails", tireDetails);
|
||||
|
||||
OkGo.<MyResult>post(url + "/tyre/order/PDASaveMaintenanceOrder")
|
||||
.tag(this)
|
||||
.isMultipart(true)
|
||||
.params("json", gson.toJson(orderSubmitMap))
|
||||
.addFileParams("files", fileList)
|
||||
.execute(new MyRecultCall(dialog, this) {
|
||||
@Override
|
||||
public void onSuccess(Response<MyResult> response) {
|
||||
super.onSuccess(response);
|
||||
MyResult body = response.body();
|
||||
if (body.getCode() == 0) {
|
||||
Toast.makeText(context, "报废工单提交成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
} else {
|
||||
Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1,214 +1,398 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
android:background="#F0F4F8"> <!-- 浅灰色背景提升质感 -->
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="tire1"
|
||||
type="com.example.tyre.maintenance.been.BaseTyre" />
|
||||
|
||||
<variable
|
||||
name="tire2"
|
||||
type="com.example.tyre.maintenance.been.BaseTyre" />
|
||||
|
||||
<variable
|
||||
name="tire3"
|
||||
type="com.example.tyre.maintenance.been.BaseTyre" />
|
||||
|
||||
<variable
|
||||
name="tire4"
|
||||
type="com.example.tyre.maintenance.been.BaseTyre" />
|
||||
|
||||
<variable
|
||||
name="tire5"
|
||||
type="com.example.tyre.maintenance.been.BaseTyre" />
|
||||
|
||||
<variable
|
||||
name="tire6"
|
||||
type="com.example.tyre.maintenance.been.BaseTyre" />
|
||||
|
||||
<variable
|
||||
name="adapter"
|
||||
type="com.example.tyre.adapter.CarRecordAdapter" />
|
||||
|
||||
</data>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="12dp">
|
||||
android:layout_height="match_parent"
|
||||
android:background="#F0F4F8"
|
||||
android:fillViewport="true"> <!-- 浅灰色背景提升质感 -->
|
||||
|
||||
<!-- 顶部:搜索卡片 -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/card_search"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="4dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="12dp">
|
||||
|
||||
<!-- 顶部:搜索卡片 -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/card_search"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="4dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:text="公交车轮胎管理"
|
||||
android:textColor="#202020"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 车牌号输入 -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/til_plate_number"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:hint="请输入车牌号"
|
||||
app:endIconDrawable="@mipmap/search_icon"
|
||||
app:endIconMode="custom">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/et_plate_number"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="number"
|
||||
android:maxLines="1" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_retrieve"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="立即检索"
|
||||
android:textSize="16sp"
|
||||
app:cornerRadius="8dp" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp">
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/card_bg"
|
||||
android:padding="12dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="公交车轮胎管理"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="车辆最新里程:"
|
||||
android:textColor="#202020"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="20dp"/>
|
||||
|
||||
<!-- 车牌号输入 -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/til_plate_number"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="请输入车牌号"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:endIconMode="custom"
|
||||
app:endIconDrawable="@mipmap/search_icon">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/et_plate_number"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="number"
|
||||
android:maxLines="1" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_retrieve"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="立即检索"
|
||||
android:textSize="16sp"
|
||||
app:cornerRadius="8dp" />
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/select_info_mileage"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="0"
|
||||
android:textColor="#202020"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- 底部:三轴轮位图展示区 -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/card_visual"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="2dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/card_search"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<!-- 底部:三轴轮位图展示区 -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/card_visual"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp">
|
||||
android:layout_marginTop="16dp"
|
||||
android:visibility="gone"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="2dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/card_search">
|
||||
|
||||
<!-- 辅助线:垂直中心线 (分隔左右轮胎) -->
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_vertical_center"
|
||||
android:layout_width="wrap_content"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp">
|
||||
|
||||
<!-- 辅助线:垂直中心线 (分隔左右轮胎) -->
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_vertical_center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
<!-- 辅助线:水平线 1 (第1轴位置) -->
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_axis_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_begin="96dp" />
|
||||
|
||||
<!-- 辅助线:水平线 2 (第2轴位置) -->
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_axis_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_end="235dp" />
|
||||
|
||||
<!-- 辅助线:水平线 3 (第3轴位置) -->
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_axis_3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_begin="399dp" />
|
||||
|
||||
<!-- 车头指示 -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="🚗 车头方向"
|
||||
android:textColor="#999999"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- ================= 第1轴 (前轴) ================= -->
|
||||
<!-- 左侧轮胎 (1轴) -->
|
||||
<include
|
||||
android:id="@+id/tire_left_front"
|
||||
layout="@layout/item_tire"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/guideline_axis_1"
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_vertical_center"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_axis_1" />
|
||||
|
||||
<!-- 右侧轮胎 (1轴) -->
|
||||
|
||||
<!-- ================= 第2轴 (中轴) ================= -->
|
||||
<!-- 左侧轮胎 (2轴) -->
|
||||
|
||||
<include
|
||||
android:id="@+id/tire_right_front"
|
||||
layout="@layout/item_tire"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/guideline_axis_1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_vertical_center"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_axis_1" />
|
||||
|
||||
<include
|
||||
android:id="@+id/tire_middle_left"
|
||||
layout="@layout/item_tire"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/guideline_axis_2"
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_vertical_center"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_axis_2" />
|
||||
|
||||
<!-- 右侧轮胎 (2轴) -->
|
||||
<include
|
||||
android:id="@+id/tire_middle_right"
|
||||
layout="@layout/item_tire"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/guideline_axis_2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_vertical_center"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_axis_2" />
|
||||
|
||||
<!-- ================= 第3轴 (后轴) ================= -->
|
||||
<!-- 左侧轮胎 (3轴) -->
|
||||
<include
|
||||
android:id="@+id/tire_bottom_left"
|
||||
layout="@layout/item_tire"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/guideline_axis_3"
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_vertical_center"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_axis_3" />
|
||||
|
||||
<!-- 右侧轮胎 (3轴) -->
|
||||
<include
|
||||
android:id="@+id/tire_bottom_right"
|
||||
layout="@layout/item_tire"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/guideline_axis_3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_vertical_center"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_axis_3" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
style="@style/layout_card_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
android:gravity="center">
|
||||
|
||||
<!-- 辅助线:水平线 1 (第1轴位置) -->
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_axis_1"
|
||||
android:layout_width="wrap_content"
|
||||
<include
|
||||
android:id="@+id/tireClick1"
|
||||
layout="@layout/layout_trae_info"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:data="@{tire1}"
|
||||
app:locationOld='@{"左前轮"}' />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#E3E6EC" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/bg_grey"
|
||||
android:gravity="center"
|
||||
android:text="1"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#E3E6EC" />
|
||||
|
||||
|
||||
<include
|
||||
android:id="@+id/tireClick2"
|
||||
layout="@layout/layout_trae_info"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:data="@{tire2}"
|
||||
app:locationOld='@{"右前轮"}' />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_begin="96dp" />
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center">
|
||||
|
||||
<!-- 辅助线:水平线 2 (第2轴位置) -->
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_axis_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_begin="241dp" />
|
||||
<include
|
||||
android:id="@+id/tireClick3"
|
||||
layout="@layout/layout_trae_info"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:data="@{tire3}"
|
||||
app:locationOld='@{"左外轮"}' />
|
||||
|
||||
<!-- 辅助线:水平线 3 (第3轴位置) -->
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_axis_3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_begin="399dp" />
|
||||
<include
|
||||
android:id="@+id/tireClick4"
|
||||
layout="@layout/layout_trae_info"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
app:data="@{tire4}"
|
||||
app:locationOld='@{"左内轮"}' />
|
||||
|
||||
<!-- 车头指示 -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="🚗 车头方向"
|
||||
android:textColor="#999999"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#E3E6EC" />
|
||||
|
||||
<!-- ================= 第1轴 (前轴) ================= -->
|
||||
<!-- 左侧轮胎 (1轴) -->
|
||||
<include
|
||||
android:id="@+id/tire_left_front"
|
||||
layout="@layout/item_tire"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/guideline_axis_1"
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_vertical_center"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_axis_1" />
|
||||
<TextView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/bg_grey"
|
||||
android:gravity="center"
|
||||
android:text="2"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 右侧轮胎 (1轴) -->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#E3E6EC" />
|
||||
|
||||
<!-- ================= 第2轴 (中轴) ================= -->
|
||||
<!-- 左侧轮胎 (2轴) -->
|
||||
|
||||
<include
|
||||
android:id="@+id/tire_right_front"
|
||||
layout="@layout/item_tire"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/guideline_axis_1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_vertical_center"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_axis_1" />
|
||||
<include
|
||||
android:id="@+id/tireClick5"
|
||||
layout="@layout/layout_trae_info"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:data="@{tire5}"
|
||||
app:locationOld='@{"右内轮"}' />
|
||||
|
||||
<include
|
||||
android:id="@+id/tire_middle_left"
|
||||
layout="@layout/item_tire"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_axis_2"
|
||||
app:layout_constraintBottom_toBottomOf="@id/guideline_axis_2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_vertical_center"
|
||||
app:layout_constraintHorizontal_bias="0.5" />
|
||||
<include
|
||||
android:id="@+id/tireClick6"
|
||||
layout="@layout/layout_trae_info"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
app:data="@{tire6}"
|
||||
app:locationOld='@{"右外轮"}' />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 右侧轮胎 (2轴) -->
|
||||
<include
|
||||
android:id="@+id/tire_middle_right"
|
||||
layout="@layout/item_tire"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_axis_2"
|
||||
app:layout_constraintBottom_toBottomOf="@id/guideline_axis_2"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_vertical_center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- ================= 第3轴 (后轴) ================= -->
|
||||
<!-- 左侧轮胎 (3轴) -->
|
||||
<include
|
||||
android:id="@+id/tire_bottom_left"
|
||||
layout="@layout/item_tire"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_axis_3"
|
||||
app:layout_constraintBottom_toBottomOf="@id/guideline_axis_3"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_vertical_center"
|
||||
app:layout_constraintHorizontal_bias="0.5" />
|
||||
|
||||
<!-- 右侧轮胎 (3轴) -->
|
||||
<include
|
||||
android:id="@+id/tire_bottom_right"
|
||||
layout="@layout/item_tire"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="120dp"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_axis_3"
|
||||
app:layout_constraintBottom_toBottomOf="@id/guideline_axis_3"
|
||||
app:layout_constraintStart_toEndOf="@id/guideline_vertical_center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="400dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:adapter="@{adapter}"
|
||||
android:background="@drawable/card_bg"
|
||||
android:padding="8dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</layout>
|
||||
Loading…
Reference in New Issue