aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefHeader.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-07-04 16:08:03 -0700
committerAllan Wang <me@allanwang.ca>2017-07-04 16:08:03 -0700
commitcf2a7fcd0880a8d276970124cdb5d5845d5631fe (patch)
treecc38ead7853ddb85c9c988e94a4af605e1e676f8 /core/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefHeader.kt
parentfe4632c34a1d671503e0242a269865b884545e13 (diff)
downloadkau-cf2a7fcd0880a8d276970124cdb5d5845d5631fe.tar.gz
kau-cf2a7fcd0880a8d276970124cdb5d5845d5631fe.tar.bz2
kau-cf2a7fcd0880a8d276970124cdb5d5845d5631fe.zip
Separate core components in its own module
Diffstat (limited to 'core/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefHeader.kt')
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefHeader.kt25
1 files changed, 25 insertions, 0 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefHeader.kt b/core/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefHeader.kt
new file mode 100644
index 0000000..fa8efff
--- /dev/null
+++ b/core/src/main/kotlin/ca/allanwang/kau/kpref/items/KPrefHeader.kt
@@ -0,0 +1,25 @@
+package ca.allanwang.kau.kpref.items
+
+import android.view.View
+import ca.allanwang.kau.R
+import ca.allanwang.kau.kpref.KPrefMarker
+
+/**
+ * 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: CoreContract) : KPrefItemCore(builder) {
+
+ override fun getLayoutRes(): Int = R.layout.kau_preference_header
+
+ override fun onPostBindView(viewHolder: ViewHolder, textColor: Int?, accentColor: Int?) {
+ if (accentColor != null) viewHolder.title.setTextColor(accentColor)
+ }
+
+ override fun onClick(itemView: View, innerContent: View?): Boolean = true
+
+ override fun getType() = R.id.kau_item_pref_header
+
+} \ No newline at end of file