|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
<LinearLayout 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:background="#F5F7FA"
|
|
|
android:orientation="vertical"
|
|
|
tools:context=".TestActivity">
|
|
|
|
|
|
<!-- 1. 顶部标题栏 -->
|
|
|
<TextView
|
|
|
android:id="@+id/textView2"
|
|
|
android:layout_width="match_parent"
|
|
|
android:layout_height="56dp"
|
|
|
android:background="#FFFFFF"
|
|
|
android:elevation="4dp"
|
|
|
android:gravity="center"
|
|
|
android:text="轮胎详细信息"
|
|
|
android:textColor="#333333"
|
|
|
android:textSize="20sp"
|
|
|
android:textStyle="bold" />
|
|
|
|
|
|
<!-- 2. 滚动内容区 (轮胎基本信息) -->
|
|
|
<!-- 注意:如果时间线内容很多,建议将时间线移出ScrollView,或者将整个页面放入NestedScrollView -->
|
|
|
<ScrollView
|
|
|
android:layout_width="match_parent"
|
|
|
android:layout_height="0dp"
|
|
|
android:layout_weight="1">
|
|
|
|
|
|
<LinearLayout
|
|
|
android:layout_width="match_parent"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:orientation="vertical"
|
|
|
android:padding="16dp">
|
|
|
|
|
|
<!-- 轮胎信息卡片 (保持原有结构,仅微调) -->
|
|
|
<androidx.cardview.widget.CardView
|
|
|
android:layout_width="match_parent"
|
|
|
android:layout_height="wrap_content"
|
|
|
app:cardCornerRadius="12dp"
|
|
|
app:cardElevation="6dp"
|
|
|
app:cardBackgroundColor="#FFFFFF">
|
|
|
|
|
|
<LinearLayout
|
|
|
android:layout_width="match_parent"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:orientation="vertical"
|
|
|
android:padding="20dp">
|
|
|
|
|
|
<!-- EPC 扫描结果显示 -->
|
|
|
<LinearLayout
|
|
|
android:layout_width="match_parent"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:orientation="vertical"
|
|
|
android:layout_marginBottom="24dp">
|
|
|
|
|
|
<TextView
|
|
|
android:layout_width="wrap_content"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:text="扫描EPC编码/输入胎号"
|
|
|
android:textColor="#666666"
|
|
|
android:textSize="12sp" />
|
|
|
|
|
|
<EditText
|
|
|
android:id="@+id/in_santext"
|
|
|
android:layout_width="match_parent"
|
|
|
android:layout_height="44dp"
|
|
|
android:layout_marginTop="4dp"
|
|
|
android:background="@drawable/rounded_input_bg"
|
|
|
android:gravity="center_vertical"
|
|
|
android:paddingStart="12dp"
|
|
|
android:text=""
|
|
|
android:textColor="#333333"
|
|
|
android:textSize="16sp"
|
|
|
android:textStyle="bold" />
|
|
|
</LinearLayout>
|
|
|
|
|
|
<!-- 信息栅格布局 (两列) -->
|
|
|
<GridLayout
|
|
|
android:layout_width="match_parent"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:columnCount="2"
|
|
|
android:alignmentMode="alignBounds"
|
|
|
android:useDefaultMargins="true">
|
|
|
|
|
|
<!-- 品牌 -->
|
|
|
<LinearLayout
|
|
|
android:layout_width="0dp"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:layout_columnWeight="1"
|
|
|
android:orientation="vertical"
|
|
|
android:layout_marginBottom="12dp">
|
|
|
<TextView android:text="品 牌" style="@style/label_style_compact"/>
|
|
|
<TextView android:id="@+id/pinpai" style="@style/value_style_compact"/>
|
|
|
</LinearLayout>
|
|
|
|
|
|
<!-- 型号 -->
|
|
|
<LinearLayout
|
|
|
android:layout_width="0dp"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:layout_columnWeight="1"
|
|
|
android:orientation="vertical"
|
|
|
android:layout_marginBottom="12dp">
|
|
|
<TextView android:text="型 号" style="@style/label_style_compact"/>
|
|
|
<TextView android:id="@+id/xinghao" style="@style/value_style_compact"/>
|
|
|
</LinearLayout>
|
|
|
|
|
|
<!-- 层级 -->
|
|
|
<LinearLayout
|
|
|
android:layout_width="0dp"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:layout_columnWeight="1"
|
|
|
android:orientation="vertical"
|
|
|
android:layout_marginBottom="12dp">
|
|
|
<TextView android:text="层 级" style="@style/label_style_compact"/>
|
|
|
<TextView android:id="@+id/cengji" style="@style/value_style_compact"/>
|
|
|
</LinearLayout>
|
|
|
|
|
|
<!-- 花纹 -->
|
|
|
<LinearLayout
|
|
|
android:layout_width="0dp"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:layout_columnWeight="1"
|
|
|
android:orientation="vertical"
|
|
|
android:layout_marginBottom="12dp">
|
|
|
<TextView android:text="花 纹" style="@style/label_style_compact"/>
|
|
|
<TextView android:id="@+id/huawen" style="@style/value_style_compact"/>
|
|
|
</LinearLayout>
|
|
|
|
|
|
<!-- 气压 -->
|
|
|
<LinearLayout
|
|
|
android:layout_width="0dp"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:layout_columnWeight="1"
|
|
|
android:orientation="vertical"
|
|
|
android:layout_marginBottom="12dp">
|
|
|
<TextView android:text="标准气压" style="@style/label_style_compact"/>
|
|
|
<TextView android:id="@+id/qiya" style="@style/value_style_compact"/>
|
|
|
</LinearLayout>
|
|
|
|
|
|
<!-- 初始花纹深度 -->
|
|
|
<LinearLayout
|
|
|
android:layout_width="0dp"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:layout_columnWeight="1"
|
|
|
android:orientation="vertical"
|
|
|
android:layout_marginBottom="12dp">
|
|
|
<TextView android:text="初始花纹深度" style="@style/label_style_compact"/>
|
|
|
<TextView android:id="@+id/huawendepth" style="@style/value_style_compact"/>
|
|
|
</LinearLayout>
|
|
|
|
|
|
<!-- 剩余花纹 -->
|
|
|
<LinearLayout
|
|
|
android:layout_width="0dp"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:layout_columnWeight="1"
|
|
|
android:orientation="vertical"
|
|
|
android:layout_marginBottom="12dp">
|
|
|
<TextView android:text="剩余花纹" style="@style/label_style_compact"/>
|
|
|
<TextView android:id="@+id/shengyuhuawen" style="@style/value_style_compact"/>
|
|
|
</LinearLayout>
|
|
|
|
|
|
<!-- 状态 -->
|
|
|
<LinearLayout
|
|
|
android:layout_width="0dp"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:layout_columnWeight="1"
|
|
|
android:orientation="vertical"
|
|
|
android:layout_marginBottom="12dp">
|
|
|
<TextView android:text="状 态" style="@style/label_style_compact"/>
|
|
|
<TextView android:id="@+id/zhuangtai" style="@style/value_style_compact"/>
|
|
|
</LinearLayout>
|
|
|
<!-- 状态 -->
|
|
|
<LinearLayout
|
|
|
android:layout_width="0dp"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:layout_columnWeight="1"
|
|
|
android:orientation="vertical"
|
|
|
android:layout_marginBottom="12dp">
|
|
|
<TextView android:text="行驶总里程" style="@style/label_style_compact"/>
|
|
|
<TextView android:id="@+id/sum_mileage" style="@style/value_style_compact"/>
|
|
|
</LinearLayout>
|
|
|
|
|
|
</GridLayout>
|
|
|
</LinearLayout>
|
|
|
</androidx.cardview.widget.CardView>
|
|
|
<!-- 占位符:如果时间线想放在ScrollView内部,就放在这里 -->
|
|
|
<!-- 但通常建议独立出来,如下面的结构所示 -->
|
|
|
<androidx.cardview.widget.CardView
|
|
|
android:layout_width="match_parent"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:layout_marginTop="16dp"
|
|
|
app:cardCornerRadius="12dp"
|
|
|
app:cardElevation="4dp"
|
|
|
app:cardBackgroundColor="#FFFFFF">
|
|
|
|
|
|
<LinearLayout
|
|
|
android:layout_width="match_parent"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:orientation="vertical"
|
|
|
android:padding="16dp">
|
|
|
|
|
|
<TextView
|
|
|
android:layout_width="wrap_content"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:text="生命周期时间线"
|
|
|
android:textSize="16sp"
|
|
|
android:textStyle="bold"
|
|
|
android:textColor="#333333"
|
|
|
android:layout_marginBottom="12dp"/>
|
|
|
|
|
|
<!-- 使用 LinearLayout 作为容器,在代码中动态添加 View -->
|
|
|
<LinearLayout
|
|
|
android:id="@+id/ll_timeline_container"
|
|
|
android:layout_width="match_parent"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:orientation="vertical" />
|
|
|
|
|
|
</LinearLayout>
|
|
|
</androidx.cardview.widget.CardView>
|
|
|
</LinearLayout>
|
|
|
|
|
|
</ScrollView>
|
|
|
|
|
|
<!-- 3. 新增:生命周期时间线区域 -->
|
|
|
<!-- 这是一个独立的卡片,位于ScrollView下方,底部按钮上方 -->
|
|
|
|
|
|
|
|
|
<!-- 4. 底部操作栏 -->
|
|
|
<LinearLayout
|
|
|
android:layout_width="match_parent"
|
|
|
android:layout_height="wrap_content"
|
|
|
android:background="#FFFFFF"
|
|
|
android:elevation="8dp"
|
|
|
android:orientation="horizontal"
|
|
|
android:padding="16dp">
|
|
|
|
|
|
<Button
|
|
|
android:id="@+id/button"
|
|
|
android:layout_width="0dp"
|
|
|
android:layout_height="48dp"
|
|
|
android:layout_weight="1"
|
|
|
android:layout_marginEnd="8dp"
|
|
|
android:backgroundTint="#333333"
|
|
|
android:text="返 回"
|
|
|
android:textColor="#FFFFFF"
|
|
|
android:textSize="16sp"
|
|
|
app:cornerRadius="6dp"/>
|
|
|
|
|
|
<Button
|
|
|
android:id="@+id/scanButton"
|
|
|
android:layout_width="0dp"
|
|
|
android:layout_height="48dp"
|
|
|
android:layout_weight="1"
|
|
|
android:layout_marginStart="8dp"
|
|
|
android:backgroundTint="#333333"
|
|
|
android:text="搜 索"
|
|
|
android:textColor="#FFFFFF"
|
|
|
android:textSize="16sp"
|
|
|
app:cornerRadius="6dp"/>
|
|
|
</LinearLayout>
|
|
|
|
|
|
</LinearLayout> |