From 1f8f69548ab7a7e68faec28fd61436287f0af037 Mon Sep 17 00:00:00 2001 From: Sawyer Blatz Date: Thu, 16 Apr 2020 13:31:37 -0700 Subject: [PATCH] For #7158: Fixes browser to search animation fade --- .../org/mozilla/fenix/browser/BrowserAnimator.kt | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/browser/BrowserAnimator.kt b/app/src/main/java/org/mozilla/fenix/browser/BrowserAnimator.kt index 53ae63804..e5897d774 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BrowserAnimator.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BrowserAnimator.kt @@ -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() } }