style(ui): 优化食材识别页面界面布局和交互体验
- 将内边距设置从统一padding改为水平和底部独立设置 - 增加卡片圆角大小从8dp到12dp提升视觉效果 - 为商品列表添加白色圆角背景提升美观性 - 调整滚动条垂直边距和顶部间距 - 将选中食材和重量显示区域包裹在圆角容器中 - 添加食材名称文本的最大行数和省略效果 - 统一按钮边距使用水平和垂直边距设置 - 动态调整RecyclerView父容器高度适配内容 - 注释掉食材搜索弹窗的默认商品名称传递 - 在食材搜索弹窗中预设测试数据便于调试
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
tools:background="@color/white">
|
||||
|
||||
<!-- 食材照片,权重占满剩余空间 -->
|
||||
@@ -15,7 +16,7 @@
|
||||
android:layout_weight="1"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardElevation="0dp"
|
||||
app:cardCornerRadius="8dp">
|
||||
app:cardCornerRadius="12dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFoodPhoto"
|
||||
@@ -44,6 +45,7 @@
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="2"
|
||||
tools:itemCount="4"
|
||||
android:background="@drawable/shape_white_12_corners"
|
||||
tools:listitem="@layout/list_item_search_goods_info"
|
||||
tools:visibility="visible" />
|
||||
|
||||
@@ -53,6 +55,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="end|top"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_marginVertical="5dp"
|
||||
android:background="@drawable/scrollbar_track_food_recognize"
|
||||
android:visibility="gone" />
|
||||
|
||||
@@ -61,19 +64,29 @@
|
||||
android:layout_width="6dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="end|top"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:background="@drawable/scrollbar_thumb_food_recognize"
|
||||
android:visibility="gone" />
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/shape_white_12_corners"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 选中的食材名称 -->
|
||||
<TextView
|
||||
android:id="@+id/tvSelectedFood"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:gravity="center"
|
||||
android:text="-"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textColor="@color/black333"
|
||||
android:textSize="32sp" />
|
||||
|
||||
@@ -82,7 +95,7 @@
|
||||
android:id="@+id/tvWeight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:background="@drawable/shape_white_12_corners"
|
||||
android:gravity="center"
|
||||
android:text="0.0 g"
|
||||
@@ -95,6 +108,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:background="@drawable/shape_green_bg"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center"
|
||||
@@ -108,8 +122,8 @@
|
||||
android:id="@+id/btnCancel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:layout_marginVertical="30dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:background="@drawable/shape_white_12_corners"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center"
|
||||
@@ -118,5 +132,6 @@
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/refreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="700dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:srlEnableOverScrollDrag="false">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user