mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-25 19:05:56 +03:00
making use of the view lifecycle scope for the view based fragment logic
This commit is contained in:
parent
c0efd9f1af
commit
8136f57b5e
3 changed files with 3 additions and 3 deletions
|
@ -68,7 +68,7 @@ class FtueAuthCombinedServerSelectionFragment @Inject constructor() : AbstractFt
|
|||
views.chooseServerSubmit.debouncedClicks { updateServerUrl() }
|
||||
views.chooseServerInput.editText().textChanges()
|
||||
.onEach { views.chooseServerInput.error = null }
|
||||
.launchIn(lifecycleScope)
|
||||
.launchIn(viewLifecycleOwner.lifecycleScope)
|
||||
}
|
||||
|
||||
private fun updateServerUrl() {
|
||||
|
|
|
@ -57,7 +57,7 @@ class FtueAuthEmailEntryFragment @Inject constructor() : AbstractFtueAuthFragmen
|
|||
views.emailEntryInput.error = null
|
||||
views.emailEntrySubmit.isEnabled = it.isEmail()
|
||||
}
|
||||
.launchIn(lifecycleScope)
|
||||
.launchIn(viewLifecycleOwner.lifecycleScope)
|
||||
}
|
||||
|
||||
private fun updateEmail() {
|
||||
|
|
|
@ -109,7 +109,7 @@ class FtueAuthSplashCarouselFragment @Inject constructor(
|
|||
|
||||
private fun ViewPager2.scheduleCarouselTransition(): Job {
|
||||
val itemCount = adapter?.itemCount ?: throw IllegalStateException("An adapter must be set")
|
||||
return lifecycleScope.launch {
|
||||
return viewLifecycleOwner.lifecycleScope.launch {
|
||||
delay(CAROUSEL_ROTATION_DELAY_MS)
|
||||
setCurrentItem(currentItem.incrementByOneAndWrap(max = itemCount - 1), duration = CAROUSEL_TRANSITION_TIME_MS)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue