For #4863 - Remove delay in HomeFragment onPreDraw
This commit is contained in:
parent
66a8c04967
commit
7b5ed2673b
|
@ -7,7 +7,6 @@ package org.mozilla.fenix.utils
|
|||
import androidx.core.view.doOnPreDraw
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
/**
|
||||
|
@ -23,14 +22,9 @@ class FragmentPreDrawManager(
|
|||
fun execute(code: () -> Unit) {
|
||||
fragment.view?.doOnPreDraw {
|
||||
fragment.viewLifecycleOwner.lifecycleScope.launch {
|
||||
delay(ANIM_SCROLL_DELAY)
|
||||
code()
|
||||
fragment.startPostponedEnterTransition()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val ANIM_SCROLL_DELAY = 100L
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user