Created
March 12, 2020 17:50
-
-
Save boek/e4e720257815ba80010fdad7a5fc58c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- a/app/src/main/java/org/mozilla/fenix/library/history/viewholders/HistoryListItemViewHolder.kt | |
| +++ b/app/src/main/java/org/mozilla/fenix/library/history/viewholders/HistoryListItemViewHolder.kt | |
| @@ -45,8 +45,6 @@ class HistoryListItemViewHolder( | |
| showDeleteButton: Boolean, | |
| mode: HistoryFragmentState.Mode | |
| ) { | |
| - this.item = item | |
| - | |
| itemView.history_layout.titleView.text = item.title | |
| itemView.history_layout.urlView.text = item.url | |
| @@ -57,12 +55,16 @@ class HistoryListItemViewHolder( | |
| itemView.history_layout.setSelectionInteractor(item, selectionHolder, historyInteractor) | |
| itemView.history_layout.changeSelected(item in selectionHolder.selectedItems) | |
| - itemView.history_layout.loadFavicon(item.url) | |
| + if (this.item?.url != item.url) { | |
| + itemView.history_layout.loadFavicon(item.url) | |
| + } | |
| if (mode === HistoryFragmentState.Mode.Normal) { | |
| itemView.overflow_menu.showAndEnable() | |
| } else { | |
| itemView.overflow_menu.hideAndDisable() | |
| } | |
| + | |
| + this.item = item | |
| } | |
| private fun toggleHeader(headerText: String?) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment