parent
496f77dbbc
commit
22ac0b0968
@ -1,142 +1,254 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="16dp"
|
||||
android:background="#f5f5f5">
|
||||
android:orientation="vertical"
|
||||
android:background="#F5F7FA">
|
||||
|
||||
<!-- 顶部蓝色标题栏(优化渐变、标题居中、按钮间距) -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:background="@drawable/gradient_header"
|
||||
android:orientation="horizontal"
|
||||
android:padding="1dp"
|
||||
android:elevation="4dp">
|
||||
|
||||
<!-- 返回按钮(优化边距和点击区域) -->
|
||||
<ImageButton
|
||||
android:id="@+id/back_button"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/ic_back"
|
||||
android:scaleType="centerInside"
|
||||
android:padding="8dp"
|
||||
android:contentDescription="返回" />
|
||||
|
||||
<!-- 居中标题(新增,提升辨识度) -->
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="商品详情"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 右侧占位,保持标题居中 -->
|
||||
<View
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="16dp"
|
||||
android:background="#F5F7FA"
|
||||
android:overScrollMode="never"> <!-- 优化滚动边缘效果 -->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 商品图片(优化圆角、添加查看提示) -->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp">
|
||||
|
||||
<!-- 商品图片 -->
|
||||
<ImageView
|
||||
android:id="@+id/ivItemImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:background="@drawable/bg_image_border"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<!-- 商品基本信息 -->
|
||||
<LinearLayout
|
||||
</RelativeLayout>
|
||||
|
||||
<!-- 商品基本信息(优化圆角、添加副标题) -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@android:color/white"
|
||||
android:paddingVertical="12dp"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:elevation="2dp"
|
||||
android:radius="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@android:color/white"
|
||||
android:padding="16dp"
|
||||
android:layout_marginTop="8dp">
|
||||
android:text="商品标题"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="商品标题"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
<!-- 商品状态标签(新增,丰富信息) -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" "
|
||||
android:textSize="14sp"
|
||||
android:textColor="#666666"
|
||||
android:layout_marginTop="4dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPrice"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="¥0.00"
|
||||
android:textColor="#ff4444"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="8dp" />
|
||||
<TextView
|
||||
android:id="@+id/tvPrice"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="¥0.00"
|
||||
android:textColor="#2196F3"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 商品详情 -->
|
||||
<!-- 商品详情(优化标题样式、边距) -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@android:color/white"
|
||||
android:paddingVertical="12dp"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:elevation="2dp"
|
||||
android:radius="8dp">
|
||||
|
||||
<!-- 带竖线标题(优化视觉层级) -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@android:color/white"
|
||||
android:padding="16dp"
|
||||
android:layout_marginTop="8dp">
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="4dp"
|
||||
android:layout_height="18dp"
|
||||
android:background="#2196F3" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="商品详情"
|
||||
android:textColor="#2196F3"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="8dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDescription"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="商品描述"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:lineSpacingExtra="4dp" />
|
||||
<TextView
|
||||
android:id="@+id/tvDescription"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="商品描述"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:lineSpacingExtra="4dp"
|
||||
android:textColor="#333333" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 商品信息 -->
|
||||
<!-- 商品信息(优化文字主次、圆角) -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@android:color/white"
|
||||
android:paddingVertical="12dp"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:elevation="2dp"
|
||||
android:radius="8dp">
|
||||
|
||||
<!-- 带竖线标题 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@android:color/white"
|
||||
android:padding="16dp"
|
||||
android:layout_marginTop="8dp">
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="4dp"
|
||||
android:layout_height="18dp"
|
||||
android:background="#2196F3" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="商品信息"
|
||||
android:textColor="#2196F3"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCategory"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="分类:"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLocation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="位置:"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="4dp" />
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="8dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvContact"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="联系方式:"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="4dp" />
|
||||
<TextView
|
||||
android:id="@+id/tvCategory"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="分类:"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textColor="#999999" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPublishTime"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="发布时间:"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="4dp" />
|
||||
<TextView
|
||||
android:id="@+id/tvLocation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="位置:"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textColor="#999999" />
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/tvContact"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="联系方式:"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textColor="#999999" />
|
||||
|
||||
<!-- 联系卖家按钮 -->
|
||||
<Button
|
||||
android:id="@+id/btnContact"
|
||||
<TextView
|
||||
android:id="@+id/tvPublishTime"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:text="联系卖家"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/button_blue"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_marginTop="16dp" />
|
||||
android:layout_height="wrap_content"
|
||||
android:text="发布时间:"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textColor="#AAAAAA"
|
||||
android:textStyle="italic" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
<!-- 联系卖家按钮(优化圆角、点击反馈) -->
|
||||
<Button
|
||||
android:id="@+id/btnContact"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:text="联系卖家"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/button_blue"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_marginTop="16dp"
|
||||
android:elevation="4dp"
|
||||
android:radius="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
Loading…
Reference in new issue