For #7158: Fixes browser to search animation fade
parent
6df11619fd
commit
1f8f69548a
|
@ -89,6 +89,7 @@ class BrowserAnimator(
|
||||||
viewLifeCycleScope?.launch(Dispatchers.Main) {
|
viewLifeCycleScope?.launch(Dispatchers.Main) {
|
||||||
delay(ANIMATION_DELAY)
|
delay(ANIMATION_DELAY)
|
||||||
captureEngineViewAndDrawStatically {
|
captureEngineViewAndDrawStatically {
|
||||||
|
unwrappedSwipeRefresh?.alpha = 0f
|
||||||
browserZoomInValueAnimator.start()
|
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.
|
* Makes the swipeRefresh background a screenshot of the engineView in its current state.
|
||||||
* This allows us to "animate" the engineView.
|
* This allows us to "animate" the engineView.
|
||||||
|
@ -136,12 +125,13 @@ class BrowserAnimator(
|
||||||
if (!fragment.isAdded()) { return@captureThumbnail }
|
if (!fragment.isAdded()) { return@captureThumbnail }
|
||||||
|
|
||||||
unwrappedSwipeRefresh?.apply {
|
unwrappedSwipeRefresh?.apply {
|
||||||
alpha = 0f
|
|
||||||
// If the bitmap is null, the best we can do to reduce the flash is set transparent
|
// If the bitmap is null, the best we can do to reduce the flash is set transparent
|
||||||
background = bitmap?.toDrawable(context.resources)
|
background = bitmap?.toDrawable(context.resources)
|
||||||
?: ColorDrawable(Color.TRANSPARENT)
|
?: ColorDrawable(Color.TRANSPARENT)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unwrappedEngineView?.asView()?.visibility = View.GONE
|
||||||
|
|
||||||
onComplete()
|
onComplete()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue