mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-14 02:35:47 +01:00
Fixing missing clear on TabLayoutMediator when view is destroyed
This commit is contained in:
parent
5daf82a32a
commit
b2e64e6265
@ -51,6 +51,8 @@ class FtueAuthSplashCarouselFragment @Inject constructor(
|
||||
private val carouselStateFactory: SplashCarouselStateFactory
|
||||
) : AbstractFtueAuthFragment<FragmentFtueSplashCarouselBinding>() {
|
||||
|
||||
private var tabLayoutMediator: TabLayoutMediator? = null
|
||||
|
||||
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentFtueSplashCarouselBinding {
|
||||
return FragmentFtueSplashCarouselBinding.inflate(inflater, container, false)
|
||||
}
|
||||
@ -60,10 +62,19 @@ class FtueAuthSplashCarouselFragment @Inject constructor(
|
||||
setupViews()
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
tabLayoutMediator?.detach()
|
||||
tabLayoutMediator = null
|
||||
views.splashCarousel.adapter = null
|
||||
super.onDestroyView()
|
||||
}
|
||||
|
||||
private fun setupViews() {
|
||||
val carouselAdapter = carouselController.adapter
|
||||
views.splashCarousel.adapter = carouselAdapter
|
||||
TabLayoutMediator(views.carouselIndicator, views.splashCarousel) { _, _ -> }.attach()
|
||||
tabLayoutMediator = TabLayoutMediator(views.carouselIndicator, views.splashCarousel) { _, _ -> }
|
||||
.also { it.attach() }
|
||||
|
||||
carouselController.setData(carouselStateFactory.create())
|
||||
|
||||
val isAlreadyHaveAccountEnabled = vectorFeatures.isOnboardingAlreadyHaveAccountSplashEnabled()
|
||||
|
Loading…
Reference in New Issue
Block a user