aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-10-18 00:30:47 -0400
committerGitHub <noreply@github.com>2018-10-18 00:30:47 -0400
commit9dd6249d634c8b70d152907a4cda80da1626cddc (patch)
tree00d3af183fe9e7b050afcc91a9cac5bad254722f
parent2ed21b32c9e77da5f957cfbf9d73a0a563b8511c (diff)
downloadkau-9dd6249d634c8b70d152907a4cda80da1626cddc.tar.gz
kau-9dd6249d634c8b70d152907a4cda80da1626cddc.tar.bz2
kau-9dd6249d634c8b70d152907a4cda80da1626cddc.zip
Fix/kprefseekbar builder (#174)
* Convert seekbar fields to getters * Make getters inline * Add spacing in readme, resolves #173 * Placeholder commit
-rw-r--r--.travis.yml4
-rw-r--r--README.md4
-rw-r--r--buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy2
-rw-r--r--docs/Changelog.md3
-rw-r--r--kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSeekbar.kt16
5 files changed, 15 insertions, 14 deletions
diff --git a/.travis.yml b/.travis.yml
index 22743c3..721eb72 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,9 +3,9 @@ jdk:
- oraclejdk8
env:
global:
- - ANDROID_API=27
+ - ANDROID_API=28
- EMULATOR_API=24
- - ANDROID_BUILD_TOOLS=27.0.3
+ - ANDROID_BUILD_TOOLS=28.0.3
android:
components:
- tools
diff --git a/README.md b/README.md
index 4c0963c..edf6878 100644
--- a/README.md
+++ b/README.md
@@ -44,9 +44,9 @@ Note that if you use any particular submodule, it will automatically include all
```gradle
dependencies {
- //All submodules extend this
+ // all submodules extend this
implementation "ca.allanwang.kau:core:$KAU"
- //All submodules with extensive ui extend this
+ // all submodules with extensive ui extend this
implementation "ca.allanwang.kau:core-ui:$KAU"
implementation "ca.allanwang.kau:about:$KAU"
diff --git a/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy b/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy
index e055c46..55fc646 100644
--- a/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy
+++ b/buildSrc/src/main/groovy/ca/allanwang/kau/Versions.groovy
@@ -46,7 +46,7 @@ class Versions {
static def junit = '4.12'
static def testRunner = '1.0.1'
- static def gradlePlugin = '3.2.0'
+ static def gradlePlugin = '3.2.1'
static def mavenPlugin = '2.1'
static def playPublishPlugin = '1.2.2'
diff --git a/docs/Changelog.md b/docs/Changelog.md
index a93b4c8..a5f24f4 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -4,8 +4,9 @@
* Update everything to Android Studio 3.1
* Fix new lint issues (see Migration for resource related methods)
* :adapter: Add more IAdapter functions to help retrieve selections
-* :core: Add deprecation warning to bindView for fragment based extensions; use bindViewResettable instead
+* :core: Deprecate Kotterknife; use kotlin_android_extensions
* :kpref-activity: Fix seekbar increment
+* :core: Make KPref use Set<String> vs StringSet
## v3.7.1
* Update appcompat to 27.1.0
diff --git a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSeekbar.kt b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSeekbar.kt
index 78f4f80..ce61e8f 100644
--- a/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSeekbar.kt
+++ b/kpref-activity/src/main/kotlin/ca/allanwang/kau/kpref/activity/items/KPrefSeekbar.kt
@@ -15,14 +15,9 @@ import ca.allanwang.kau.utils.tint
*/
open class KPrefSeekbar(val builder: KPrefSeekbarContract) : KPrefItemBase<Int>(builder) {
- protected val min = builder.min
- protected val max = builder.max
- protected val increment = builder.increments
-
- init {
- if (increment <= 0)
- throw IllegalArgumentException("Seekbar must increment by at least 1")
- }
+ protected inline val min get() = builder.min
+ protected inline val max get() = builder.max
+ protected inline val increment get() = builder.increments
override fun KClick<Int>.defaultOnClick() = Unit
@@ -83,6 +78,11 @@ open class KPrefSeekbar(val builder: KPrefSeekbarContract) : KPrefItemBase<Int>(
override var max: Int = 100
override var increments: Int = 1
+ set(value) {
+ if (value <= 0)
+ throw IllegalArgumentException("Seekbar must increment by at least 1")
+ field = value
+ }
override var toText: (Int) -> String = Int::toString