采用 CoordinatorLayout + AppBarLayout 架构替代简单的 NestedScrollView, 支持滚动折叠效果,提升用户体验。使用 Material 3 组件(TextInputLayout、 TonalButton)和现代化的颜色系统,改进视觉层次和交互反馈。 主要改进: - 相册编辑器:重构为卡片式分组布局,使用 TextInputLayout 增强输入体验 - 相册管理:添加大标题和描述文本,改进新建按钮样式 - 设置页面:采用折叠工具栏布局,优化内容组织 - 相册卡片:使用 ConstraintLayout 优化布局性能,增强视觉设计 - 统一圆角、阴影、间距等设计规范 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
252 lines
10 KiB
XML
252 lines
10 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<com.google.android.material.card.MaterialCardView
|
|
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:id="@+id/cardAlbum"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="12dp"
|
|
android:layout_marginHorizontal="4dp"
|
|
app:cardElevation="2dp"
|
|
app:cardCornerRadius="16dp"
|
|
app:cardBackgroundColor="@color/white"
|
|
app:strokeWidth="0dp"
|
|
android:clickable="true"
|
|
android:focusable="true"
|
|
android:foreground="?android:attr/selectableItemBackground">
|
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:padding="16dp">
|
|
|
|
<!-- Icon Container -->
|
|
<FrameLayout
|
|
android:id="@+id/iconContainer"
|
|
android:layout_width="48dp"
|
|
android:layout_height="48dp"
|
|
android:background="@drawable/bg_icon_container_sky"
|
|
android:backgroundTint="@color/sky_blue_container"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent">
|
|
|
|
<ImageView
|
|
android:layout_width="24dp"
|
|
android:layout_height="24dp"
|
|
android:layout_gravity="center"
|
|
android:src="@drawable/ic_album"
|
|
app:tint="@color/sky_blue_primary" />
|
|
</FrameLayout>
|
|
|
|
<!-- Album Name -->
|
|
<TextView
|
|
android:id="@+id/tvAlbumName"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="16dp"
|
|
android:layout_marginEnd="8dp"
|
|
android:text="相册名称"
|
|
android:textSize="18sp"
|
|
android:textStyle="bold"
|
|
android:textColor="@color/text_primary"
|
|
android:maxLines="1"
|
|
android:ellipsize="end"
|
|
app:layout_constraintStart_toEndOf="@id/iconContainer"
|
|
app:layout_constraintTop_toTopOf="@id/iconContainer"
|
|
app:layout_constraintEnd_toStartOf="@id/tvCurrentBadge" />
|
|
|
|
<!-- Album Info (Subtitle) -->
|
|
<TextView
|
|
android:id="@+id/tvAlbumInfo"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="4dp"
|
|
android:text="3 个文件夹 · 120 张图片"
|
|
android:textSize="13sp"
|
|
android:textColor="@color/text_secondary"
|
|
app:layout_constraintStart_toStartOf="@id/tvAlbumName"
|
|
app:layout_constraintTop_toBottomOf="@id/tvAlbumName"
|
|
app:layout_constraintEnd_toStartOf="@id/tvCurrentBadge" />
|
|
|
|
<!-- Active Badge -->
|
|
<TextView
|
|
android:id="@+id/tvCurrentBadge"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:text="当前使用"
|
|
android:textSize="11sp"
|
|
android:textStyle="bold"
|
|
android:textColor="@color/sky_blue_primary"
|
|
android:paddingHorizontal="8dp"
|
|
android:paddingVertical="4dp"
|
|
android:background="@drawable/badge_background"
|
|
android:backgroundTint="@color/sky_blue_container"
|
|
android:visibility="visible"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
app:layout_constraintBottom_toBottomOf="@id/iconContainer" />
|
|
|
|
<!-- Divider (Optional, subtle) -->
|
|
<View
|
|
android:id="@+id/divider"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="1dp"
|
|
android:background="#F0F0F0"
|
|
android:layout_marginTop="16dp"
|
|
app:layout_constraintTop_toBottomOf="@id/iconContainer" />
|
|
|
|
<!-- Bottom Stats Row -->
|
|
<LinearLayout
|
|
android:id="@+id/statsRow"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:layout_marginTop="12dp"
|
|
android:gravity="center_vertical"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@id/divider"
|
|
app:layout_constraintEnd_toStartOf="@id/actionsLayout">
|
|
|
|
<!-- Play Mode -->
|
|
<LinearLayout
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical"
|
|
android:background="@drawable/bg_nav_item_ripple"
|
|
android:paddingHorizontal="8dp"
|
|
android:paddingVertical="4dp">
|
|
|
|
<ImageView
|
|
android:layout_width="14dp"
|
|
android:layout_height="14dp"
|
|
android:src="@drawable/ic_repeat"
|
|
app:tint="@color/text_hint" />
|
|
|
|
<TextView
|
|
android:id="@+id/tvPlayMode"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="4dp"
|
|
android:text="顺序"
|
|
android:textSize="12sp"
|
|
android:textColor="@color/text_hint" />
|
|
</LinearLayout>
|
|
|
|
<!-- Interval -->
|
|
<LinearLayout
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="8dp"
|
|
android:gravity="center_vertical"
|
|
android:background="@drawable/bg_nav_item_ripple"
|
|
android:paddingHorizontal="8dp"
|
|
android:paddingVertical="4dp">
|
|
|
|
<ImageView
|
|
android:layout_width="14dp"
|
|
android:layout_height="14dp"
|
|
android:src="@drawable/ic_schedule"
|
|
app:tint="@color/text_hint" />
|
|
|
|
<TextView
|
|
android:id="@+id/tvInterval"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="4dp"
|
|
android:text="30m"
|
|
android:textSize="12sp"
|
|
android:textColor="@color/text_hint" />
|
|
</LinearLayout>
|
|
|
|
<!-- Last Scan -->
|
|
<LinearLayout
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="8dp"
|
|
android:gravity="center_vertical"
|
|
android:background="@drawable/bg_nav_item_ripple"
|
|
android:paddingHorizontal="8dp"
|
|
android:paddingVertical="4dp">
|
|
|
|
<ImageView
|
|
android:layout_width="14dp"
|
|
android:layout_height="14dp"
|
|
android:src="@drawable/ic_refresh"
|
|
app:tint="@color/text_hint" />
|
|
|
|
<TextView
|
|
android:id="@+id/tvLastScanTime"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginStart="4dp"
|
|
android:text="刚刚"
|
|
android:textSize="12sp"
|
|
android:textColor="@color/text_hint" />
|
|
</LinearLayout>
|
|
|
|
</LinearLayout>
|
|
|
|
<!-- Actions -->
|
|
<LinearLayout
|
|
android:id="@+id/actionsLayout"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintBottom_toBottomOf="@id/statsRow"
|
|
app:layout_constraintTop_toTopOf="@id/statsRow">
|
|
|
|
<com.google.android.material.button.MaterialButton
|
|
android:id="@+id/btnEdit"
|
|
style="@style/Widget.Material3.Button.IconButton"
|
|
android:layout_width="32dp"
|
|
android:layout_height="32dp"
|
|
android:insetLeft="0dp"
|
|
android:insetTop="0dp"
|
|
android:insetRight="0dp"
|
|
android:insetBottom="0dp"
|
|
android:padding="0dp"
|
|
app:icon="@drawable/ic_edit"
|
|
app:iconSize="18dp"
|
|
app:iconTint="@color/text_secondary"
|
|
app:backgroundTint="@android:color/transparent"
|
|
app:rippleColor="#20000000" />
|
|
|
|
<com.google.android.material.button.MaterialButton
|
|
android:id="@+id/btnDelete"
|
|
style="@style/Widget.Material3.Button.IconButton"
|
|
android:layout_width="32dp"
|
|
android:layout_height="32dp"
|
|
android:layout_marginStart="4dp"
|
|
android:insetLeft="0dp"
|
|
android:insetTop="0dp"
|
|
android:insetRight="0dp"
|
|
android:insetBottom="0dp"
|
|
android:padding="0dp"
|
|
app:icon="@drawable/ic_delete"
|
|
app:iconSize="18dp"
|
|
app:iconTint="@color/status_error_text"
|
|
app:backgroundTint="@android:color/transparent"
|
|
app:rippleColor="#20FF0000" />
|
|
|
|
<com.google.android.material.button.MaterialButton
|
|
android:id="@+id/btnSwitch"
|
|
style="@style/Widget.Material3.Button.TonalButton"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="36dp"
|
|
android:layout_marginStart="8dp"
|
|
android:text="使用"
|
|
android:textSize="12sp"
|
|
android:textStyle="bold"
|
|
android:textColor="@color/sky_blue_primary"
|
|
app:backgroundTint="@color/sky_blue_container"
|
|
app:cornerRadius="18dp"
|
|
android:insetTop="0dp"
|
|
android:insetBottom="0dp" />
|
|
|
|
</LinearLayout>
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
|
|
</com.google.android.material.card.MaterialCardView> |