mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-25 10:55:55 +03:00
showing loading spinner when returning to the email verification waiting screen
This commit is contained in:
parent
02b6916487
commit
4964c9f151
1 changed files with 16 additions and 4 deletions
|
@ -21,6 +21,7 @@ import android.os.Parcelable
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.isVisible
|
||||
import com.airbnb.mvrx.args
|
||||
import im.vector.app.R
|
||||
import im.vector.app.databinding.FragmentFtueWaitForEmailVerificationBinding
|
||||
|
@ -41,6 +42,7 @@ data class FtueAuthWaitForEmailFragmentArgument(
|
|||
class FtueAuthWaitForEmailFragment @Inject constructor() : AbstractFtueAuthFragment<FragmentFtueWaitForEmailVerificationBinding>() {
|
||||
|
||||
private val params: FtueAuthWaitForEmailFragmentArgument by args()
|
||||
private var inferHasLeftAndReturnedToScreen = false
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueWaitForEmailVerificationBinding {
|
||||
return FragmentFtueWaitForEmailVerificationBinding.inflate(inflater, container, false)
|
||||
|
@ -51,20 +53,30 @@ class FtueAuthWaitForEmailFragment @Inject constructor() : AbstractFtueAuthFragm
|
|||
setupUi()
|
||||
}
|
||||
|
||||
private fun setupUi() {
|
||||
views.accountCreatedSubtitle.text = getString(R.string.ftue_auth_email_verification_subtitle, params.email)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
showLoadingIfReturningToScreen()
|
||||
viewModel.handle(OnboardingAction.PostRegisterAction(RegisterAction.CheckIfEmailHasBeenValidated(0)))
|
||||
}
|
||||
|
||||
private fun showLoadingIfReturningToScreen() {
|
||||
when (inferHasLeftAndReturnedToScreen){
|
||||
true -> views.accountCreatedWaiting.isVisible = true
|
||||
false -> {
|
||||
inferHasLeftAndReturnedToScreen = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
viewModel.handle(OnboardingAction.StopEmailValidationCheck)
|
||||
}
|
||||
|
||||
private fun setupUi() {
|
||||
views.accountCreatedSubtitle.text = getString(R.string.ftue_auth_email_verification_subtitle, params.email)
|
||||
}
|
||||
|
||||
override fun resetViewModel() {
|
||||
viewModel.handle(OnboardingAction.ResetAuthenticationAttempt)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue