- 统一调整了 activity_setting.xml 中各个 LinearLayout 的属性顺序 - 为 fragment_seasoning_config.xml 和 fragment_vector_collection.xml 添加了工具忽略属性 - 重新排列了 list_item_scale22_row.xml 和 list_item_scale_row.xml 的命名空间和属性顺序 - 在 list_type_scale1.xml 中调整了组件的布局属性顺序 - 为设置页面添加了数据库查看和秤数据监控功能的可见性控制 - 修复了布局文件中的硬编码文本警告问题
211 lines
8.4 KiB
XML
211 lines
8.4 KiB
XML
<?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:orientation="vertical"
|
|
tools:ignore="HardcodedText,UnusedAttribute">
|
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginHorizontal="32dp"
|
|
android:background="@drawable/setting_border"
|
|
android:paddingBottom="16dp">
|
|
|
|
<TextView
|
|
android:id="@+id/tvChargeSetting"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="32dp"
|
|
android:layout_marginTop="30dp"
|
|
android:drawablePadding="17dp"
|
|
android:text="食材采集"
|
|
android:textColor="@color/black"
|
|
android:textSize="36sp"
|
|
android:textStyle="bold"
|
|
app:drawableStartCompat="@drawable/line_shape"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent" />
|
|
|
|
<TextView
|
|
android:id="@+id/btnCollectedFood"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginEnd="32dp"
|
|
android:gravity="center_vertical"
|
|
android:includeFontPadding="false"
|
|
android:text="已采集食材"
|
|
android:textColor="#ff5e7585"
|
|
android:textSize="30sp"
|
|
android:textStyle="bold"
|
|
app:drawableEndCompat="@drawable/ic_arrow_right"
|
|
app:layout_constraintBottom_toBottomOf="@id/tvChargeSetting"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintTop_toTopOf="@id/tvChargeSetting" />
|
|
|
|
<FrameLayout
|
|
android:id="@+id/flPreview"
|
|
android:layout_width="456dp"
|
|
android:layout_height="342dp"
|
|
android:layout_marginTop="30dp"
|
|
app:layout_constraintStart_toStartOf="@id/tvChargeSetting"
|
|
app:layout_constraintTop_toBottomOf="@id/tvChargeSetting">
|
|
|
|
<androidx.cardview.widget.CardView
|
|
android:id="@+id/flCameraPreview"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
app:cardCornerRadius="8dp"
|
|
app:cardElevation="0dp" />
|
|
|
|
<LinearLayout
|
|
android:id="@+id/llCameraFlag"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:layout_gravity="center"
|
|
android:gravity="center"
|
|
android:background="@color/white"
|
|
android:orientation="vertical"
|
|
android:visibility="visible">
|
|
|
|
<ImageView
|
|
android:layout_width="88dp"
|
|
android:layout_height="88dp"
|
|
android:layout_gravity="center"
|
|
android:scaleType="fitCenter"
|
|
android:src="@drawable/ic_camera256"
|
|
tools:ignore="ContentDescription" />
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="24dp"
|
|
android:text="图片采集"
|
|
android:textColor="#ffb4b4c8"
|
|
android:textSize="26sp" />
|
|
</LinearLayout>
|
|
</FrameLayout>
|
|
|
|
<ImageView
|
|
android:id="@+id/btnClearData"
|
|
android:layout_width="212dp"
|
|
android:layout_height="155dp"
|
|
android:src="@drawable/ic_retake_photo"
|
|
app:layout_constraintEnd_toEndOf="@id/btnCollectedFood"
|
|
app:layout_constraintTop_toTopOf="@id/flPreview"
|
|
tools:ignore="ContentDescription"
|
|
android:foreground="@drawable/ripple_effect"/>
|
|
<!-- android:background="?android:attr/selectableItemBackgroundBorderless"-->
|
|
|
|
<!-- 拍照按钮:绿色圆角背景 + 相机图标 + 文字 -->
|
|
<LinearLayout
|
|
android:id="@+id/btnTakePhoto"
|
|
android:layout_width="212dp"
|
|
android:layout_height="155dp"
|
|
android:background="@drawable/bg_take_photo"
|
|
android:foreground="@drawable/ripple_effect"
|
|
android:gravity="center"
|
|
android:orientation="vertical"
|
|
app:layout_constraintBottom_toBottomOf="@id/flPreview"
|
|
app:layout_constraintEnd_toEndOf="@id/btnCollectedFood">
|
|
|
|
<ImageView
|
|
android:layout_width="72dp"
|
|
android:layout_height="72dp"
|
|
android:src="@drawable/ic_camera_white"
|
|
tools:ignore="ContentDescription" />
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="6dp"
|
|
android:text="拍照"
|
|
android:textColor="@color/white"
|
|
android:textSize="30sp"
|
|
android:textStyle="bold" />
|
|
</LinearLayout>
|
|
|
|
<androidx.recyclerview.widget.RecyclerView
|
|
android:id="@+id/rvFoodList"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="382dp"
|
|
android:layout_marginHorizontal="16dp"
|
|
android:layout_marginTop="16dp"
|
|
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@id/flPreview"
|
|
app:spanCount="3"
|
|
tools:itemCount="12"
|
|
android:overScrollMode="never"
|
|
tools:listitem="@layout/list_item_vector_collection" />
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
|
|
<FrameLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="100dp"
|
|
android:layout_marginHorizontal="32dp"
|
|
android:layout_marginTop="32dp"
|
|
android:gravity="center_vertical"
|
|
android:orientation="horizontal">
|
|
|
|
<EditText
|
|
android:id="@+id/editFoodName"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:background="@drawable/setting_border_gray3"
|
|
android:gravity="center_vertical"
|
|
android:hint="输入食材名称"
|
|
android:imeOptions="actionSearch"
|
|
android:inputType="text"
|
|
android:maxLines="1"
|
|
android:paddingStart="47dp"
|
|
android:paddingEnd="80dp"
|
|
android:textColor="@color/black"
|
|
android:textColorHint="#FFC4CFDA"
|
|
android:textSize="36sp" />
|
|
|
|
<ImageView
|
|
android:id="@+id/btnFoodSearch"
|
|
android:layout_width="60dp"
|
|
android:layout_height="60dp"
|
|
android:layout_gravity="end|center_vertical"
|
|
android:layout_marginEnd="15dp"
|
|
android:padding="10dp"
|
|
android:src="@drawable/ic_search2" />
|
|
</FrameLayout>
|
|
|
|
<androidx.recyclerview.widget.RecyclerView
|
|
android:id="@+id/rvSearchFood"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="0dp"
|
|
android:layout_marginHorizontal="16dp"
|
|
android:layout_marginTop="18dp"
|
|
android:minHeight="348dp"
|
|
android:layout_weight="1"
|
|
app:spanCount="2"
|
|
tools:itemCount="10"
|
|
android:overScrollMode="never"
|
|
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
|
tools:listitem="@layout/list_item_food3"/>
|
|
|
|
<TextView
|
|
android:id="@+id/btnSave"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="100dp"
|
|
android:layout_marginHorizontal="32dp"
|
|
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:clipToOutline="true"/>
|
|
|
|
</LinearLayout> |