From 63c205f24342669ff064afe5f53fc8e7a66d14b5 Mon Sep 17 00:00:00 2001 From: ryuunoakaihitomi <22442525+ryuunoakaihitomi@users.noreply.github.com> Date: Wed, 4 Nov 2020 17:27:59 +0800 Subject: [PATCH] =?UTF-8?q?R3.3.4=20=E5=BD=BB=E5=BA=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E9=9A=9C=E7=A2=8D=E6=9C=8D=E5=8A=A1=E6=94=BB=E5=87=BB?= =?UTF-8?q?=E6=BC=8F=E6=B4=9E=20=E5=BC=80=E6=94=BEOpenSourceLibDependency?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=20=E8=AF=95=E5=9B=BE=E7=BC=A9=E5=87=8F?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A1=8C=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 4 ++-- app/src/main/AndroidManifest.xml | 2 ++ .../powerpanel/ui/main/MainActivity.kt | 24 +++++++------------ .../powerpanel/ui/main/PowerViewModel.kt | 5 +--- .../ui/tile/PowerDialogTileService.kt | 8 ++----- app/src/main/res/values-zh-rCN/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 7 files changed, 18 insertions(+), 29 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 923e203..e89df9e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,13 +13,13 @@ android { //targetSdkVersion compileSdkVersion targetSdkVersion 30 // 版本号:发布日期 - versionCode 20201103 + versionCode 20201104 /* 版本名说明: R3.0.0 Refactoring 第三次重构+功能更新+缺陷修复 */ - versionName "R3.3.3" + versionName "R3.3.4" resConfigs "en", "zh-rCN" // 致用户:可以在这里禁用Firebase,将以下值设为true final def disableFirebase = false diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e27a57a..1ee67cd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -28,6 +28,8 @@ val item = it[which] /* 如果为特权模式且不为锁屏,再次确认 */ @@ -99,10 +95,7 @@ class MainActivity : AppCompatActivity() { and (item.labelResId != R.string.func_lock_screen_privileged) ) { setTitle( - String.format( - getString(R.string.title_dialog_confirm_op), - item.label - ) + String.format(getString(R.string.title_dialog_confirm_op), item.label) ) // 再次确认 setAdapter(null, null) @@ -128,16 +121,14 @@ class MainActivity : AppCompatActivity() { } setNeutralButton(null, null) setPositiveButton(null, null) - show() + show().listView.rootView.hideFromAccessibilityService() } else { powerViewModel.call(item.labelResId) dialog.dismiss() } } if (powerViewModel.rootMode.value == true) { - setNeutralButton(R.string.btn_dialog_switch_mode) { _, _ -> - powerViewModel.reverseForceMode() - } + setNeutralButton(R.string.btn_dialog_switch_mode) { _, _ -> powerViewModel.reverseForceMode() } } setPositiveButton(R.string.btn_dialog_help) { _, _ -> /* --- 帮助界面逻辑 ---*/ @@ -153,7 +144,7 @@ class MainActivity : AppCompatActivity() { finish() } - setNeutralButton(getString(R.string.btn_dialog_open_source_lib_dependency)) { _, _ -> + setNeutralButton(getString(R.string.open_source_lib_dependency)) { _, _ -> this@MainActivity.startActivity( Intent(application, OpenSourceLibDependencyActivity::class.java) ) @@ -176,7 +167,10 @@ class MainActivity : AppCompatActivity() { //alertDialogMessageView.setTextIsSelectable(true) Toasty.normal( this@MainActivity, - "${BuildConfig.VERSION_NAME}\n${BuildConfig.VERSION_CODE}", + """ + ${BuildConfig.VERSION_NAME} + ${BuildConfig.VERSION_CODE} + """.trimIndent(), Toasty.LENGTH_LONG ).show() } diff --git a/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/main/PowerViewModel.kt b/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/main/PowerViewModel.kt index 5e11b07..2af2f98 100644 --- a/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/main/PowerViewModel.kt +++ b/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/main/PowerViewModel.kt @@ -187,10 +187,7 @@ class PowerViewModel : AndroidViewModel(MyApplication.getInstance()) { if (isOnForceMode(info)) { val range = 0..forceLabel.length forceLabel[range] = ForegroundColorSpan( - ResourcesCompat.getColor( - app().resources, - R.color.colorForceModeItem, null - ) + ResourcesCompat.getColor(app().resources, R.color.colorForceModeItem, null) ) forceLabel[range] = StyleSpan(Typeface.BOLD) } diff --git a/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/tile/PowerDialogTileService.kt b/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/tile/PowerDialogTileService.kt index cfed0d7..61f78f8 100644 --- a/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/tile/PowerDialogTileService.kt +++ b/app/src/main/java/github/ryuunoakaihitomi/powerpanel/ui/tile/PowerDialogTileService.kt @@ -21,9 +21,7 @@ class PowerDialogTileService : TileService() { Timber.w("locked!") qsTile?.run { updateState(Tile.STATE_UNAVAILABLE) - unlockAndRun { - updateState(Tile.STATE_ACTIVE) - } + unlockAndRun { updateState(Tile.STATE_ACTIVE) } } } else { /* 打开电源菜单 */ @@ -38,8 +36,6 @@ class PowerDialogTileService : TileService() { // 这是一个随时可用的磁贴,因此应该在可见时时刻保持“活跃状态”(对比突出图标),但在锁屏时没有使用的理由 override fun onStartListening() { - qsTile?.run { - if (!isLocked) updateState(Tile.STATE_ACTIVE) - } + qsTile?.run { if (!isLocked) updateState(Tile.STATE_ACTIVE) } } } \ No newline at end of file diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 56248cb..e9d06f4 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -22,5 +22,5 @@ 确认操作 “%s” 已经尝试添加快捷方式 反馈 - 开源库依赖项 + 开源库依赖项 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 041c52d..cb8ec4d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -23,5 +23,5 @@ Confirm operation \"%s\" Have tried to add shortcut Feedback - Open Source Library Dependency + Open Source Library Dependency \ No newline at end of file