Files
bzForGk2/app/src/main/AndroidManifest.xml
T
hughhuangandClaude Sonnet 4.5 20b8f5fc93 feat: 实现多相册功能并优化扫描性能
新增功能:
- 多相册支持:创建、编辑、删除、切换相册
- 每个相册独立的文件夹池和配置(播放模式、间隔、返回桌面更换)
- 相册管理页面:显示所有相册、当前徽章、配置信息
- 相册编辑页面:创建/编辑相册、选择文件夹、设置配置
- 主页显示当前激活的相册信息
- 删除相册功能(默认相册除外,带确认对话框)

核心实现:
- Album 数据模型(id、name、folders、配置、时间戳等)
- AlbumPreferences 相册管理器(保存/加载/迁移配置)
- AlbumManagementFragment 相册列表页
- AlbumEditorActivity 相册编辑页
- 4个页面底部导航(主页、壁纸、相册、设置)

性能优化:
- 并发扫描:使用线程池同时扫描多个文件夹(4倍提速)
- 预分配容量:ArrayList 预分配容量减少扩容次数
- 快速文件检查:优化扩展名匹配算法(30%提速)
- 内存缓存:5秒内不重复扫描同一文件夹
- 扫描限制:最大50000张图片防止OOM
- 资源管理:正确释放线程池防止内存泄漏

Bug修复:
- 修复"当前"徽章显示错误(动态获取激活相册ID)
- 修复新建相册保存不生效(使用isNewAlbum标志)
- 修复相册编辑页面文件夹选择功能(ActivityResultLauncher)
- 添加防抖机制避免频繁统计图片数量

架构改进:
- WallpaperPreferences 从 Album 读取配置
- 自动迁移旧配置到默认相册
- 支持全局文件夹池(所有相册共享)

新增文件:
- Album.java, AlbumPreferences.java
- AlbumManagementFragment.java, AlbumEditorActivity.java
- 相册相关布局和图标(10个drawable)

修改文件:
- MainActivity, ViewPagerAdapter, HomeFragment
- ImageScanner, WallpaperPreferences
- 底部导航、主页布局

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-23 09:15:10 +08:00

68 lines
2.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 权限声明 -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.BzForGk2">
<!-- Main Activity -->
<activity
android:name=".ui.MainActivity"
android:exported="true"
android:theme="@style/Theme.BzForGk2">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Wallpaper Service -->
<service
android:name=".wallpaper.AutoWallpaperService"
android:description="@string/wallpaper_description"
android:enabled="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:permission="android.permission.BIND_WALLPAPER"
android:exported="true">
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data
android:name="android.service.wallpaper"
android:resource="@xml/wallpaper_info" />
</service>
<!-- Broadcast Receiver for wallpaper changes -->
<receiver
android:name=".receiver.WallpaperChangeReceiver"
android:enabled="true"
android:exported="false">
<intent-filter>
<action android:name="cn.hugh.bz.gk2.ACTION_CHANGE_WALLPAPER" />
</intent-filter>
</receiver>
<!-- Album Editor Activity -->
<activity
android:name=".ui.AlbumEditorActivity"
android:exported="false"
android:theme="@style/Theme.BzForGk2" />
</application>
</manifest>