using correct views instances - fixes missing loading

This commit is contained in:
Adam Brown 2021-12-09 15:16:43 +00:00
parent d5373545f0
commit 768419b11a
2 changed files with 8 additions and 6 deletions

View file

@ -34,7 +34,7 @@ import javax.inject.Inject
class OnboardingActivity : VectorBaseActivity<ActivityLoginBinding>(), ToolbarConfigurable, UnlockedActivity {
private val onboardingVariant by lifecycleAwareLazy {
onboardingVariantFactory.create(this, onboardingViewModel = lazyViewModel(), loginViewModel2 = lazyViewModel())
onboardingVariantFactory.create(this, views = views, onboardingViewModel = lazyViewModel(), loginViewModel2 = lazyViewModel())
}
@Inject lateinit var onboardingVariantFactory: OnboardingVariantFactory

View file

@ -16,6 +16,7 @@
package im.vector.app.features.onboarding
import im.vector.app.databinding.ActivityLoginBinding
import im.vector.app.features.VectorFeatures
import im.vector.app.features.login2.LoginViewModel2
import im.vector.app.features.onboarding.ftueauth.FtueAuthVariant
@ -26,18 +27,19 @@ class OnboardingVariantFactory @Inject constructor(
) {
fun create(activity: OnboardingActivity,
views: ActivityLoginBinding,
onboardingViewModel: Lazy<OnboardingViewModel>,
loginViewModel2: Lazy<LoginViewModel2>
) = when (vectorFeatures.onboardingVariant()) {
VectorFeatures.OnboardingVariant.LEGACY -> error("Legacy is not supported by the FTUE")
VectorFeatures.OnboardingVariant.FTUE_AUTH -> FtueAuthVariant(
views = activity.getBinding(),
VectorFeatures.OnboardingVariant.LEGACY -> error("Legacy is not supported by the FTUE")
VectorFeatures.OnboardingVariant.FTUE_AUTH -> FtueAuthVariant(
views = views,
onboardingViewModel = onboardingViewModel.value,
activity = activity,
supportFragmentManager = activity.supportFragmentManager
)
VectorFeatures.OnboardingVariant.LOGIN_2 -> Login2Variant(
views = activity.getBinding(),
VectorFeatures.OnboardingVariant.LOGIN_2 -> Login2Variant(
views = views,
loginViewModel = loginViewModel2.value,
activity = activity,
supportFragmentManager = activity.supportFragmentManager