blob: 1175fc26d24cf4767f74e8aacb8d1566ade3ad18 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
package ca.allanwang.kau.kpref.items
import android.support.annotation.StringRes
import android.view.View
import ca.allanwang.kau.R
import ca.allanwang.kau.kpref.KPrefAdapterBuilder
/**
* Created by Allan Wang on 2017-06-07.
*
* Header preference
* This view just holds a title and is not clickable. It is styled using the accent color
*/
class KPrefHeader(builder: KPrefAdapterBuilder, @StringRes title: Int) : KPrefItemCore(builder, title = title) {
override fun getLayoutRes(): Int = R.layout.kau_preference_header
override fun onPostBindView(viewHolder: ViewHolder, builder: KPrefAdapterBuilder) {
viewHolder.itemView.isClickable = false
if (builder.accentColor != null) viewHolder.title.setTextColor(builder.accentColor!!)
}
override fun onClick(itemView: View): Boolean = true
override fun getType() = R.id.kau_item_pref_header
}
|