From 0c98121c2aa844f1aff8d438193f9afc1849d110 Mon Sep 17 00:00:00 2001 From: septs Date: Mon, 8 Sep 2025 15:11:40 +0200 Subject: [PATCH 1/2] chore: ignore new file in dot-idea directory (#227) ![CleanShot 2025-09-08 at 15.51.35@2x](/attachments/8133796b-eebf-4162-b6c4-f66d9217b48d) Reviewed-on: https://gitea.angry.im/PeterCxy/OpenEUICC/pulls/227 Co-authored-by: septs Co-committed-by: septs --- .idea/.gitignore | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.idea/.gitignore b/.idea/.gitignore index 2e12995..d2293f6 100644 --- a/.idea/.gitignore +++ b/.idea/.gitignore @@ -1,14 +1,7 @@ -/shelf -/caches -/libraries -/assetWizardSettings.xml -/deploymentTarget*.xml -/gradle.xml -/misc.xml -/modules.xml -/navEditor.xml -/runConfigurations.xml -/workspace.xml -/AndroidProjectSystem.xml - -**/*.iml \ No newline at end of file +* +!/codeStyles/Project.xml +!/codeStyles/codeStyleConfig.xml +!/vcs.xml +!/kotlinc.xml +!/compiler.xml +!/migrations.xml From 472f9d05ac5470a28bb80fee725eb87711905ca6 Mon Sep 17 00:00:00 2001 From: septs Date: Mon, 8 Sep 2025 15:12:26 +0200 Subject: [PATCH 2/2] chore: simplify progress item initialization and error message handling (#226) Reviewed-on: https://gitea.angry.im/PeterCxy/OpenEUICC/pulls/226 Co-authored-by: septs Co-committed-by: septs --- .../wizard/DownloadWizardProgressFragment.kt | 53 ++++++------------- 1 file changed, 16 insertions(+), 37 deletions(-) diff --git a/app-common/src/main/java/im/angry/openeuicc/ui/wizard/DownloadWizardProgressFragment.kt b/app-common/src/main/java/im/angry/openeuicc/ui/wizard/DownloadWizardProgressFragment.kt index 29e87b0..0048190 100644 --- a/app-common/src/main/java/im/angry/openeuicc/ui/wizard/DownloadWizardProgressFragment.kt +++ b/app-common/src/main/java/im/angry/openeuicc/ui/wizard/DownloadWizardProgressFragment.kt @@ -7,6 +7,7 @@ import android.view.ViewGroup import android.widget.ImageView import android.widget.ProgressBar import android.widget.TextView +import androidx.annotation.StringRes import androidx.lifecycle.lifecycleScope import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager @@ -42,37 +43,17 @@ class DownloadWizardProgressFragment : DownloadWizardActivity.DownloadWizardStep } private data class ProgressItem( - val titleRes: Int, - var state: ProgressState, - var errorMessage: SimplifiedErrorMessages?, + @StringRes val titleRes: Int, + var state: ProgressState = ProgressState.NotStarted, + var errorMessage: SimplifiedErrorMessages? = null, ) private val progressItems = arrayOf( - ProgressItem( - R.string.download_wizard_progress_step_preparing, - ProgressState.NotStarted, - null - ), - ProgressItem( - R.string.download_wizard_progress_step_connecting, - ProgressState.NotStarted, - null - ), - ProgressItem( - R.string.download_wizard_progress_step_authenticating, - ProgressState.NotStarted, - null - ), - ProgressItem( - R.string.download_wizard_progress_step_downloading, - ProgressState.NotStarted, - null - ), - ProgressItem( - R.string.download_wizard_progress_step_finalizing, - ProgressState.NotStarted, - null - ) + ProgressItem(R.string.download_wizard_progress_step_preparing), + ProgressItem(R.string.download_wizard_progress_step_connecting), + ProgressItem(R.string.download_wizard_progress_step_authenticating), + ProgressItem(R.string.download_wizard_progress_step_downloading), + ProgressItem(R.string.download_wizard_progress_step_finalizing) ) private val adapter = ProgressItemAdapter() @@ -156,9 +137,8 @@ class DownloadWizardProgressFragment : DownloadWizardActivity.DownloadWizardStep refreshButtons() } - is EuiccChannelManagerService.ForegroundTaskState.InProgress -> { + is EuiccChannelManagerService.ForegroundTaskState.InProgress -> updateProgress(it.progress) - } else -> {} } @@ -252,14 +232,13 @@ class DownloadWizardProgressFragment : DownloadWizardActivity.DownloadWizardStep icon.setImageResource(R.drawable.ic_error_outline) icon.visibility = View.VISIBLE - if (item.errorMessage != null) { + item.errorMessage?.titleResId?.let { errorTitle.visibility = View.VISIBLE - errorTitle.text = getString(item.errorMessage!!.titleResId) - - if (item.errorMessage!!.suggestResId != null) { - errorSuggestion.visibility = View.VISIBLE - errorSuggestion.text = getString(item.errorMessage!!.suggestResId!!) - } + errorTitle.text = getString(it) + } + item.errorMessage?.suggestResId?.let { + errorSuggestion.visibility = View.VISIBLE + errorSuggestion.text = getString(it) } } }