Android: Unset STRIKE_THRU_TEXT_FLAG for editable settings
Because SettingViewHolder is used in RecyclerViews, we have to explicitly unset STRIKE_THRU_TEXT_FLAG when we don't want it, otherwise it might be left over from when the SettingViewHolder was representing a different setting.
This commit is contained in:
parent
4312840a4b
commit
eef71d50c3
|
@ -28,8 +28,13 @@ abstract class SettingViewHolder(itemView: View, protected val adapter: Settings
|
|||
val overridden = settingsItem.isOverridden
|
||||
textView.setTypeface(null, if (overridden) Typeface.BOLD else Typeface.NORMAL)
|
||||
|
||||
if (!settingsItem.isEditable) textView.paintFlags =
|
||||
textView.paintFlags or Paint.STRIKE_THRU_TEXT_FLAG
|
||||
if (settingsItem.isEditable) {
|
||||
textView.paintFlags =
|
||||
textView.paintFlags and Paint.STRIKE_THRU_TEXT_FLAG.inv()
|
||||
} else {
|
||||
textView.paintFlags =
|
||||
textView.paintFlags or Paint.STRIKE_THRU_TEXT_FLAG
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue