|
|
|
@ -33,7 +33,8 @@ class BrowserAnimator(
|
|
|
|
|
private val engineView: WeakReference<EngineView>,
|
|
|
|
|
private val swipeRefresh: WeakReference<View>,
|
|
|
|
|
private val viewLifecycleScope: LifecycleCoroutineScope,
|
|
|
|
|
private val arguments: Bundle
|
|
|
|
|
private val arguments: Bundle,
|
|
|
|
|
private val firstContentfulHappened: () -> Boolean
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
private val unwrappedEngineView: EngineView?
|
|
|
|
@ -52,22 +53,9 @@ class BrowserAnimator(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
doOnEnd {
|
|
|
|
|
unwrappedEngineView?.asView()?.visibility = View.VISIBLE
|
|
|
|
|
unwrappedSwipeRefresh?.background = null
|
|
|
|
|
arguments.putBoolean(SHOULD_ANIMATE_FLAG, false)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interpolator = DecelerateInterpolator()
|
|
|
|
|
duration = ANIMATION_DURATION
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private val browserFadeInValueAnimator = ValueAnimator.ofFloat(0f, END_ANIMATOR_VALUE).apply {
|
|
|
|
|
addUpdateListener {
|
|
|
|
|
unwrappedSwipeRefresh?.alpha = it.animatedFraction
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
doOnEnd {
|
|
|
|
|
unwrappedEngineView?.asView()?.visibility = View.VISIBLE
|
|
|
|
|
if (firstContentfulHappened()) {
|
|
|
|
|
unwrappedEngineView?.asView()?.visibility = View.VISIBLE
|
|
|
|
|
}
|
|
|
|
|
unwrappedSwipeRefresh?.background = null
|
|
|
|
|
arguments.putBoolean(SHOULD_ANIMATE_FLAG, false)
|
|
|
|
|
}
|
|
|
|
@ -92,7 +80,9 @@ class BrowserAnimator(
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
unwrappedSwipeRefresh?.alpha = 1f
|
|
|
|
|
unwrappedEngineView?.asView()?.visibility = View.VISIBLE
|
|
|
|
|
if (firstContentfulHappened()) {
|
|
|
|
|
unwrappedEngineView?.asView()?.visibility = View.VISIBLE
|
|
|
|
|
}
|
|
|
|
|
unwrappedSwipeRefresh?.background = null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|