优化SettingActivity底部菜单按钮效果:选中状态显示白色字体和圆角下划线
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 底部导航菜单 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/bottomMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:background="@android:color/transparent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:elevation="8dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btnDeviceConfig"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_weight="1"
|
||||
android:text="设备配置"
|
||||
android:textSize="28sp"
|
||||
android:textStyle="bold"
|
||||
android:background="@android:color/transparent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btnFoodCollect"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_weight="1"
|
||||
android:text="采集食材"
|
||||
android:textSize="26sp"
|
||||
android:background="@android:color/transparent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Fragment 容器 -->
|
||||
<FrameLayout
|
||||
android:id="@+id/fragmentContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,188 @@
|
||||
<?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">
|
||||
|
||||
<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"-->
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btnTakePhoto"
|
||||
android:layout_width="212dp"
|
||||
android:layout_height="155dp"
|
||||
android:src="@drawable/ic_take_photo"
|
||||
app:layout_constraintBottom_toBottomOf="@id/flPreview"
|
||||
app:layout_constraintEnd_toEndOf="@id/btnCollectedFood"
|
||||
tools:ignore="ContentDescription"
|
||||
android:foreground="@drawable/ripple_effect"/>
|
||||
|
||||
<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_food_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:inputType="text"
|
||||
android:imeOptions="actionSearch"
|
||||
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_search_food"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
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:background="@drawable/bg_btn_save"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="40sp" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<androidx.camera.view.PreviewView
|
||||
android:id="@+id/previewView"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="180dp"
|
||||
android:layout_gravity="center"/>
|
||||
</merge>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="212dp"
|
||||
android:layout_height="159dp"
|
||||
android:layout_margin="16dp"
|
||||
android:background="@drawable/bg_gray2">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="center"
|
||||
tools:src="@drawable/ic_camera_default" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivDelete"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_gravity="end|top"
|
||||
android:padding="6dp"
|
||||
android:src="@drawable/ic_delete_red" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivFinish"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/ic_finish" />
|
||||
</FrameLayout>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/tvFoodName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
tools:background="@drawable/bg_text_main"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:layout_marginHorizontal="14dp"
|
||||
android:layout_marginVertical="14dp"
|
||||
android:paddingHorizontal="15dp"
|
||||
android:textAlignment="center"
|
||||
tools:textColor="@color/black"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="肉沫干拌面" />
|
||||
Reference in New Issue
Block a user