2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/7158: Fixes browser to search animation fade

This commit is contained in:
Sawyer Blatz 2020-04-16 13:31:37 -07:00 committed by Emily Kager
parent 053f2017e6
commit fba1e732ef

View File

@ -89,6 +89,7 @@ class BrowserAnimator(
viewLifeCycleScope?.launch(Dispatchers.Main) {
delay(ANIMATION_DELAY)
captureEngineViewAndDrawStatically {
unwrappedSwipeRefresh?.alpha = 0f
browserZoomInValueAnimator.start()
}
}
@ -111,18 +112,6 @@ class BrowserAnimator(
}
}
/**
* Triggers the *fade out* browser animation to run.
*/
fun beginFadeOut() {
viewLifeCycleScope?.launch(Dispatchers.Main) {
captureEngineViewAndDrawStatically {
unwrappedEngineView?.asView()?.visibility = View.GONE
browserFadeInValueAnimator.reverse()
}
}
}
/**
* Makes the swipeRefresh background a screenshot of the engineView in its current state.
* This allows us to "animate" the engineView.
@ -136,12 +125,13 @@ class BrowserAnimator(
if (!fragment.isAdded()) { return@captureThumbnail }
unwrappedSwipeRefresh?.apply {
alpha = 0f
// If the bitmap is null, the best we can do to reduce the flash is set transparent
background = bitmap?.toDrawable(context.resources)
?: ColorDrawable(Color.TRANSPARENT)
}
unwrappedEngineView?.asView()?.visibility = View.GONE
onComplete()
}
}