aboutsummaryrefslogtreecommitdiff
path: root/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefHeader.kt
blob: 9b63a52e6cd49a1d2ecc970751d053ccead91fd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package ca.allanwang.kau.kpref.activity.items

import ca.allanwang.kau.kpref.activity.R

/**
 * 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
 */
open class KPrefHeader(builder: CoreContract) : KPrefItemCore(builder) {

    override fun getLayoutRes(): Int = R.layout.kau_pref_header

    override fun bindView(holder: ViewHolder, payloads: List<Any>) {
        super.bindView(holder, payloads)
        withAccentColor(holder.title::setTextColor)
    }

    override fun getType() = R.id.kau_item_pref_header

}