always showing the celebration confetti on account creation

- previously we would wait until after personalisation but we don't know if users will go through that flow
This commit is contained in:
Adam Brown 2022-06-13 08:52:57 +01:00
parent 88d2853a31
commit fca06bd167
3 changed files with 1 additions and 18 deletions

View File

@ -58,7 +58,7 @@ class FtueAuthAccountCreatedFragment @Inject constructor(
views.personalizeButtonGroup.isVisible = canPersonalize views.personalizeButtonGroup.isVisible = canPersonalize
views.takeMeHomeButtonGroup.isVisible = !canPersonalize views.takeMeHomeButtonGroup.isVisible = !canPersonalize
if (!hasPlayedConfetti && !canPersonalize && requireContext().isAnimationEnabled()) { if (!hasPlayedConfetti && requireContext().isAnimationEnabled()) {
hasPlayedConfetti = true hasPlayedConfetti = true
views.viewKonfetti.isVisible = true views.viewKonfetti.isVisible = true
views.viewKonfetti.play() views.viewKonfetti.play()

View File

@ -20,9 +20,6 @@ import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.core.view.isVisible
import im.vector.app.core.animations.play
import im.vector.app.core.utils.isAnimationEnabled
import im.vector.app.databinding.FragmentFtuePersonalizationCompleteBinding import im.vector.app.databinding.FragmentFtuePersonalizationCompleteBinding
import im.vector.app.features.onboarding.OnboardingAction import im.vector.app.features.onboarding.OnboardingAction
import im.vector.app.features.onboarding.OnboardingViewEvents import im.vector.app.features.onboarding.OnboardingViewEvents
@ -30,8 +27,6 @@ import javax.inject.Inject
class FtueAuthPersonalizationCompleteFragment @Inject constructor() : AbstractFtueAuthFragment<FragmentFtuePersonalizationCompleteBinding>() { class FtueAuthPersonalizationCompleteFragment @Inject constructor() : AbstractFtueAuthFragment<FragmentFtuePersonalizationCompleteBinding>() {
private var hasPlayedConfetti = false
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtuePersonalizationCompleteBinding { override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtuePersonalizationCompleteBinding {
return FragmentFtuePersonalizationCompleteBinding.inflate(inflater, container, false) return FragmentFtuePersonalizationCompleteBinding.inflate(inflater, container, false)
} }
@ -43,12 +38,6 @@ class FtueAuthPersonalizationCompleteFragment @Inject constructor() : AbstractFt
private fun setupViews() { private fun setupViews() {
views.personalizationCompleteCta.debouncedClicks { viewModel.handle(OnboardingAction.PostViewEvent(OnboardingViewEvents.OnTakeMeHome)) } views.personalizationCompleteCta.debouncedClicks { viewModel.handle(OnboardingAction.PostViewEvent(OnboardingViewEvents.OnTakeMeHome)) }
if (!hasPlayedConfetti && requireContext().isAnimationEnabled()) {
hasPlayedConfetti = true
views.viewKonfetti.isVisible = true
views.viewKonfetti.play()
}
} }
override fun resetViewModel() { override fun resetViewModel() {

View File

@ -106,10 +106,4 @@
app:layout_constraintHeight_percent="0.05" app:layout_constraintHeight_percent="0.05"
app:layout_constraintTop_toBottomOf="@id/personalizationCompleteCta" /> app:layout_constraintTop_toBottomOf="@id/personalizationCompleteCta" />
<im.vector.app.core.ui.views.CompatKonfetti
android:id="@+id/viewKonfetti"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>