Some source icon clean up

This commit is contained in:
Jay 2020-04-25 22:24:32 -04:00
parent 6bdc720249
commit 900238c84f
3 changed files with 6 additions and 6 deletions

View File

@ -27,8 +27,7 @@ class SourceHolder(view: View, val adapter: SourceAdapter) :
// Set circle letter image. // Set circle letter image.
itemView.post { itemView.post {
val icon = source.icon() edit_button.setImageDrawable(source.icon())
if (icon != null) edit_button.setImageDrawable(source.icon())
} }
} }
} }

View File

@ -25,7 +25,7 @@ class MigrationSourceHolder(view: View, val adapter: MigrationSourceAdapter) :
// Update circle letter image. // Update circle letter image.
itemView.post { itemView.post {
val icon = source.icon() val icon = source.icon()
if (icon != null) edit_button.setImageDrawable(source.icon()) if (icon != null) edit_button.setImageDrawable(icon)
} }
if (sourceEnabled) { if (sourceEnabled) {

View File

@ -54,9 +54,10 @@ class SourceHolder(view: View, val adapter: SourceAdapter) :
// Set circle letter image. // Set circle letter image.
itemView.post { itemView.post {
val icon = source.icon() val icon = source.icon()
if (icon != null) edit_button.setImageDrawable(source.icon()) when {
else if (item.source.id == LocalSource.ID) icon != null -> edit_button.setImageDrawable(icon)
edit_button.setImageResource(R.mipmap.ic_local_source) item.source.id == LocalSource.ID -> edit_button.setImageResource(R.mipmap.ic_local_source)
}
} }
if (source.supportsLatest) { if (source.supportsLatest) {