|
|
@ -108,16 +108,9 @@ open class Preference(context: Context, attrs: AttributeSet) : |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onBindViewHolder(holder: PreferenceViewHolder) { |
|
|
|
final override fun onBindViewHolder(holder: PreferenceViewHolder) { |
|
|
|
bindView<View>( |
|
|
|
|
|
|
|
context, |
|
|
|
|
|
|
|
holder, |
|
|
|
|
|
|
|
icon, |
|
|
|
|
|
|
|
title, |
|
|
|
|
|
|
|
summary, |
|
|
|
|
|
|
|
isBottomBackground = isBottomBackground |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
super.onBindViewHolder(holder) |
|
|
|
super.onBindViewHolder(holder) |
|
|
|
|
|
|
|
onBindView(holder) |
|
|
|
onLongClick?.let { listener -> |
|
|
|
onLongClick?.let { listener -> |
|
|
|
holder.itemView.onLongClick { |
|
|
|
holder.itemView.onLongClick { |
|
|
|
listener.invoke(this) |
|
|
|
listener.invoke(this) |
|
|
@ -125,6 +118,13 @@ open class Preference(context: Context, attrs: AttributeSet) : |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
open fun onBindView(holder: PreferenceViewHolder) { |
|
|
|
|
|
|
|
bindView<View>( |
|
|
|
|
|
|
|
context, holder, icon, title, summary, |
|
|
|
|
|
|
|
isBottomBackground = isBottomBackground |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun onLongClick(listener: (preference: Preference) -> Boolean) { |
|
|
|
fun onLongClick(listener: (preference: Preference) -> Boolean) { |
|
|
|
onLongClick = listener |
|
|
|
onLongClick = listener |
|
|
|
} |
|
|
|
} |
|
|
|