mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-16 20:10:04 +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.chooseServerSubmit.debouncedClicks { updateServerUrl() }
|
||||||
views.chooseServerInput.editText().textChanges()
|
views.chooseServerInput.editText().textChanges()
|
||||||
.onEach { views.chooseServerInput.error = null }
|
.onEach { views.chooseServerInput.error = null }
|
||||||
.launchIn(lifecycleScope)
|
.launchIn(viewLifecycleOwner.lifecycleScope)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateServerUrl() {
|
private fun updateServerUrl() {
|
||||||
|
|
|
@ -57,7 +57,7 @@ class FtueAuthEmailEntryFragment @Inject constructor() : AbstractFtueAuthFragmen
|
||||||
views.emailEntryInput.error = null
|
views.emailEntryInput.error = null
|
||||||
views.emailEntrySubmit.isEnabled = it.isEmail()
|
views.emailEntrySubmit.isEnabled = it.isEmail()
|
||||||
}
|
}
|
||||||
.launchIn(lifecycleScope)
|
.launchIn(viewLifecycleOwner.lifecycleScope)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateEmail() {
|
private fun updateEmail() {
|
||||||
|
|
|
@ -109,7 +109,7 @@ class FtueAuthSplashCarouselFragment @Inject constructor(
|
||||||
|
|
||||||
private fun ViewPager2.scheduleCarouselTransition(): Job {
|
private fun ViewPager2.scheduleCarouselTransition(): Job {
|
||||||
val itemCount = adapter?.itemCount ?: throw IllegalStateException("An adapter must be set")
|
val itemCount = adapter?.itemCount ?: throw IllegalStateException("An adapter must be set")
|
||||||
return lifecycleScope.launch {
|
return viewLifecycleOwner.lifecycleScope.launch {
|
||||||
delay(CAROUSEL_ROTATION_DELAY_MS)
|
delay(CAROUSEL_ROTATION_DELAY_MS)
|
||||||
setCurrentItem(currentItem.incrementByOneAndWrap(max = itemCount - 1), duration = CAROUSEL_TRANSITION_TIME_MS)
|
setCurrentItem(currentItem.incrementByOneAndWrap(max = itemCount - 1), duration = CAROUSEL_TRANSITION_TIME_MS)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue