[fenix] For https://github.com/mozilla-mobile/fenix/issues/4863 - Remove delay in HomeFragment onPreDraw

pull/600/head
Emily Kager 5 years ago committed by Emily Kager
parent bde36a6d45
commit 6527ff2fcd

@ -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…
Cancel
Save