diff --git a/WordPress/src/main/java/org/wordpress/android/ui/sitecreation/previews/SiteCreationPreviewFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/sitecreation/previews/SiteCreationPreviewFragment.kt index 9e50a071efba..e135c6ac0ee7 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/sitecreation/previews/SiteCreationPreviewFragment.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/sitecreation/previews/SiteCreationPreviewFragment.kt @@ -235,7 +235,6 @@ class SiteCreationPreviewFragment : SiteCreationBaseFormFragment(), private fun updateLoadingTextWithFadeAnimation(newText: String) { val animationDuration = AniUtils.Duration.SHORT - val animations = ArrayList() val fadeOut = AniUtils.getFadeOutAnim(loadingTextLayout, animationDuration, View.VISIBLE) val fadeIn = AniUtils.getFadeInAnim(loadingTextLayout, animationDuration) @@ -254,11 +253,10 @@ class SiteCreationPreviewFragment : SiteCreationBaseFormFragment(), // Start the fadein animation right after the view fades out fadeIn.startDelay = animationDuration.toMillis(loadingTextLayout.context) - val animatorSet = AnimatorSet() - animations.add(fadeOut) - animations.add(fadeIn) - animatorSet.playSequentially(animations) - animatorSet.start() + AnimatorSet().apply { + playSequentially(fadeOut, fadeIn) + start() + } } private fun updateErrorLayout(errorUiStateState: SitePreviewFullscreenErrorUiState) {