aboutsummaryrefslogtreecommitdiff
path: root/sample/src/main
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-08-05 23:10:28 -0700
committerGitHub <noreply@github.com>2017-08-05 23:10:28 -0700
commit187d8e64dc7189f63707d154166867084662dbe3 (patch)
tree372503ac381f12a905a0608519228f9792bb1c0b /sample/src/main
parentcaaa5653deda0640a475d0ccad6daeb7852502f7 (diff)
downloadkau-187d8e64dc7189f63707d154166867084662dbe3.tar.gz
kau-187d8e64dc7189f63707d154166867084662dbe3.tar.bz2
kau-187d8e64dc7189f63707d154166867084662dbe3.zip
Create debounce and update searchview (#27)
* Prepare version * Create debounce base * Add debouncer and fix transition crash * Add debounce docs * Update links * Update searchview docs * Test without a ref * Add links to core components * Update links * Update to bullet points * Test core md * Test slash * Test slash * Specify implemented dependencies
Diffstat (limited to 'sample/src/main')
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt17
-rw-r--r--sample/src/main/res/xml/kau_changelog.xml10
2 files changed, 13 insertions, 14 deletions
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
index 51b8530..93fc651 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
@@ -224,18 +224,13 @@ class MainActivity : KPrefActivity() {
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_main, menu)
if (searchView == null) searchView = bindSearchView(menu, R.id.action_search) {
- textObserver = {
- observable, searchView ->
- /*
- * Notice that this function is automatically executed in a new thread
- * and that the results will automatically be set on the ui thread
- */
- observable.subscribe {
- text ->
- val items = wordBank.filter { it.contains(text) }.sorted().map { SearchItem(it) }
- searchView.results = items
- }
+
+ textCallback = {
+ query, searchView ->
+ val items = wordBank.filter { it.contains(query) }.sorted().map { SearchItem(it) }
+ searchView.results = items
}
+ textDebounceInterval = 0
noResultsFound = R.string.kau_no_results_found
shouldClearOnClose = false
onItemClick = {
diff --git a/sample/src/main/res/xml/kau_changelog.xml b/sample/src/main/res/xml/kau_changelog.xml
index c11353d..96ae965 100644
--- a/sample/src/main/res/xml/kau_changelog.xml
+++ b/sample/src/main/res/xml/kau_changelog.xml
@@ -6,7 +6,13 @@
<item text="" />
-->
- <version title="v3.2.4"/>
+ <version title="v3.3.0"/>
+ <item text=":core: Create debounce methods" />
+ <item text=":searchview: [Breaking] remove reactive dependencies and stick with basic callbacks" />
+ <item text="" />
+ <item text="" />
+
+ <version title="v3.2.5"/>
<item text=":core: Fix FAQ background" />
<item text=":core: Create FileUtils" />
<item text=":core: Create NotificationUtils" />
@@ -14,8 +20,6 @@
<item text=":core: Make logging class functions inline" />
<item text=":core: Create removeIf for mutableIteratables" />
<item text=":core-ui: Move reactive libs to :searchview:" />
- <item text="" />
- <item text="" />
<version title="v3.2.3"/>
<item text=":about: Modularize everything" />