feat: 添加幻灯片播放功能
- 新增幻灯片 Tab 到底部导航(第5个导航项) - 实现 SlideshowFragment 数量选择页(10/20/50/全部) - 实现 SlideshowPlayerActivity 全屏播放器 - 支持播放/暂停、上一张/下一张控制 - 支持实时调整播放间隔(3-15秒) - 控制面板自动隐藏功能(3秒后隐藏) - 播放结束后显示重播/退出选项 - 从当前激活相册随机选择图片播放 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e1f8265636
commit
b805abd153
9 files changed
+939
-9
No files matched your search
@@ -0,0 +1,190 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
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:background="@android:color/black">
|
||||
|
||||
<!-- 全屏图片 -->
|
||||
<ImageView
|
||||
android:id="@+id/ivSlideshow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerInside"
|
||||
android:contentDescription="幻灯片图片" />
|
||||
|
||||
<!-- 控制面板 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/controlPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:orientation="vertical"
|
||||
android:background="#CC000000"
|
||||
android:padding="24dp"
|
||||
android:visibility="visible">
|
||||
|
||||
<!-- 进度显示 -->
|
||||
<TextView
|
||||
android:id="@+id/tvProgress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1 / 20"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
<!-- 间隔滑块 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginBottom="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="间隔:"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_marginEnd="8dp" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/seekBarInterval"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:max="12"
|
||||
android:progress="2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvIntervalLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="5 秒"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_marginStart="8dp"
|
||||
android:minWidth="48dp"
|
||||
android:gravity="end" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 控制按钮 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center">
|
||||
|
||||
<!-- 上一张 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnPrevious"
|
||||
style="@style/Widget.Material3.Button.IconButton"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
app:icon="@android:drawable/ic_media_previous"
|
||||
app:iconSize="32dp"
|
||||
app:iconTint="@android:color/white"
|
||||
app:backgroundTint="#40FFFFFF"
|
||||
android:layout_marginEnd="8dp" />
|
||||
|
||||
<!-- 播放/暂停 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnPlayPause"
|
||||
style="@style/Widget.Material3.Button.IconButton"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
app:icon="@android:drawable/ic_media_pause"
|
||||
app:iconSize="36dp"
|
||||
app:iconTint="@android:color/white"
|
||||
app:backgroundTint="#60FFFFFF"
|
||||
android:layout_marginHorizontal="8dp" />
|
||||
|
||||
<!-- 下一张 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnNext"
|
||||
style="@style/Widget.Material3.Button.IconButton"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
app:icon="@android:drawable/ic_media_next"
|
||||
app:iconSize="32dp"
|
||||
app:iconTint="@android:color/white"
|
||||
app:backgroundTint="#40FFFFFF"
|
||||
android:layout_marginStart="8dp" />
|
||||
|
||||
<!-- 退出 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnExit"
|
||||
style="@style/Widget.Material3.Button.IconButton"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
app:icon="@android:drawable/ic_menu_close_clear_cancel"
|
||||
app:iconSize="28dp"
|
||||
app:iconTint="@android:color/white"
|
||||
app:backgroundTint="#40FF0000"
|
||||
android:layout_marginStart="16dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 播放结束界面 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/endScreen"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:background="#CC000000"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="播放结束"
|
||||
android:textSize="32sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_marginBottom="32dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 重新播放 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnReplay"
|
||||
style="@style/Widget.Material3.Button.TonalButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="56dp"
|
||||
android:text="重新播放"
|
||||
android:textSize="16sp"
|
||||
app:backgroundTint="@color/sky_blue_primary"
|
||||
android:textColor="@android:color/white"
|
||||
app:cornerRadius="28dp"
|
||||
android:paddingHorizontal="32dp"
|
||||
android:layout_marginEnd="16dp" />
|
||||
|
||||
<!-- 退出 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnExitEnd"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="56dp"
|
||||
android:text="退出"
|
||||
android:textSize="16sp"
|
||||
app:strokeColor="@android:color/white"
|
||||
android:textColor="@android:color/white"
|
||||
app:cornerRadius="28dp"
|
||||
android:paddingHorizontal="32dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
Reference in new issue
Block a user