refactor: 优化底部导航栏交互和样式
改进内容: - 增强导航项选中状态的视觉反馈 - 添加导航项缩放动画效果 - 优化导航容器的选中状态管理 - 改进颜色系统,使用 Material 3 天蓝色主题 - 优化布局尺寸和间距 - 添加导航项背景选择器 - 添加导航项图标颜色选择器 - 添加导航项文字颜色选择器 UI 改进: - 更新 activity_main.xml 布局 - 更新 fragment_home.xml 布局 - 更新 item_album_card.xml 布局 - 优化 colors.xml 颜色定义 - 优化 dimens.xml 尺寸定义 - 优化 themes.xml 主题定义 - 新增 selector_nav_item_bg.xml - 新增 selector_nav_item_icon_color.xml - 新增 selector_nav_item_text_color.xml Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
11bbeaf6eb
commit
4347fa92b2
11 files changed
+639
-849
No files matched your search
@@ -6,11 +6,11 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/spacing_md"
|
||||
app:cardElevation="@dimen/card_elevation"
|
||||
app:cardCornerRadius="@dimen/corner_radius_md"
|
||||
app:cardBackgroundColor="@color/bg_card"
|
||||
app:strokeColor="@color/glass_border"
|
||||
app:strokeWidth="@dimen/glass_border_width"
|
||||
app:cardElevation="0dp"
|
||||
app:cardCornerRadius="@dimen/corner_radius_lg"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:strokeColor="@color/bg_secondary_modern"
|
||||
app:strokeWidth="1dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
@@ -18,139 +18,174 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/card_padding">
|
||||
android:padding="@dimen/spacing_lg">
|
||||
|
||||
<!-- 相册名称和状态 -->
|
||||
<!-- Top Row: Name and Status -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAlbumName"
|
||||
<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>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="相册名称"
|
||||
android:textSize="@dimen/text_size_lg"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/text_primary"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end" />
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="@dimen/spacing_md">
|
||||
|
||||
<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="@dimen/text_size_xs"
|
||||
android:textColor="@color/white"
|
||||
android:paddingStart="@dimen/spacing_sm"
|
||||
android:paddingEnd="@dimen/spacing_sm"
|
||||
android:paddingTop="@dimen/spacing_xs"
|
||||
android:paddingBottom="@dimen/spacing_xs"
|
||||
android:text="使用中"
|
||||
android:textSize="10sp"
|
||||
android:textColor="@color/sky_blue_primary"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:paddingVertical="4dp"
|
||||
android:background="@drawable/badge_background"
|
||||
android:layout_marginStart="@dimen/spacing_sm"
|
||||
android:backgroundTint="@color/sky_blue_container"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 相册信息 -->
|
||||
<TextView
|
||||
android:id="@+id/tvAlbumInfo"
|
||||
<!-- Divider -->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="3 个文件夹 · 120 张图片"
|
||||
android:textSize="@dimen/text_size_sm"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:layout_marginTop="@dimen/spacing_sm" />
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/bg_secondary_modern"
|
||||
android:layout_marginVertical="@dimen/spacing_md" />
|
||||
|
||||
<!-- 配置信息 -->
|
||||
<!-- Bottom Row: Config and Actions -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/spacing_sm"
|
||||
android:orientation="horizontal">
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPlayMode"
|
||||
android:layout_width="wrap_content"
|
||||
<!-- Config Info -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="顺序"
|
||||
android:textSize="@dimen/text_size_xs"
|
||||
android:textColor="@color/text_hint"
|
||||
android:drawableStart="@drawable/ic_repeat"
|
||||
android:drawablePadding="@dimen/spacing_xs" />
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<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"
|
||||
android:layout_marginStart="@dimen/spacing_md"
|
||||
android:drawableStart="@drawable/ic_schedule"
|
||||
android:drawablePadding="@dimen/spacing_xs" />
|
||||
<TextView
|
||||
android:id="@+id/tvPlayMode"
|
||||
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:drawableStart="@drawable/ic_repeat"
|
||||
android:drawablePadding="4dp"
|
||||
android:drawableTint="@color/text_hint_modern" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/spacing_md"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="end">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnEdit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:text="编辑"
|
||||
android:textSize="@dimen/text_size_sm"
|
||||
android:layout_marginEnd="@dimen/spacing_sm"
|
||||
app:icon="@drawable/ic_edit"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="@dimen/spacing_xs"
|
||||
app:cornerRadius="@dimen/corner_radius_sm"
|
||||
app:strokeColor="@color/accent_secondary"
|
||||
app:strokeWidth="1dp"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:text="切换"
|
||||
android:textSize="@dimen/text_size_sm"
|
||||
android:layout_marginEnd="@dimen/spacing_sm"
|
||||
android:backgroundTint="@color/accent_primary"
|
||||
app:icon="@drawable/ic_swap_horiz"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="@dimen/spacing_xs"
|
||||
app:cornerRadius="@dimen/corner_radius_sm"
|
||||
style="@style/Widget.Material3.Button" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnDelete"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:text="删除"
|
||||
android:textSize="@dimen/text_size_sm"
|
||||
app:icon="@drawable/ic_delete"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="@dimen/spacing_xs"
|
||||
app:cornerRadius="@dimen/corner_radius_sm"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||
android:textColor="@color/color_error"
|
||||
app:iconTint="@color/color_error"
|
||||
app:strokeColor="@color/color_error" />
|
||||
<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" />
|
||||
|
||||
</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" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
Reference in new issue
Block a user