From 900238c84f3d176756b500bc440d90e14641ae57 Mon Sep 17 00:00:00 2001 From: Jay Date: Sat, 25 Apr 2020 22:24:32 -0400 Subject: [PATCH] Some source icon clean up --- .../java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt | 3 +-- .../ui/migration/manga/design/MigrationSourceHolder.kt | 2 +- .../java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt | 7 ++++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt index 85240e06f9..2ffdee0411 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/SourceHolder.kt @@ -27,8 +27,7 @@ class SourceHolder(view: View, val adapter: SourceAdapter) : // Set circle letter image. itemView.post { - val icon = source.icon() - if (icon != null) edit_button.setImageDrawable(source.icon()) + edit_button.setImageDrawable(source.icon()) } } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/MigrationSourceHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/MigrationSourceHolder.kt index 526b99e1cb..3dff9740db 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/MigrationSourceHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/design/MigrationSourceHolder.kt @@ -25,7 +25,7 @@ class MigrationSourceHolder(view: View, val adapter: MigrationSourceAdapter) : // Update circle letter image. itemView.post { val icon = source.icon() - if (icon != null) edit_button.setImageDrawable(source.icon()) + if (icon != null) edit_button.setImageDrawable(icon) } if (sourceEnabled) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt index e0fa297f56..ae11e647fb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/SourceHolder.kt @@ -54,9 +54,10 @@ class SourceHolder(view: View, val adapter: SourceAdapter) : // Set circle letter image. itemView.post { val icon = source.icon() - if (icon != null) edit_button.setImageDrawable(source.icon()) - else if (item.source.id == LocalSource.ID) - edit_button.setImageResource(R.mipmap.ic_local_source) + when { + icon != null -> edit_button.setImageDrawable(icon) + item.source.id == LocalSource.ID -> edit_button.setImageResource(R.mipmap.ic_local_source) + } } if (source.supportsLatest) {