refactor(collect): 重构食材采集功能界面和适配器
- 将按钮组件替换为TextView以支持更好的交互效果 - 添加selectableItemBackground实现点击反馈效果 - 重命名食材采样为食材采集保持术语一致性 - 替换FoodCollectionAdapter为VectorCollectionAdapter适配器 - 更新列表项布局从list_item_food_collection到list_item_vector_collection - 添加FoodSearchAdapter适配器用于食材搜索功能 - 重构CollectFragment中的数据绑定和UI逻辑 - 修改相机容器布局位置优化界面结构 - 更新资源文件名和颜色定义提升代码可读性 - 调整保存按钮样式增强视觉效果 - 修改提示对话框内容精确表达功能意图
This commit is contained in:
@@ -271,7 +271,7 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<TextView
|
||||
android:id="@+id/btnCook"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp"
|
||||
@@ -282,6 +282,7 @@
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/shape_green_bg"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:clickable="true" />
|
||||
|
||||
<!-- android:background="@drawable/ripple_effect_green"-->
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
android:layout_marginTop="30dp"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/shape_green_bg"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:text="更换食材"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="32sp"
|
||||
@@ -79,6 +80,7 @@
|
||||
android:layout_marginBottom="30dp"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/shape_white_12_corners"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:text="取消"
|
||||
android:textColor="@color/black333"
|
||||
android:textSize="32sp"
|
||||
|
||||
@@ -75,6 +75,11 @@
|
||||
android:textColor="@color/black666"
|
||||
android:textSize="28sp" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/flCameraContainer"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
@@ -89,17 +94,13 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/flCameraContainer"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<TextView
|
||||
android:id="@+id/btnCook"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp"
|
||||
android:layout_margin="30dp"
|
||||
android:background="@drawable/shape_green_bg"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center"
|
||||
android:text="@string/goCooking"
|
||||
android:textColor="@color/white"
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="食材采样"
|
||||
android:text="食材采集"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="32dp"
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<TextView
|
||||
android:id="@+id/btnCook"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="90dp"
|
||||
@@ -121,6 +121,7 @@
|
||||
android:layout_marginBottom="30dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_green_stroke"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center"
|
||||
android:text="制作"
|
||||
android:textColor="@color/dish_green"
|
||||
@@ -128,7 +129,7 @@
|
||||
android:textStyle="bold" />
|
||||
<!-- android:background="@drawable/ripple_effect_light"-->
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<TextView
|
||||
android:id="@+id/btnSubmit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="90dp"
|
||||
@@ -138,6 +139,7 @@
|
||||
android:layout_marginBottom="30dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_green_bg"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:gravity="center"
|
||||
android:text="提交"
|
||||
android:textColor="@color/white"
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
app:spanCount="3"
|
||||
tools:itemCount="12"
|
||||
android:overScrollMode="never"
|
||||
tools:listitem="@layout/list_item_food_collection" />
|
||||
tools:listitem="@layout/list_item_vector_collection" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -157,9 +157,9 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/setting_border_gray3"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="输入菜品名称"
|
||||
android:inputType="text"
|
||||
android:hint="输入食材名称"
|
||||
android:imeOptions="actionSearch"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="47dp"
|
||||
android:paddingEnd="80dp"
|
||||
@@ -191,7 +191,7 @@
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
tools:listitem="@layout/list_item_search_food"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
<TextView
|
||||
android:id="@+id/btnSave"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
@@ -199,8 +199,12 @@
|
||||
android:layout_marginBottom="32dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="保存"
|
||||
android:gravity="center"
|
||||
android:textStyle="bold"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:background="@drawable/bg_btn_save"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="40sp" />
|
||||
android:textSize="40sp"
|
||||
android:clipToOutline="true"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -4,7 +4,7 @@
|
||||
android:id="@+id/tvFoodName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
tools:background="@drawable/bg_text_main"
|
||||
android:background="@drawable/bg_item_search"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
@@ -12,7 +12,7 @@
|
||||
android:layout_marginVertical="14dp"
|
||||
android:paddingHorizontal="15dp"
|
||||
android:textAlignment="center"
|
||||
tools:textColor="@color/black"
|
||||
android:textColor="@color/color_item_search"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="肉沫干拌面" />
|
||||
tools:text="土豆丝" />
|
||||
Reference in New Issue
Block a user