Skip to content

Commit

Permalink
[AN/USER] fix: 예매 완료 화면 버그 픽스 (#575) (#576)
Browse files Browse the repository at this point in the history
* fix: getParcelableExtraCompat

* update: 버전 변경
  • Loading branch information
EmilyCh0 authored Oct 19, 2023
1 parent b3987db commit cab4bb9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions android/festago/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ android {
applicationId = "com.festago.festago"
minSdk = 28
targetSdk = 34
versionCode = 5
versionName = "1.1.1"
versionCode = 6
versionName = "1.1.2"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.os.Parcelable
import androidx.core.os.BundleCompat

@Suppress("DEPRECATION")
inline fun <reified T : Parcelable> Bundle.getParcelableCompat(key: String): T? {
Expand All @@ -23,11 +24,11 @@ inline fun <reified T : Parcelable> Bundle.getParcelableArrayListCompat(key: Str
}
}

@Suppress("DEPRECATION")
inline fun <reified T : Parcelable> Intent.getParcelableExtraCompat(key: String): T? {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
getParcelableExtra(key, T::class.java)
} else {
getParcelableExtra(key) as? T
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
val bundle = extras ?: return null
return BundleCompat.getParcelable(bundle, key, T::class.java)
}
@Suppress("DEPRECATION")
return getParcelableExtra(key) as? T
}

0 comments on commit cab4bb9

Please sign in to comment.