For #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.
This commit is contained in:
DreVla 2022-11-07 11:38:17 +02:00 committed by mergify[bot]
parent 4a0c1e5a8c
commit 35ab4db755
2 changed files with 8 additions and 0 deletions

View File

@ -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)

View File

@ -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 {