feat: 优化代码

pull/103/head
kunfei 5 years ago
parent 09568439ef
commit 8df8506e97
  1. 2
      app/src/main/java/io/legado/app/ui/widget/prefs/IconListPreference.kt

@ -51,7 +51,7 @@ class IconListPreference(context: Context, attrs: AttributeSet) : ListPreference
super.onBindViewHolder(holder) super.onBindViewHolder(holder)
holder?.itemView?.findViewById<ImageView>(R.id.preview)?.let { holder?.itemView?.findViewById<ImageView>(R.id.preview)?.let {
val selectedIndex = findIndexOfValue(value) val selectedIndex = findIndexOfValue(value)
if (selectedIndex > 0) { if (selectedIndex >= 0) {
val drawable = mEntryDrawables[selectedIndex] val drawable = mEntryDrawables[selectedIndex]
it.setImageDrawable(drawable) it.setImageDrawable(drawable)
} }

Loading…
Cancel
Save