aboutsummaryrefslogtreecommitdiff
path: root/kpref-activity/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'kpref-activity/src/main')
-rw-r--r--kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefBinder.kt24
-rw-r--r--kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt1
-rw-r--r--kpref-activity/src/main/res-public/values/public.xml2
3 files changed, 9 insertions, 18 deletions
diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefBinder.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefBinder.kt
index a9e21ff..2cdeae2 100644
--- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefBinder.kt
+++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/KPrefBinder.kt
@@ -53,60 +53,52 @@ class GlobalOptions(core: CoreAttributeContract, activity: KPrefActivityContract
class KPrefAdapterBuilder(val globalOptions: GlobalOptions) {
@KPrefMarker
- fun header(@StringRes title: Int)
- = list.add(KPrefHeader(KPrefItemCore.CoreBuilder(globalOptions, title)))
+ fun header(@StringRes title: Int) = list.add(KPrefHeader(KPrefItemCore.CoreBuilder(globalOptions, title)))
@KPrefMarker
fun checkbox(@StringRes title: Int,
getter: (() -> Boolean),
setter: ((value: Boolean) -> Unit),
- builder: KPrefItemBase.BaseContract<Boolean>.() -> Unit = {})
- = list.add(KPrefCheckbox(KPrefItemBase.BaseBuilder(globalOptions, title, getter, setter)
+ builder: KPrefItemBase.BaseContract<Boolean>.() -> Unit = {}) = list.add(KPrefCheckbox(KPrefItemBase.BaseBuilder(globalOptions, title, getter, setter)
.apply { builder() }))
@KPrefMarker
fun colorPicker(@StringRes title: Int,
getter: (() -> Int),
setter: ((value: Int) -> Unit),
- builder: KPrefColorPicker.KPrefColorContract.() -> Unit = {})
- = list.add(KPrefColorPicker(KPrefColorPicker.KPrefColorBuilder(globalOptions, title, getter, setter)
+ builder: KPrefColorPicker.KPrefColorContract.() -> Unit = {}) = list.add(KPrefColorPicker(KPrefColorPicker.KPrefColorBuilder(globalOptions, title, getter, setter)
.apply { builder() }))
@KPrefMarker
fun <T> text(@StringRes title: Int,
getter: (() -> T),
setter: ((value: T) -> Unit),
- builder: KPrefText.KPrefTextContract<T>.() -> Unit = {})
- = list.add(KPrefText(KPrefText.KPrefTextBuilder(globalOptions, title, getter, setter)
+ builder: KPrefText.KPrefTextContract<T>.() -> Unit = {}) = list.add(KPrefText(KPrefText.KPrefTextBuilder(globalOptions, title, getter, setter)
.apply { builder() }))
@KPrefMarker
fun subItems(@StringRes title: Int,
itemBuilder: KPrefAdapterBuilder.() -> Unit,
- builder: KPrefSubItems.KPrefSubItemsContract.() -> Unit)
- = list.add(KPrefSubItems(KPrefSubItems.KPrefSubItemsBuilder(globalOptions, title, itemBuilder)
+ builder: KPrefSubItems.KPrefSubItemsContract.() -> Unit) = list.add(KPrefSubItems(KPrefSubItems.KPrefSubItemsBuilder(globalOptions, title, itemBuilder)
.apply { builder() }))
@KPrefMarker
fun plainText(@StringRes title: Int,
- builder: KPrefItemBase.BaseContract<Unit>.() -> Unit = {})
- = list.add(KPrefPlainText(KPrefPlainText.KPrefPlainTextBuilder(globalOptions, title)
+ builder: KPrefItemBase.BaseContract<Unit>.() -> Unit = {}) = list.add(KPrefPlainText(KPrefPlainText.KPrefPlainTextBuilder(globalOptions, title)
.apply { builder() }))
@KPrefMarker
fun seekbar(@StringRes title: Int,
getter: (() -> Int),
setter: ((value: Int) -> Unit),
- builder: KPrefSeekbar.KPrefSeekbarContract.() -> Unit = {})
- = list.add(KPrefSeekbar(KPrefSeekbar.KPrefSeekbarBuilder(globalOptions, title, getter, setter)
+ builder: KPrefSeekbar.KPrefSeekbarContract.() -> Unit = {}) = list.add(KPrefSeekbar(KPrefSeekbar.KPrefSeekbarBuilder(globalOptions, title, getter, setter)
.apply { builder() }))
@KPrefMarker
fun timePicker(@StringRes title: Int,
getter: (() -> Int),
setter: ((value: Int) -> Unit),
- builder: KPrefTimePicker.KPrefTimeContract.() -> Unit = {})
- = list.add(KPrefTimePicker(KPrefTimePicker.KPrefTimeBuilder(globalOptions, title, getter, setter)
+ builder: KPrefTimePicker.KPrefTimeContract.() -> Unit = {}) = list.add(KPrefTimePicker(KPrefTimePicker.KPrefTimeBuilder(globalOptions, title, getter, setter)
.apply { builder() }))
@KPrefMarker
diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt
index 3e06f6a..f391747 100644
--- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt
+++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefCheckbox.kt
@@ -4,7 +4,6 @@ import android.support.v7.widget.AppCompatCheckBox
import android.widget.CheckBox
import ca.allanwang.kau.kpref.activity.KClick
import ca.allanwang.kau.kpref.activity.R
-import ca.allanwang.kau.logging.KL
import ca.allanwang.kau.utils.tint
/**
diff --git a/kpref-activity/src/main/res-public/values/public.xml b/kpref-activity/src/main/res-public/values/public.xml
index b5fb383..bd4f615 100644
--- a/kpref-activity/src/main/res-public/values/public.xml
+++ b/kpref-activity/src/main/res-public/values/public.xml
@@ -1,5 +1,5 @@
<resources xmlns:tools='http://schemas.android.com/tools' tools:ignore='ResourceName'>
-<!-- AUTO-GENERATED FILE. DO NOT MODIFY. public.xml is generated by the generatepublicxml gradle task -->
+ <!-- AUTO-GENERATED FILE. DO NOT MODIFY. public.xml is generated by the generatepublicxml gradle task -->
<public name='kau_pref_barrier' type='id' />
<public name='kau_pref_container' type='id' />
<public name='kau_pref_desc' type='id' />