From 1f9198a1c05223edc7abb095f483d02cda5f1122 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 1 Jul 2019 14:39:46 -0700 Subject: Add in memory kpref variant --- docs/Changelog.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/Changelog.md b/docs/Changelog.md index 2c653e0..0ccf69c 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -2,6 +2,7 @@ ## v5.0.1 * :adapter: Moved fastadapter elements to new module, :fastadapter:. To migrate, simply rename the dependency. If you don't use fast adapter, no changes are necessary +* :adapter: Make NoAnimatorChange an object; previously a class ## v5.0.0 * Update Android SDK to 29 and Kotlin to 1.3.31 -- cgit v1.2.3 From 39bda3064e75a8a4be100afa4f5e7adee33c2f17 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 1 Jul 2019 14:44:34 -0700 Subject: Update changelog and add post setter test --- .../androidTest/kotlin/ca/allanwang/kau/kpref/KPrefTest.kt | 12 +++++++++++- docs/Changelog.md | 2 ++ sample/src/main/res/xml/kau_changelog.xml | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/core/src/androidTest/kotlin/ca/allanwang/kau/kpref/KPrefTest.kt b/core/src/androidTest/kotlin/ca/allanwang/kau/kpref/KPrefTest.kt index 735302c..143b83f 100644 --- a/core/src/androidTest/kotlin/ca/allanwang/kau/kpref/KPrefTest.kt +++ b/core/src/androidTest/kotlin/ca/allanwang/kau/kpref/KPrefTest.kt @@ -41,11 +41,15 @@ class KPrefTest { initialize(ApplicationProvider.getApplicationContext(), "kpref_test_${System.currentTimeMillis()}") } + var postSetterCount: Int = 0 + var one by kpref("one", 1) var two by kpref("two", 2f) - var `true` by kpref("true", true) + var `true` by kpref("true", true, postSetter = { + postSetterCount++ + }) var hello by kpref("hello", "hello") @@ -113,4 +117,10 @@ class KPrefTest { assertPrefEquals(true, { oneShot }) assertPrefEquals(false, { androidPref.oneShot }) } + + @Test + fun postSetter() { + pref { `true` = true } + assertPrefEquals(1, { postSetterCount }, "Post setter was not called") + } } diff --git a/docs/Changelog.md b/docs/Changelog.md index 0ccf69c..b282830 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -3,6 +3,8 @@ ## v5.0.1 * :adapter: Moved fastadapter elements to new module, :fastadapter:. To migrate, simply rename the dependency. If you don't use fast adapter, no changes are necessary * :adapter: Make NoAnimatorChange an object; previously a class +* :core: KPref now supports in memory only variants for testing; pass KPrefBuilderInMemory to KPref constructor +* :core: KPref initializer takes in SharedPreferences so user can configure it ## v5.0.0 * Update Android SDK to 29 and Kotlin to 1.3.31 diff --git a/sample/src/main/res/xml/kau_changelog.xml b/sample/src/main/res/xml/kau_changelog.xml index 0e38015..6144685 100644 --- a/sample/src/main/res/xml/kau_changelog.xml +++ b/sample/src/main/res/xml/kau_changelog.xml @@ -9,8 +9,8 @@ - - + + -- cgit v1.2.3 From 6154ad0708be6b09acf8a3ff81b822fbf985e8d9 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 1 Jul 2019 14:52:52 -0700 Subject: Run release tests only --- .travis.yml | 2 +- docs/Changelog.md | 2 +- sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt | 1 - sample/src/main/res/xml/kau_changelog.xml | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/.travis.yml b/.travis.yml index 7f4d045..69dabb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ script: - chmod +x gradlew - "./gradlew --quiet androidGitVersion" - if [[ "$TRAVIS_BRANCH" == "master" ]]; then ./gradlew lintRelease publishRelease; - else ./gradlew lintRelease test; fi + else ./gradlew lintRelease testReleaseUnitTest; fi branches: except: - gh-pages diff --git a/docs/Changelog.md b/docs/Changelog.md index b282830..f8287ca 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,6 +1,6 @@ # Changelog -## v5.0.1 +## v5.1.0 * :adapter: Moved fastadapter elements to new module, :fastadapter:. To migrate, simply rename the dependency. If you don't use fast adapter, no changes are necessary * :adapter: Make NoAnimatorChange an object; previously a class * :core: KPref now supports in memory only variants for testing; pass KPrefBuilderInMemory to KPref constructor diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt index 0f20880..80a75bf 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/KPrefSample.kt @@ -17,7 +17,6 @@ package ca.allanwang.kau.sample import android.graphics.Color import ca.allanwang.kau.kpref.KPref -import ca.allanwang.kau.kpref.kpref /** * Created by Allan Wang on 2017-06-07. diff --git a/sample/src/main/res/xml/kau_changelog.xml b/sample/src/main/res/xml/kau_changelog.xml index 6144685..62614ed 100644 --- a/sample/src/main/res/xml/kau_changelog.xml +++ b/sample/src/main/res/xml/kau_changelog.xml @@ -6,7 +6,7 @@ --> - + -- cgit v1.2.3