From 00af888e0e69197ff0f3b0a19a89429521f84f49 Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Tue, 21 Jun 2022 06:37:15 +0800 Subject: [PATCH] Added batch operations in ConfigureActivity --- .../apperrorstracking/locale/LocaleString.kt | 12 ++++++++ .../ui/activity/main/ConfigureActivity.kt | 28 +++++++++++++++++++ app/src/main/res/drawable/ic_batch.xml | 9 ++++++ app/src/main/res/layout/activity_config.xml | 10 +++++++ app/src/main/res/layout/dia_app_config.xml | 3 +- app/src/main/res/values-ja/strings.xml | 4 ++- app/src/main/res/values-zh-rCN/strings.xml | 10 ++++--- app/src/main/res/values-zh-rHK/strings.xml | 10 ++++--- app/src/main/res/values-zh-rMO/strings.xml | 10 ++++--- app/src/main/res/values-zh-rTW/strings.xml | 10 ++++--- app/src/main/res/values/strings.xml | 4 ++- 11 files changed, 91 insertions(+), 19 deletions(-) create mode 100644 app/src/main/res/drawable/ic_batch.xml diff --git a/app/src/main/java/com/fankes/apperrorstracking/locale/LocaleString.kt b/app/src/main/java/com/fankes/apperrorstracking/locale/LocaleString.kt index 9454f72..f7ff684 100644 --- a/app/src/main/java/com/fankes/apperrorstracking/locale/LocaleString.kt +++ b/app/src/main/java/com/fankes/apperrorstracking/locale/LocaleString.kt @@ -430,4 +430,16 @@ object LocaleString { /** @string Automatic generated */ fun appErrorsTip(vararg objArrs: Any) = R.string.app_errors_tip.bind(*objArrs) + + /** @string Automatic generated */ + val batchOperations get() = batchOperations() + + /** @string Automatic generated */ + fun batchOperations(vararg objArrs: Any) = R.string.batch_operations.bind(*objArrs) + + /** @string Automatic generated */ + val areYouSureApplySiteApps get() = areYouSureApplySiteApps() + + /** @string Automatic generated */ + fun areYouSureApplySiteApps(vararg objArrs: Any) = R.string.are_you_sure_apply_site_apps.bind(*objArrs) } \ No newline at end of file diff --git a/app/src/main/java/com/fankes/apperrorstracking/ui/activity/main/ConfigureActivity.kt b/app/src/main/java/com/fankes/apperrorstracking/ui/activity/main/ConfigureActivity.kt index c0f0547..565a469 100644 --- a/app/src/main/java/com/fankes/apperrorstracking/ui/activity/main/ConfigureActivity.kt +++ b/app/src/main/java/com/fankes/apperrorstracking/ui/activity/main/ConfigureActivity.kt @@ -49,6 +49,32 @@ class ConfigureActivity : BaseActivity() { override fun onCreate() { binding.titleBackIcon.setOnClickListener { onBackPressed() } + binding.batchIcon.setOnClickListener { + showDialog { + title = LocaleString.batchOperations + confirmButton { + val config0 = binding.configRadio0.isChecked + val config1 = binding.configRadio1.isChecked + val config2 = binding.configRadio2.isChecked + val config3 = binding.configRadio3.isChecked + showDialog { + title = LocaleString.notice + msg = LocaleString.areYouSureApplySiteApps(listData.size) + confirmButton { + listData.takeIf { it.isNotEmpty() }?.forEach { + putAppShowErrorsDialog(it.packageName, config0) + putAppShowErrorsNotify(it.packageName, config1) + putAppShowErrorsToast(it.packageName, config2) + putAppShowNothing(it.packageName, config3) + } + onChanged?.invoke() + } + cancelButton() + } + } + cancelButton() + } + } binding.filterIcon.setOnClickListener { showDialog { title = LocaleString.filterByCondition @@ -128,6 +154,7 @@ class ConfigureActivity : BaseActivity() { /** 刷新列表数据 */ private fun refreshData() { binding.listProgressView.isVisible = true + binding.batchIcon.isVisible = false binding.filterIcon.isVisible = false binding.listView.isVisible = false binding.listNoDataView.isVisible = false @@ -143,6 +170,7 @@ class ConfigureActivity : BaseActivity() { onChanged?.invoke() binding.listView.post { binding.listView.setSelection(0) } binding.listProgressView.isVisible = false + binding.batchIcon.isVisible = listData.isNotEmpty() binding.filterIcon.isVisible = true binding.listView.isVisible = listData.isNotEmpty() binding.listNoDataView.isVisible = listData.isEmpty() diff --git a/app/src/main/res/drawable/ic_batch.xml b/app/src/main/res/drawable/ic_batch.xml new file mode 100644 index 0000000..5411b02 --- /dev/null +++ b/app/src/main/res/drawable/ic_batch.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/layout/activity_config.xml b/app/src/main/res/layout/activity_config.xml index e1c34ce..43d5783 100644 --- a/app/src/main/res/layout/activity_config.xml +++ b/app/src/main/res/layout/activity_config.xml @@ -57,6 +57,16 @@ android:textSize="11.5sp" /> + + + android:textSize="13sp" /> diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 80f7431..6de72c4 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -95,7 +95,7 @@ 条件をクリア %1$s の合計結果 ロード中 - エラーが現在適用されているときにシステムがエラーを表示する方法を構成できます。 + エラーが適用されているときにシステムがエラーを表示する方法を構成できます。 エラーダイアログを表示 エラー Toast を表示 何も表示されません @@ -111,4 +111,6 @@ モジュールは完全にアクティブ化されておらず、現在の設定アイテムをロードできない場合があります。システムをリスタートして試してみることをお勧めします。 エラー通知プッシュを表示 アプリは未処理のエラーで崩壊しました。クリックして、アプリ開発者への詳細またはフィードバックを表示します。 + 一括操作 + 一度に %1$s 個のアプリに設定を適用してもよろしいですか \ 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 fc89a12..8065cec 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -95,10 +95,10 @@ 清除条件 共 %1$s 个结果 加载中 - 你可以配置当前应用崩溃时系统将如何向你显示错误提示信息。 + 你可以配置当应用崩溃时系统将如何向你显示错误提示信息。 显示错误对话框 - 显示错误 Toast 提示 - 不显示任何提示 + 显示错误 Toast + 什么也不显示 应用异常统计 异常总数 应用总数 @@ -109,6 +109,8 @@ %1$s 个 (含系统应用) 正在生成统计数据 模块未完全激活,可能无法加载当前设置项,建议重新启动系统后重试。 - 显示错误通知推送 + 推送错误通知 应用发生了未处理的异常而崩溃,点击查看详情或反馈给应用开发者。 + 批量操作 + 你确定要一次性应用设置给 %1$s 个应用吗? \ No newline at end of file diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 651f02a..33507bf 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -95,10 +95,10 @@ 清除條件 共 %1$s 個結果 加載中 - 你可以配置當前程式崩潰時系統將如何向你展示錯誤提醒副案。 + 你可以配置當程式崩潰時系統將如何向你展示錯誤提醒副案。 顯示錯誤對話框 - 顯示錯誤 Toast 提示 - 不顯示任何提示 + 顯示錯誤 Toast + 什麼也不顯示 程式異常統計 異常總數 程式總數 @@ -109,6 +109,8 @@ %1$s 個 (含系統程式) 統計數據生成中 模組未完全激活,可能無法加載當前設定項,建議重新開機後重試。 - 顯示錯誤通知推送 + 推送錯誤通知 程式發生了未處理的異常而崩潰,點擊查看詳情或反饋給程式開發者。 + 批量操作 + 你確認要一次性應用設置給 %1$s 個程式嗎? \ No newline at end of file diff --git a/app/src/main/res/values-zh-rMO/strings.xml b/app/src/main/res/values-zh-rMO/strings.xml index d917ff8..99c9f8f 100644 --- a/app/src/main/res/values-zh-rMO/strings.xml +++ b/app/src/main/res/values-zh-rMO/strings.xml @@ -95,10 +95,10 @@ 清除條件 共 %1$s 個結果 加載中 - 你可以配置當前程式崩潰時系統將如何向你展示錯誤提醒副案。 + 你可以配置當程式崩潰時系統將如何向你展示錯誤提醒副案。 顯示錯誤對話框 - 顯示錯誤 Toast 提示 - 不顯示任何提示 + 顯示錯誤 Toast + 什麼也不顯示 程式異常統計 異常總數 程式總數 @@ -109,6 +109,8 @@ %1$s 個 (含系統程式) 統計數據生成中 模組未完全激活,可能無法加載當前設定項,建議重新開機後重試。 - 顯示錯誤通知推送 + 推送錯誤通知 程式發生了未處理的異常而崩潰,點擊查看詳情或反饋給程式開發者。 + 批量操作 + 你確認要一次性應用設置給 %1$s 個程式嗎? \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index e1b1fed..fcce2c5 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -95,10 +95,10 @@ 清除條件 共 %1$s 個結果 加載中 - 你可以配置當前程式崩潰時系統將如何向你展示錯誤提醒副案。 + 你可以配置當程式崩潰時系統將如何向你展示錯誤提醒副案。 顯示錯誤對話框 - 顯示錯誤 Toast 提示 - 不顯示任何提示 + 顯示錯誤 Toast + 什麼也不顯示 程式異常統計 異常總數 程式總數 @@ -109,6 +109,8 @@ %1$s 個 (含系統程式) 統計數據生成中 模組未完全激活,可能無法加載當前設定項,建議重新開機後重試。 - 顯示錯誤通知推送 + 推送錯誤通知 程式發生了未處理的異常而崩潰,點擊查看詳情或反饋給程式開發者。 + 批量操作 + 你確認要一次性應用設置給 %1$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 3b04c18..966a16f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -95,7 +95,7 @@ Clear filters %1$s results found Loading - You can configure how the system will show you errors when the current app crashes. + You can configure how the system will show you errors when the apps crashes. Show errors dialog Show errors Toast Don\'t show anything @@ -111,4 +111,6 @@ The module is not fully activated and may not be able to load the current settings item. It is recommended to re -start the system and try it out. Show errors notification App collapses an unprocessed abnormality. Click to view details or feedback to the App developer. + Batch operations + Are you sure you want to apply settings to %1$s apps at once? \ No newline at end of file