From 343ae1d90bfeb580c56f0221c4525cf907354aec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Oct 2025 16:33:45 +0000 Subject: [PATCH 1/2] Initial plan From d3c6eaf531495ac444c87daaef1067be5fc72d6b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Oct 2025 16:42:25 +0000 Subject: [PATCH 2/2] Refactor parcelable extensions to use BundleCompat and IntentCompat Co-authored-by: hoc081098 <36917223+hoc081098@users.noreply.github.com> --- .../com/hoc/flowmvi/core_ui/parcelable.kt | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/core-ui/src/main/java/com/hoc/flowmvi/core_ui/parcelable.kt b/core-ui/src/main/java/com/hoc/flowmvi/core_ui/parcelable.kt index 0e8e3d88..3988a011 100644 --- a/core-ui/src/main/java/com/hoc/flowmvi/core_ui/parcelable.kt +++ b/core-ui/src/main/java/com/hoc/flowmvi/core_ui/parcelable.kt @@ -1,30 +1,23 @@ package com.hoc.flowmvi.core_ui import android.content.Intent -import android.os.Build import android.os.Bundle import android.os.Parcelable +import androidx.core.content.IntentCompat +import androidx.core.os.BundleCompat /** - * https://stackoverflow.com/a/73311814/11191424 + * Wrapper around [IntentCompat.getParcelableExtra] for type-safe parcelable retrieval. + * + * @see IntentCompat.getParcelableExtra */ inline fun Intent.parcelable(key: String): T? = - // TODO: Use `>`, because https://issuetracker.google.com/issues/240585930#comment6 - if (Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU) { - getParcelableExtra(key, T::class.java) - } else { - @Suppress("DEPRECATION") - getParcelableExtra(key) - } + IntentCompat.getParcelableExtra(this, key, T::class.java) /** - * https://stackoverflow.com/a/73311814/11191424 + * Wrapper around [BundleCompat.getParcelable] for type-safe parcelable retrieval. + * + * @see BundleCompat.getParcelable */ inline fun Bundle.parcelable(key: String): T? = - // TODO: Use `>`, because https://issuetracker.google.com/issues/240585930#comment6 - if (Build.VERSION.SDK_INT > Build.VERSION_CODES.TIRAMISU) { - getParcelable(key, T::class.java) - } else { - @Suppress("DEPRECATION") - getParcelable(key) - } + BundleCompat.getParcelable(this, key, T::class.java)