style: 升级 UI 为 Material 3 设计语言并优化布局架构
采用 CoordinatorLayout + AppBarLayout 架构替代简单的 NestedScrollView, 支持滚动折叠效果,提升用户体验。使用 Material 3 组件(TextInputLayout、 TonalButton)和现代化的颜色系统,改进视觉层次和交互反馈。 主要改进: - 相册编辑器:重构为卡片式分组布局,使用 TextInputLayout 增强输入体验 - 相册管理:添加大标题和描述文本,改进新建按钮样式 - 设置页面:采用折叠工具栏布局,优化内容组织 - 相册卡片:使用 ConstraintLayout 优化布局性能,增强视觉设计 - 统一圆角、阴影、间距等设计规范 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3a7635d459
commit
7139e4d1fd
5 files changed
+1167
-1013
No files matched your search
@@ -3,201 +3,250 @@
|
||||
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="@dimen/spacing_md"
|
||||
app:cardElevation="0dp"
|
||||
app:cardCornerRadius="@dimen/corner_radius_lg"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginHorizontal="4dp"
|
||||
app:cardElevation="2dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:strokeColor="@color/bg_secondary_modern"
|
||||
app:strokeWidth="1dp"
|
||||
app:strokeWidth="0dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
android:focusable="true"
|
||||
android:foreground="?android:attr/selectableItemBackground">
|
||||
|
||||
<LinearLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/spacing_lg">
|
||||
android:padding="16dp">
|
||||
|
||||
<!-- Top Row: Name and Status -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
<!-- 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:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
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" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="@drawable/bg_icon_container_sky"
|
||||
android:backgroundTint="@color/sky_blue_container">
|
||||
|
||||
<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 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" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="@dimen/spacing_md">
|
||||
<!-- 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" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAlbumName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="相册名称"
|
||||
android:textSize="@dimen/text_size_md"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/text_primary_modern"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAlbumInfo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="3 个文件夹 · 120 张图片"
|
||||
android:textSize="@dimen/text_size_xs"
|
||||
android:textColor="@color/text_secondary_modern"
|
||||
android:layout_marginTop="2dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCurrentBadge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="使用中"
|
||||
android:textSize="10sp"
|
||||
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="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Divider -->
|
||||
<!-- Divider (Optional, subtle) -->
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/bg_secondary_modern"
|
||||
android:layout_marginVertical="@dimen/spacing_md" />
|
||||
android:background="#F0F0F0"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/iconContainer" />
|
||||
|
||||
<!-- Bottom Row: Config and Actions -->
|
||||
<!-- Bottom Stats Row -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/statsRow"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical">
|
||||
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">
|
||||
|
||||
<!-- Config Info -->
|
||||
<!-- Play Mode -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
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="@dimen/text_size_xs"
|
||||
android:textColor="@color/text_hint_modern"
|
||||
android:drawableStart="@drawable/ic_repeat"
|
||||
android:drawablePadding="4dp"
|
||||
android:drawableTint="@color/text_hint_modern" />
|
||||
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:text="30 分钟"
|
||||
android:textSize="@dimen/text_size_xs"
|
||||
android:textColor="@color/text_hint_modern"
|
||||
android:layout_marginStart="@dimen/spacing_md"
|
||||
android:drawableStart="@drawable/ic_schedule"
|
||||
android:drawablePadding="4dp"
|
||||
android:drawableTint="@color/text_hint_modern" />
|
||||
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:text="未扫描"
|
||||
android:textSize="@dimen/text_size_xs"
|
||||
android:textColor="@color/text_hint_modern"
|
||||
android:layout_marginStart="@dimen/spacing_md"
|
||||
android:drawableStart="@drawable/ic_refresh"
|
||||
android:drawablePadding="4dp"
|
||||
android:drawableTint="@color/text_hint_modern" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnEdit"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:insetLeft="0dp"
|
||||
android:insetTop="0dp"
|
||||
android:insetRight="0dp"
|
||||
android:insetBottom="0dp"
|
||||
app:icon="@drawable/ic_edit"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="0dp"
|
||||
app:iconSize="20dp"
|
||||
app:iconTint="@color/text_secondary_modern"
|
||||
app:cornerRadius="20dp"
|
||||
app:backgroundTint="@color/bg_secondary_modern"
|
||||
style="@style/Widget.Material3.Button.IconButton" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnDelete"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:insetLeft="0dp"
|
||||
android:insetTop="0dp"
|
||||
android:insetRight="0dp"
|
||||
android:insetBottom="0dp"
|
||||
app:icon="@drawable/ic_delete"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="0dp"
|
||||
app:iconSize="20dp"
|
||||
app:iconTint="@color/status_error_text"
|
||||
app:cornerRadius="20dp"
|
||||
app:backgroundTint="@color/status_error_bg"
|
||||
style="@style/Widget.Material3.Button.IconButton" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="使用"
|
||||
android:textSize="@dimen/text_size_xs"
|
||||
app:cornerRadius="@dimen/corner_radius_pill"
|
||||
app:backgroundTint="@color/sky_blue_primary"
|
||||
style="@style/Widget.Material3.Button" />
|
||||
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="刚刚"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/text_hint" />
|
||||
</LinearLayout>
|
||||
|
||||
</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>
|
||||
Reference in new issue
Block a user