diff --git a/CHANGELOG.md b/CHANGELOG.md index e7e753d5a..8d6e94ecb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ [Migration Guides](https://github.com/urbanairship/android-library/tree/main/documentation/migration) +## Version 18.1.4, July 31, 2024 +Patch release that includes bug fixes for Embedded Content. + +### Changes +- Fixed an issue with dismissing Embedded Content after pausing and resuming the app. +- Updated the default `PreferenceCenterFragment` to scope the `PreferenceCenterViewModel` to the fragment's view lifecycle. + ## Version 18.1.3, July 30, 2024 Patch release that includes bug fixes for Embedded Content and Preference Center, and accessibility improvements for Message Center. diff --git a/build.gradle b/build.gradle index 1f9767fa3..b86672449 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ buildscript { ext { // Airship Version - major.minor.patch - airshipVersion = '18.1.3' + airshipVersion = '18.1.4' // Airship Version Qualifier beta, release, etc... // airshipVersionQualifier = "alpha" diff --git a/urbanairship-layout/src/main/java/com/urbanairship/android/layout/model/PagerModel.kt b/urbanairship-layout/src/main/java/com/urbanairship/android/layout/model/PagerModel.kt index b36162874..7967a07d7 100644 --- a/urbanairship-layout/src/main/java/com/urbanairship/android/layout/model/PagerModel.kt +++ b/urbanairship-layout/src/main/java/com/urbanairship/android/layout/model/PagerModel.kt @@ -403,7 +403,10 @@ internal class PagerModel( } private fun resumeStory() { - UALog.v { "resume story" } + if (automatedActionsTimers.isNotEmpty()) { + UALog.v { "resume story" } + } + navigationActionTimer?.start() for (timer in automatedActionsTimers) { timer.start() diff --git a/urbanairship-preference-center/src/main/java/com/urbanairship/preferencecenter/ui/PreferenceCenterFragment.kt b/urbanairship-preference-center/src/main/java/com/urbanairship/preferencecenter/ui/PreferenceCenterFragment.kt index ed33d8b26..b91e1a29b 100644 --- a/urbanairship-preference-center/src/main/java/com/urbanairship/preferencecenter/ui/PreferenceCenterFragment.kt +++ b/urbanairship-preference-center/src/main/java/com/urbanairship/preferencecenter/ui/PreferenceCenterFragment.kt @@ -10,6 +10,8 @@ import android.widget.TextView import androidx.annotation.VisibleForTesting import androidx.fragment.app.Fragment import androidx.fragment.app.activityViewModels +import androidx.fragment.app.viewModels +import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.lifecycleScope import androidx.lifecycle.viewModelScope import androidx.recyclerview.widget.LinearLayoutManager @@ -78,8 +80,14 @@ public class PreferenceCenterFragment : Fragment(R.layout.ua_fragment_preference requireNotNull(arguments?.getString(ARG_ID)) { "Missing required argument: PreferenceCenterFragment.ARG_ID" } } - private val viewModel: PreferenceCenterViewModel by activityViewModels { - PreferenceCenterViewModel.factory(preferenceCenterId) + private val viewModel by lazy { + ViewModelProvider( + owner = this, // Scope the ViewModel to the Fragment's lifecycle. + factory = PreferenceCenterViewModel.factory(preferenceCenterId) + ).get( + key = preferenceCenterId, // Ensure we create a unique VM per pref center ID. + modelClass = PreferenceCenterViewModel::class.java + ) } @VisibleForTesting