From 43a4b1b77c2b3b78869e0f14f8d18e573032b627 Mon Sep 17 00:00:00 2001 From: Sawyer Blatz Date: Tue, 14 May 2019 08:41:45 -0700 Subject: [PATCH] For #563: Restyles history favicons (#2455) --- .../history/viewholders/HistoryListItemViewHolder.kt | 3 +++ app/src/main/res/drawable/history_favicon_background.xml | 9 --------- app/src/main/res/layout/history_list_item.xml | 3 ++- 3 files changed, 5 insertions(+), 10 deletions(-) delete mode 100644 app/src/main/res/drawable/history_favicon_background.xml diff --git 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 index 63006c1a84..6a21d34771 100644 --- 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 @@ -106,6 +106,9 @@ class HistoryListItemViewHolder( favicon.setImageResource(0) } } else { + val backgroundTint = DefaultThemeManager.resolveAttribute(R.attr.neutral, itemView.context) + val backgroundTintList = ContextCompat.getColorStateList(itemView.context, backgroundTint) + favicon.backgroundTintList = backgroundTintList updateFavIcon(item.url) } } diff --git a/app/src/main/res/drawable/history_favicon_background.xml b/app/src/main/res/drawable/history_favicon_background.xml deleted file mode 100644 index af32d39802..0000000000 --- a/app/src/main/res/drawable/history_favicon_background.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/history_list_item.xml b/app/src/main/res/layout/history_list_item.xml index c8465b2e60..e6cc447b74 100644 --- a/app/src/main/res/layout/history_list_item.xml +++ b/app/src/main/res/layout/history_list_item.xml @@ -28,7 +28,8 @@ android:id="@+id/history_favicon" android:layout_width="@dimen/history_favicon_width_height" android:layout_height="@dimen/history_favicon_width_height" - android:background="@drawable/history_favicon_background" + android:background="@drawable/favicon_background" + android:padding="10dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" />