Skip to content

Instantly share code, notes, and snippets.

@boek
Created March 12, 2020 17:50
Show Gist options
  • Select an option

  • Save boek/e4e720257815ba80010fdad7a5fc58c5 to your computer and use it in GitHub Desktop.

Select an option

Save boek/e4e720257815ba80010fdad7a5fc58c5 to your computer and use it in GitHub Desktop.
--- 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