Skip to content

Commit

Permalink
For mozilla-mobile#18034 - Don't animate the toolbar while the tab is…
Browse files Browse the repository at this point in the history
… loading

Use the new controller offered by AC to resolve some browser layout issues and
also offer an experience consistent with that of other browsers.
  • Loading branch information
Mugurell authored and pkirakosyan committed Aug 5, 2021
1 parent efe20aa commit 9305a41
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import mozilla.components.concept.engine.Engine
import mozilla.components.concept.storage.HistoryStorage
import mozilla.components.feature.tabs.toolbar.TabCounterToolbarButton
import mozilla.components.feature.toolbar.ToolbarAutocompleteFeature
import mozilla.components.feature.toolbar.ToolbarBehaviorController
import mozilla.components.feature.toolbar.ToolbarFeature
import mozilla.components.feature.toolbar.ToolbarPresenter
import mozilla.components.support.base.feature.LifecycleAwareFeature
Expand Down Expand Up @@ -53,6 +54,8 @@ abstract class ToolbarIntegration(
private val menuPresenter =
MenuPresenter(toolbar, context.components.core.store, sessionId)

private val toolbarController = ToolbarBehaviorController(toolbar, store, sessionId)

init {
toolbar.display.menuBuilder = toolbarMenu.menuBuilder
toolbar.private = isPrivate
Expand All @@ -61,11 +64,13 @@ abstract class ToolbarIntegration(
override fun start() {
menuPresenter.start()
toolbarPresenter.start()
toolbarController.start()
}

override fun stop() {
menuPresenter.stop()
toolbarPresenter.stop()
toolbarController.stop()
}

fun invalidateMenu() {
Expand Down

0 comments on commit 9305a41

Please sign in to comment.