优化当前壁纸页信息与交互

This commit is contained in:
hughhuang committed 2026-01-26 00:59:09 +08:00
1 parent 4347fa92b2
commit 19e433c402
2 files changed
+254 -134

No files matched your search

@@ -1,105 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
<androidx.constraintlayout.widget.ConstraintLayout
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:background="@color/bg_primary"
android:fillViewport="true">
android:background="@color/bg_primary_modern">
<androidx.constraintlayout.widget.ConstraintLayout
<!-- 顶部标题 -->
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="当前壁纸"
android:textSize="@dimen/text_size_xl"
android:textStyle="bold"
android:textColor="@color/text_primary_modern"
android:layout_marginTop="@dimen/spacing_lg"
android:layout_marginStart="@dimen/spacing_lg"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!-- 壁纸预览卡片 (占据主要空间) -->
<com.google.android.material.card.MaterialCardView
android:id="@+id/cardWallpaper"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginHorizontal="@dimen/spacing_lg"
android:layout_marginTop="@dimen/spacing_md"
android:layout_marginBottom="@dimen/spacing_lg"
app:cardElevation="0dp"
app:cardCornerRadius="@dimen/corner_radius_lg"
app:cardBackgroundColor="@color/bg_secondary_modern"
app:strokeColor="@color/bg_secondary_modern"
app:strokeWidth="1dp"
app:layout_constraintTop_toBottomOf="@id/tvTitle"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/infoContainer">
<ImageView
android:id="@+id/ivWallpaper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:contentDescription="当前壁纸预览" />
<!-- 点击提示遮罩 -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:id="@+id/touchOverlay" />
</com.google.android.material.card.MaterialCardView>
<!-- 底部信息和操作区 -->
<LinearLayout
android:id="@+id/infoContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/spacing_md"
tools:context=".ui.CurrentWallpaperFragment">
android:orientation="vertical"
android:paddingHorizontal="@dimen/spacing_lg"
android:paddingBottom="100dp"
app:layout_constraintBottom_toBottomOf="parent">
<!-- 壁纸预览卡片 -->
<com.google.android.material.card.MaterialCardView
android:id="@+id/cardWallpaper"
android:layout_width="0dp"
<!-- 壁纸信息 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardElevation="@dimen/card_elevation"
app:cardCornerRadius="@dimen/corner_radius_lg"
app:cardBackgroundColor="@color/bg_card"
app:strokeColor="@color/glass_border"
app:strokeWidth="@dimen/glass_border_width"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
android:orientation="vertical"
android:layout_marginBottom="@dimen/spacing_lg">
<androidx.constraintlayout.widget.ConstraintLayout
<TextView
android:id="@+id/tvWallpaperName"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:text="Loading..."
android:textSize="@dimen/text_size_lg"
android:textStyle="bold"
android:textColor="@color/text_primary_modern"
android:maxLines="1"
android:ellipsize="end" />
<!-- 壁纸图片 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/spacing_xs"
android:gravity="center_vertical">
<ImageView
android:id="@+id/ivWallpaper"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="centerCrop"
android:background="@color/bg_secondary"
android:adjustViewBounds="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintDimensionRatio="9:16"
android:contentDescription="当前壁纸预览" />
android:layout_width="@dimen/icon_size_xs"
android:layout_height="@dimen/icon_size_xs"
android:src="@drawable/ic_image"
app:tint="@color/text_secondary_modern" />
<!-- 渐变遮罩信息层 -->
<LinearLayout
android:layout_width="0dp"
<TextView
android:id="@+id/tvResolution"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/bg_gradient_overlay"
android:padding="@dimen/spacing_md"
app:layout_constraintBottom_toBottomOf="@id/ivWallpaper"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
android:text="1080 x 1920"
android:textSize="@dimen/text_size_sm"
android:textColor="@color/text_secondary_modern"
android:layout_marginStart="4dp" />
<View
android:layout_width="1dp"
android:layout_height="12dp"
android:background="@color/text_hint_modern"
android:layout_marginHorizontal="8dp" />
<TextView
android:id="@+id/tvFileSize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2.5 MB"
android:textSize="@dimen/text_size_sm"
android:textColor="@color/text_secondary_modern" />
<TextView
android:id="@+id/tvWallpaperPath"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="当前壁纸路径"
android:textSize="@dimen/text_size_sm"
android:textStyle="bold"
android:textColor="@color/text_primary"
android:maxLines="2"
android:ellipsize="middle" />
</LinearLayout>
<TextView
android:id="@+id/tvWallpaperSize"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="尺寸"
android:textSize="@dimen/text_size_xs"
android:textColor="@color/text_secondary"
android:layout_marginTop="@dimen/spacing_xs" />
<TextView
android:id="@+id/tvPath"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="/storage/emulated/0/..."
android:textSize="@dimen/text_size_xs"
android:textColor="@color/text_hint_modern"
android:layout_marginTop="@dimen/spacing_sm"
android:maxLines="1"
android:ellipsize="middle"
android:background="@drawable/badge_background"
android:backgroundTint="@color/bg_secondary_modern"
android:paddingHorizontal="8dp"
android:paddingVertical="4dp" />
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- 操作按钮行 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.button.MaterialButton
android:id="@+id/btnOpenGallery"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_weight="1"
android:text="查看原图"
android:textSize="@dimen/text_size_md"
android:textColor="@color/text_primary_modern"
app:icon="@drawable/ic_image"
app:iconTint="@color/text_primary_modern"
app:backgroundTint="@color/bg_secondary_modern"
app:cornerRadius="@dimen/corner_radius_pill"
style="@style/Widget.Material3.Button.Icon"
android:layout_marginEnd="@dimen/spacing_sm" />
<!-- 操作按钮 -->
<com.google.android.material.button.MaterialButton
android:id="@+id/btnNext"
android:layout_width="0dp"
android:layout_height="@dimen/button_height"
android:layout_marginTop="@dimen/spacing_lg"
android:text="下一张"
android:textSize="@dimen/text_size_md"
android:backgroundTint="@color/accent_primary"
app:icon="@drawable/ic_arrow_forward"
app:iconGravity="textEnd"
app:cornerRadius="@dimen/button_corner_radius"
style="@style/Widget.Material3.Button"
app:layout_constraintTop_toBottomOf="@id/cardWallpaper"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<com.google.android.material.button.MaterialButton
android:id="@+id/btnNext"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_weight="1.5"
android:text="切换下一张"
android:textSize="@dimen/text_size_md"
android:textStyle="bold"
app:icon="@drawable/ic_arrow_forward"
app:iconGravity="textEnd"
app:backgroundTint="@color/sky_blue_primary"
app:cornerRadius="@dimen/corner_radius_pill"
style="@style/Widget.Material3.Button.Icon"
android:layout_marginStart="@dimen/spacing_sm" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>