2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00
This commit is contained in:
Sawyer Blatz 2019-02-20 08:58:42 -08:00 committed by Colin Lee
parent b924df54f5
commit fc537c42ec
2 changed files with 9 additions and 1 deletions

View File

@ -87,6 +87,7 @@ class ToolbarUIView(
override fun updateView() = Consumer<SearchState> {
if (it.isEditing) {
view.url = it.query
view.editMode()
} else {
view.displayMode()

View File

@ -18,6 +18,7 @@ import org.mozilla.fenix.components.toolbar.SearchAction
import org.mozilla.fenix.components.toolbar.SearchState
import org.mozilla.fenix.components.toolbar.ToolbarComponent
import org.mozilla.fenix.components.toolbar.ToolbarUIView
import org.mozilla.fenix.ext.requireComponents
import org.mozilla.fenix.mvi.ActionBusFactory
import org.mozilla.fenix.mvi.getAutoDisposeObservable
import org.mozilla.fenix.mvi.getManagedEmitter
@ -38,12 +39,18 @@ class SearchFragment : Fragment() {
val sessionId = SearchFragmentArgs.fromBundle(arguments!!).sessionId
val isPrivate = SearchFragmentArgs.fromBundle(arguments!!).isPrivateTab
val view = inflater.inflate(R.layout.fragment_search, container, false)
val url = sessionId?.let {
requireComponents.core.sessionManager.findSessionById(it)?.let {
session -> session.url
}
} ?: ""
toolbarComponent = ToolbarComponent(
view.toolbar_wrapper,
ActionBusFactory.get(this),
sessionId,
isPrivate,
SearchState("", isEditing = true)
SearchState(url, isEditing = true)
)
awesomeBarComponent = AwesomeBarComponent(
view.search_layout, ActionBusFactory.get(this),