[fenix] For https://github.com/mozilla-mobile/fenix/issues/27697 - Load icon for browser and history search immediately.

The icon was set after the screen was visible leading to a flicker.
With this solution, the icon will be set before the screen is visible
eliminating any visible artefacts.
pull/600/head
DreVla 2 years ago committed by mergify[bot]
parent e73806561f
commit d3c587635a

@ -81,6 +81,8 @@ class ToolbarView(
false
}
setDefaultIcon()
setOnEditListener(
object : mozilla.components.concept.toolbar.Toolbar.OnEditListener {
override fun onCancelEditing(): Boolean {
@ -110,7 +112,9 @@ class ToolbarView(
view.editMode()
isInitialized = true
}
}
private fun setDefaultIcon() {
val bookmarkSearchIcon =
AppCompatResources.getDrawable(context, R.drawable.ic_bookmarks_menu)

@ -81,6 +81,8 @@ class ToolbarView(
false
}
setDefaultIcon()
setOnEditListener(
object : mozilla.components.concept.toolbar.Toolbar.OnEditListener {
override fun onCancelEditing(): Boolean {
@ -110,7 +112,9 @@ class ToolbarView(
view.editMode()
isInitialized = true
}
}
private fun setDefaultIcon() {
val historySearchIcon = AppCompatResources.getDrawable(context, R.drawable.ic_history)
historySearchIcon?.let {

Loading…
Cancel
Save