ekager 5 years ago committed by Emily Kager
parent 11054b82b2
commit db03554fe8

@ -265,7 +265,7 @@ class BrowserFragment : Fragment(), BackHandler, CoroutineScope {
findInPageIntegration.set( findInPageIntegration.set(
feature = FindInPageIntegration( feature = FindInPageIntegration(
requireComponents.core.sessionManager, view.findInPageView, view.engineView requireComponents.core.sessionManager, view.findInPageView, view.engineView, toolbar
), ),
owner = this, owner = this,
view = view view = view

@ -22,7 +22,8 @@ import org.mozilla.fenix.test.Mockable
class FindInPageIntegration( class FindInPageIntegration(
private val sessionManager: SessionManager, private val sessionManager: SessionManager,
private val view: FindInPageView, private val view: FindInPageView,
engineView: EngineView engineView: EngineView,
private val toolbar: BrowserToolbar
) : LifecycleAwareFeature, BackHandler { ) : LifecycleAwareFeature, BackHandler {
private val feature = FindInPageFeature(sessionManager, view, engineView, ::onClose) private val feature = FindInPageFeature(sessionManager, view, engineView, ::onClose)
@ -43,12 +44,14 @@ class FindInPageIntegration(
} }
private fun onClose() { private fun onClose() {
toolbar.visibility = View.VISIBLE
view.asView().visibility = View.GONE view.asView().visibility = View.GONE
} }
private fun launch() { private fun launch() {
val session = sessionManager.selectedSession ?: return val session = sessionManager.selectedSession ?: return
toolbar.visibility = View.GONE
view.asView().visibility = View.VISIBLE view.asView().visibility = View.VISIBLE
feature.bind(session) feature.bind(session)
} }

@ -41,7 +41,6 @@
android:clickable="true" android:clickable="true"
android:visibility="gone" android:visibility="gone"
app:findInPageNoMatchesTextColor="?attr/destructive" app:findInPageNoMatchesTextColor="?attr/destructive"
app:layout_behavior="org.mozilla.fenix.components.FindInPageBarBehavior"
mozac:findInPageButtonsTint="?primaryText" mozac:findInPageButtonsTint="?primaryText"
mozac:findInPageResultCountTextColor="?primaryText" /> mozac:findInPageResultCountTextColor="?primaryText" />

Loading…
Cancel
Save