feat: 完成2026-06-09版本迭代更新
此版本包含: 1. 新增位置消息发送与展示功能 2. 完善多语言本地化文案 3. 新增安卓端管理空间Activity与图标背景 4. 优化摇一摇开关逻辑与深度链接配置 5. 新增信息流平台过滤与A/B测试后台功能 6. 更新签名配置与构建脚本 7. 修复若干已知问题与代码优化
This commit is contained in:
BIN
android/app/520kiss123.jks
Normal file
BIN
android/app/520kiss123.jks
Normal file
Binary file not shown.
@@ -1,3 +1,5 @@
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
@@ -5,6 +7,13 @@ plugins {
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
// 读取签名配置
|
||||
val keystoreProperties = Properties()
|
||||
val keystorePropertiesFile = rootProject.file("key.properties")
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(keystorePropertiesFile.inputStream())
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "apps.xy.xianyan"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
@@ -38,11 +47,19 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
keyAlias = keystoreProperties["keyAlias"] as String?
|
||||
keyPassword = keystoreProperties["keyPassword"] as String?
|
||||
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
|
||||
storePassword = keystoreProperties["storePassword"] as String?
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
// 使用正式签名配置
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
|
||||
// release 包同样排除 armeabi-v7a
|
||||
ndk {
|
||||
@@ -68,4 +85,5 @@ flutter {
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
|
||||
implementation("com.google.android.material:material:1.12.0")
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:manageSpaceActivity=".MainActivity">
|
||||
android:manageSpaceActivity=".ManageSpaceActivity">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
@@ -139,6 +139,14 @@
|
||||
<data android:mimeType="*/*"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- 管理空间Activity — 系统应用信息页"管理空间"按钮入口 -->
|
||||
<activity
|
||||
android:name=".ManageSpaceActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/ManageSpaceActivityTheme"
|
||||
android:excludeFromRecents="true"
|
||||
android:taskAffinity=""
|
||||
android:finishOnTaskLaunch="true" />
|
||||
<receiver
|
||||
android:name=".widget.DailySentenceProvider"
|
||||
android:exported="false">
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
// ============================================================
|
||||
// 闲言APP — Android主Activity
|
||||
// 创建时间: 2026-04-20
|
||||
// 更新时间: 2026-06-01
|
||||
// 作用: Flutter主入口,处理BLE广播 + 系统管理空间拦截
|
||||
// 上次更新: shortcuts.xml已对齐quick_actions_android插件的extra key和action,无需额外处理
|
||||
// 更新时间: 2026-06-09
|
||||
// 作用: Flutter主入口,处理BLE广播 + 管理空间跳转
|
||||
// 上次更新: 拆分管理空间对话框到ManageSpaceActivity,MainActivity仅处理intent extras跳转
|
||||
// ============================================================
|
||||
|
||||
package apps.xy.xianyan
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.Log
|
||||
import apps.xy.xianyan.ble.BleAdvertiserPlugin
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
@@ -27,26 +25,38 @@ class MainActivity : FlutterActivity() {
|
||||
private const val ACTION_MANAGE_STORAGE = "android.app.action.MANAGE_STORAGE"
|
||||
}
|
||||
|
||||
/** 待执行的ManageSpace操作(从ManageSpaceActivity传递过来) */
|
||||
private var pendingManageSpaceAction: String? = null
|
||||
private var pendingManageStorage = false
|
||||
private var methodChannel: MethodChannel? = null
|
||||
|
||||
// ---- 生命周期 ----
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
bleAdvertiser.setupChannel(flutterEngine!!, this)
|
||||
|
||||
if (isManageStorageIntent(intent)) {
|
||||
pendingManageStorage = true
|
||||
Log.i(TAG, "onCreate: MANAGE_STORAGE intent detected, pending navigation")
|
||||
}
|
||||
// 检查是否从ManageSpaceActivity跳转过来
|
||||
handleManageSpaceIntent(intent)
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
setIntent(intent)
|
||||
|
||||
if (isManageStorageIntent(intent)) {
|
||||
Log.i(TAG, "onNewIntent: MANAGE_STORAGE intent, notifying Flutter")
|
||||
notifyFlutterOpenDataManagement()
|
||||
// 检查是否从ManageSpaceActivity跳转过来
|
||||
handleManageSpaceIntent(intent)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
// 执行待处理的管理空间操作
|
||||
pendingManageSpaceAction?.let { action ->
|
||||
pendingManageSpaceAction = null
|
||||
window.decorView.post {
|
||||
invokeFlutterMethod(action)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,27 +77,6 @@ class MainActivity : FlutterActivity() {
|
||||
else -> result.notImplemented()
|
||||
}
|
||||
}
|
||||
|
||||
if (pendingManageStorage) {
|
||||
pendingManageStorage = false
|
||||
Handler(Looper.getMainLooper()).postDelayed({
|
||||
notifyFlutterOpenDataManagement()
|
||||
}, 800)
|
||||
}
|
||||
}
|
||||
|
||||
private fun notifyFlutterOpenDataManagement() {
|
||||
if (methodChannel == null) {
|
||||
pendingManageStorage = true
|
||||
Log.w(TAG, "MethodChannel not ready, will retry after configureFlutterEngine")
|
||||
return
|
||||
}
|
||||
methodChannel?.invokeMethod("open_data_management", null)
|
||||
Log.i(TAG, "Invoked open_data_management via MethodChannel")
|
||||
}
|
||||
|
||||
private fun isManageStorageIntent(intent: Intent?): Boolean {
|
||||
return intent?.action == ACTION_MANAGE_STORAGE
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
@@ -95,4 +84,45 @@ class MainActivity : FlutterActivity() {
|
||||
methodChannel = null
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
// ---- 管理空间处理 ----
|
||||
|
||||
/**
|
||||
* 检查intent中是否包含ManageSpaceActivity传递的操作
|
||||
* 支持两种来源:
|
||||
* 1. ManageSpaceActivity通过extra传递的操作
|
||||
* 2. 系统MANAGE_STORAGE intent(兼容旧逻辑)
|
||||
*/
|
||||
private fun handleManageSpaceIntent(intent: Intent?) {
|
||||
if (intent == null) return
|
||||
|
||||
// 优先检查ManageSpaceActivity传递的extra
|
||||
val action = intent.getStringExtra(ManageSpaceActivity.EXTRA_MANAGE_SPACE_ACTION)
|
||||
if (action != null) {
|
||||
Log.i(TAG, "handleManageSpaceIntent: received action from ManageSpaceActivity: $action")
|
||||
pendingManageSpaceAction = action
|
||||
return
|
||||
}
|
||||
|
||||
// 兼容:检查系统MANAGE_STORAGE intent
|
||||
if (intent.action == ACTION_MANAGE_STORAGE) {
|
||||
Log.i(TAG, "handleManageSpaceIntent: MANAGE_STORAGE intent detected")
|
||||
pendingManageStorage = true
|
||||
pendingManageSpaceAction = ManageSpaceActivity.ACTION_DATA_MANAGEMENT
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过MethodChannel调用Flutter端方法
|
||||
*/
|
||||
private fun invokeFlutterMethod(method: String) {
|
||||
if (methodChannel == null) {
|
||||
Log.e(TAG, "invokeFlutterMethod: MethodChannel not ready, cannot invoke $method")
|
||||
// 保存操作,等MethodChannel就绪后重试
|
||||
pendingManageSpaceAction = method
|
||||
return
|
||||
}
|
||||
methodChannel?.invokeMethod(method, null)
|
||||
Log.i(TAG, "invokeFlutterMethod: invoked $method via MethodChannel")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
// ============================================================
|
||||
// 闲言APP — 管理空间Activity
|
||||
// 创建时间: 2026-06-09
|
||||
// 更新时间: 2026-06-09
|
||||
// 作用: 安卓端"应用信息→管理空间"入口,弹出原生对话框
|
||||
// 上次更新: 初始创建,从MainActivity拆分独立管理空间逻辑
|
||||
// ============================================================
|
||||
// 设计说明:
|
||||
// AndroidManifest中 android:manageSpaceActivity 指向此Activity。
|
||||
// 当用户在系统"应用信息"页点击"管理空间"时,系统启动此Activity。
|
||||
// 注意:系统不会发送 MANAGE_STORAGE action intent,而是直接启动此Activity,
|
||||
// 因此不能在MainActivity中通过intent action检测。
|
||||
// 此Activity使用透明主题,仅显示对话框,用户操作后跳转MainActivity。
|
||||
// ============================================================
|
||||
|
||||
package apps.xy.xianyan
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.ContextThemeWrapper
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
|
||||
class ManageSpaceActivity : AppCompatActivity() {
|
||||
|
||||
companion object {
|
||||
/** Intent extra key:管理空间操作类型 */
|
||||
const val EXTRA_MANAGE_SPACE_ACTION = "manage_space_action"
|
||||
/** 操作值:一键清理 */
|
||||
const val ACTION_CLEAR_ALL = "clear_all_data"
|
||||
/** 操作值:跳转缓存管理 */
|
||||
const val ACTION_CACHE_MANAGEMENT = "navigate_to_cache_management"
|
||||
/** 操作值:跳转数据管理 */
|
||||
const val ACTION_DATA_MANAGEMENT = "navigate_to_data_management"
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
// 直接显示对话框,Activity本身透明无UI
|
||||
showManageSpaceDialog()
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示管理空间原生对话框
|
||||
* 三个选项:一键清理、缓存管理、数据管理
|
||||
*/
|
||||
private fun showManageSpaceDialog() {
|
||||
val dialogContext = ContextThemeWrapper(this, R.style.ManageSpaceDialogTheme)
|
||||
val dialogView = LayoutInflater.from(dialogContext)
|
||||
.inflate(R.layout.dialog_manage_space, null)
|
||||
|
||||
val dialog = MaterialAlertDialogBuilder(dialogContext)
|
||||
.setTitle("管理空间")
|
||||
.setView(dialogView)
|
||||
.setNegativeButton("取消") { _, _ -> finish() }
|
||||
.create()
|
||||
|
||||
// 一键清理
|
||||
dialogView.findViewById<LinearLayout>(R.id.option_clear_all)?.setOnClickListener {
|
||||
dialog.dismiss()
|
||||
showClearAllConfirmDialog()
|
||||
}
|
||||
|
||||
// 缓存管理
|
||||
dialogView.findViewById<LinearLayout>(R.id.option_cache_management)?.setOnClickListener {
|
||||
dialog.dismiss()
|
||||
startMainActivity(ACTION_CACHE_MANAGEMENT)
|
||||
}
|
||||
|
||||
// 数据管理
|
||||
dialogView.findViewById<LinearLayout>(R.id.option_data_management)?.setOnClickListener {
|
||||
dialog.dismiss()
|
||||
startMainActivity(ACTION_DATA_MANAGEMENT)
|
||||
}
|
||||
|
||||
// 暗色模式适配
|
||||
adaptDarkMode(dialogView)
|
||||
|
||||
// 点击对话框外部或按返回键关闭
|
||||
dialog.setOnCancelListener { finish() }
|
||||
|
||||
dialog.show()
|
||||
}
|
||||
|
||||
/**
|
||||
* 一键清理二次确认对话框
|
||||
*/
|
||||
private fun showClearAllConfirmDialog() {
|
||||
val dialogContext = ContextThemeWrapper(this, R.style.ManageSpaceDialogTheme)
|
||||
MaterialAlertDialogBuilder(dialogContext)
|
||||
.setTitle("⚠️ 确认清理")
|
||||
.setMessage("此操作将清除所有本地数据,包括收藏、笔记、缓存等。此操作不可撤销!")
|
||||
.setPositiveButton("清理") { _, _ ->
|
||||
startMainActivity(ACTION_CLEAR_ALL)
|
||||
}
|
||||
.setNegativeButton("取消") { _, _ ->
|
||||
finish()
|
||||
}
|
||||
.setOnCancelListener { finish() }
|
||||
.show()
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动MainActivity并传递操作类型
|
||||
* 使用 CLEAR_TOP + SINGLE_TOP 确保复用已有实例
|
||||
*/
|
||||
private fun startMainActivity(action: String) {
|
||||
val intent = Intent(this, MainActivity::class.java)
|
||||
intent.putExtra(EXTRA_MANAGE_SPACE_ACTION, action)
|
||||
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP
|
||||
startActivity(intent)
|
||||
finish()
|
||||
}
|
||||
|
||||
/**
|
||||
* 暗色模式适配:调整自定义布局中的文字和分隔线颜色
|
||||
*/
|
||||
private fun adaptDarkMode(root: android.view.View) {
|
||||
val isDark = resources.configuration.uiMode and
|
||||
android.content.res.Configuration.UI_MODE_NIGHT_MASK ==
|
||||
android.content.res.Configuration.UI_MODE_NIGHT_YES
|
||||
|
||||
if (!isDark) return
|
||||
|
||||
val titleColor = android.graphics.Color.parseColor("#E0E0E0")
|
||||
val descColor = android.graphics.Color.parseColor("#8A8A8E")
|
||||
val dividerColor = android.graphics.Color.parseColor("#3C3C3E")
|
||||
|
||||
adjustTextViewColors(root, titleColor, descColor)
|
||||
adjustDividerColors(root, dividerColor)
|
||||
}
|
||||
|
||||
private fun adjustTextViewColors(
|
||||
view: android.view.View,
|
||||
titleColor: Int,
|
||||
descColor: Int,
|
||||
) {
|
||||
if (view is android.widget.TextView) {
|
||||
val currentColor = view.currentTextColor
|
||||
if (currentColor == android.graphics.Color.parseColor("#212121")) {
|
||||
view.setTextColor(titleColor)
|
||||
} else if (currentColor == android.graphics.Color.parseColor("#9E9E9E")) {
|
||||
view.setTextColor(descColor)
|
||||
} else if (currentColor == android.graphics.Color.parseColor("#BDBDBD")) {
|
||||
view.setTextColor(android.graphics.Color.parseColor("#666666"))
|
||||
}
|
||||
} else if (view is android.view.ViewGroup) {
|
||||
for (i in 0 until view.childCount) {
|
||||
adjustTextViewColors(view.getChildAt(i), titleColor, descColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun adjustDividerColors(view: android.view.View, color: Int) {
|
||||
if (view is android.view.ViewGroup) {
|
||||
for (i in 0 until view.childCount) {
|
||||
val child = view.getChildAt(i)
|
||||
if (child !is android.widget.TextView && child !is LinearLayout) {
|
||||
try {
|
||||
child.setBackgroundColor(color)
|
||||
} catch (_: Exception) {}
|
||||
} else if (child is android.view.ViewGroup) {
|
||||
adjustDividerColors(child, color)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 闲言APP — 图标圆形背景(蓝色/暗色模式) -->
|
||||
<!-- 创建时间: 2026-06-09 -->
|
||||
<!-- ============================================================ -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#1A3D5A" />
|
||||
</shape>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 闲言APP — 图标圆形背景(红色/暗色模式) -->
|
||||
<!-- 创建时间: 2026-06-09 -->
|
||||
<!-- ============================================================ -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#3E1A1A" />
|
||||
</shape>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 闲言APP — 图标圆形背景(绿色/暗色模式) -->
|
||||
<!-- 创建时间: 2026-06-09 -->
|
||||
<!-- ============================================================ -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#1A3D2A" />
|
||||
</shape>
|
||||
14
android/app/src/main/res/drawable-night/bg_manage_option.xml
Normal file
14
android/app/src/main/res/drawable-night/bg_manage_option.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ============================================================ -->
|
||||
<!-- 闲言APP — 管理空间选项背景(普通/暗色模式) -->
|
||||
<!-- 创建时间: 2026-06-09 -->
|
||||
<!-- ============================================================ -->
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="#1AFFFFFF">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#2C2C2E" />
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ============================================================ -->
|
||||
<!-- 闲言APP — 管理空间选项背景(危险操作/暗色模式) -->
|
||||
<!-- 创建时间: 2026-06-09 -->
|
||||
<!-- ============================================================ -->
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="#1AEF5350">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#3E1A1A" />
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
11
android/app/src/main/res/drawable/bg_dialog_background.xml
Normal file
11
android/app/src/main/res/drawable/bg_dialog_background.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ============================================================ -->
|
||||
<!-- 闲言APP — 对话框圆角背景 -->
|
||||
<!-- 创建时间: 2026-06-09 -->
|
||||
<!-- 作用: Material3对话框的圆角背景,亮色/暗色模式通用 -->
|
||||
<!-- ============================================================ -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="?android:colorBackground" />
|
||||
<corners android:radius="28dp" />
|
||||
</shape>
|
||||
10
android/app/src/main/res/drawable/bg_icon_circle_blue.xml
Normal file
10
android/app/src/main/res/drawable/bg_icon_circle_blue.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ============================================================ -->
|
||||
<!-- 闲言APP — 图标圆形背景(蓝色) -->
|
||||
<!-- 创建时间: 2026-06-09 -->
|
||||
<!-- 作用: 缓存管理图标的圆形背景 -->
|
||||
<!-- ============================================================ -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#E3F2FD" />
|
||||
</shape>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ============================================================ -->
|
||||
<!-- 闲言APP — 图标圆形背景(红色/危险) -->
|
||||
<!-- 创建时间: 2026-06-09 -->
|
||||
<!-- 作用: 一键清理图标的圆形背景 -->
|
||||
<!-- ============================================================ -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#FFEBEE" />
|
||||
</shape>
|
||||
10
android/app/src/main/res/drawable/bg_icon_circle_green.xml
Normal file
10
android/app/src/main/res/drawable/bg_icon_circle_green.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ============================================================ -->
|
||||
<!-- 闲言APP — 图标圆形背景(绿色) -->
|
||||
<!-- 创建时间: 2026-06-09 -->
|
||||
<!-- 作用: 数据管理图标的圆形背景 -->
|
||||
<!-- ============================================================ -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#E8F5E9" />
|
||||
</shape>
|
||||
15
android/app/src/main/res/drawable/bg_manage_option.xml
Normal file
15
android/app/src/main/res/drawable/bg_manage_option.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ============================================================ -->
|
||||
<!-- 闲言APP — 管理空间选项背景(普通) -->
|
||||
<!-- 创建时间: 2026-06-09 -->
|
||||
<!-- 作用: 圆角点击效果背景,用于缓存管理/数据管理选项 -->
|
||||
<!-- ============================================================ -->
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="#1A000000">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#F5F5F5" />
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ============================================================ -->
|
||||
<!-- 闲言APP — 管理空间选项背景(危险操作) -->
|
||||
<!-- 创建时间: 2026-06-09 -->
|
||||
<!-- 作用: 红色圆角点击效果背景,用于一键清理选项 -->
|
||||
<!-- ============================================================ -->
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="#1AD32F2F">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFF5F5" />
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
200
android/app/src/main/res/layout/dialog_manage_space.xml
Normal file
200
android/app/src/main/res/layout/dialog_manage_space.xml
Normal file
@@ -0,0 +1,200 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- ============================================================ -->
|
||||
<!-- 闲言APP — 管理空间对话框布局 -->
|
||||
<!-- 创建时间: 2026-06-09 -->
|
||||
<!-- 作用: 安卓端"管理空间"原生对话框,支持一键清理/缓存管理/数据管理 -->
|
||||
<!-- ============================================================ -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<!-- 副标题 -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="选择您要执行的操作"
|
||||
android:textSize="13sp"
|
||||
android:textColor="#8A8A8E"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
<!-- 一键清理 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/option_clear_all"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="14dp"
|
||||
android:background="@drawable/bg_manage_option_destructive"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<TextView
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:text="🗑️"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/bg_icon_circle_destructive" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="14dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="一键清理"
|
||||
android:textSize="15sp"
|
||||
android:textColor="#D32F2F"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="清除所有应用数据,此操作不可撤销"
|
||||
android:textSize="12sp"
|
||||
android:textColor="#9E9E9E"
|
||||
android:layout_marginTop="3dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="›"
|
||||
android:textSize="20sp"
|
||||
android:textColor="#BDBDBD"
|
||||
android:layout_marginStart="8dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 分隔线 -->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#E0E0E0"
|
||||
android:layout_marginStart="64dp"
|
||||
android:layout_marginVertical="4dp" />
|
||||
|
||||
<!-- 缓存管理 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/option_cache_management"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="14dp"
|
||||
android:background="@drawable/bg_manage_option"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<TextView
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:text="📦"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/bg_icon_circle_blue" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="14dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="缓存管理"
|
||||
android:textSize="15sp"
|
||||
android:textColor="#212121"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="管理缓存和临时文件"
|
||||
android:textSize="12sp"
|
||||
android:textColor="#9E9E9E"
|
||||
android:layout_marginTop="3dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="›"
|
||||
android:textSize="20sp"
|
||||
android:textColor="#BDBDBD"
|
||||
android:layout_marginStart="8dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 分隔线 -->
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#E0E0E0"
|
||||
android:layout_marginStart="64dp"
|
||||
android:layout_marginVertical="4dp" />
|
||||
|
||||
<!-- 数据管理 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/option_data_management"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="14dp"
|
||||
android:background="@drawable/bg_manage_option"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<TextView
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:text="📊"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/bg_icon_circle_green" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="14dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="数据管理"
|
||||
android:textSize="15sp"
|
||||
android:textColor="#212121"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="管理收藏、历史、笔记等数据"
|
||||
android:textSize="12sp"
|
||||
android:textColor="#9E9E9E"
|
||||
android:layout_marginTop="3dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="›"
|
||||
android:textSize="20sp"
|
||||
android:textColor="#BDBDBD"
|
||||
android:layout_marginStart="8dp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -15,4 +15,22 @@
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
|
||||
<!-- Material3 暗色对话框主题 — 用于管理空间等原生对话框 -->
|
||||
<style name="ManageSpaceDialogTheme" parent="Theme.Material3.Dark.Dialog.Alert">
|
||||
<item name="colorPrimary">#90CAF9</item>
|
||||
<item name="colorSecondary">#A5D6A7</item>
|
||||
<item name="colorError">#EF5350</item>
|
||||
<item name="android:windowBackground">@drawable/bg_dialog_background</item>
|
||||
</style>
|
||||
|
||||
<!-- 管理空间Activity透明主题(暗色模式) -->
|
||||
<style name="ManageSpaceActivityTheme" parent="Theme.Material3.Dark.NoActionBar">
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
@@ -15,4 +15,22 @@
|
||||
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
|
||||
<!-- Material3 对话框主题 — 用于管理空间等原生对话框 -->
|
||||
<style name="ManageSpaceDialogTheme" parent="Theme.Material3.Light.Dialog.Alert">
|
||||
<item name="colorPrimary">#1976D2</item>
|
||||
<item name="colorSecondary">#388E3C</item>
|
||||
<item name="colorError">#D32F2F</item>
|
||||
<item name="android:windowBackground">@drawable/bg_dialog_background</item>
|
||||
</style>
|
||||
|
||||
<!-- 管理空间Activity透明主题 — Activity无可见UI,仅显示对话框 -->
|
||||
<style name="ManageSpaceActivityTheme" parent="Theme.Material3.Light.NoActionBar">
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user