1
0
Fork 0

For #2223 , For #371 - Replace Toolbar with FIP when opened

master
ekager 2019-05-31 17:08:01 -07:00 committed by Emily Kager
parent 388581f76f
commit 98a40aabd7
3 changed files with 5 additions and 3 deletions

View File

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

View File

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

View File

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