aboutsummaryrefslogtreecommitdiff
path: root/kpref-activity/src/main
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-10-08 01:54:30 -0400
committerAllan Wang <me@allanwang.ca>2018-10-08 01:54:30 -0400
commit22fe1f537f4c17e145334bbed324558ebf2e4e91 (patch)
tree79c6509449a11b352cbcc3a86cbf3af59cf7a94b /kpref-activity/src/main
parent5b3762b3e04042447b9bf2758c37237d0c8af1b6 (diff)
parent19020070cc073c81bfe397454f2314d37a78ed31 (diff)
downloadkau-22fe1f537f4c17e145334bbed324558ebf2e4e91.tar.gz
kau-22fe1f537f4c17e145334bbed324558ebf2e4e91.tar.bz2
kau-22fe1f537f4c17e145334bbed324558ebf2e4e91.zip
Update to match master
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
2 files changed, 8 insertions, 17 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
/**