aboutsummaryrefslogtreecommitdiff
path: root/searchview/src/main
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-04-07 20:23:17 -0400
committerGitHub <noreply@github.com>2018-04-07 20:23:17 -0400
commita0377be622f21b4c6a7d8828505c1e95efab1254 (patch)
tree825760fab6f0bb1baa4e709443becefba5a8d06a /searchview/src/main
parente97db5c6529b1e12effc7141f277bd41d3fb580a (diff)
downloadkau-a0377be622f21b4c6a7d8828505c1e95efab1254.tar.gz
kau-a0377be622f21b4c6a7d8828505c1e95efab1254.tar.bz2
kau-a0377be622f21b4c6a7d8828505c1e95efab1254.zip
Update/android studio 3.1 (#146)
* Update dependencies * Add default invalid id value * Extend appcompat views only * Update migration * Remove setTextIfValid * Remove nosibling warning * Add deprecation warnings to fragment view binding * Bring back glide 4.6.1 * Use proper distribution type setter
Diffstat (limited to 'searchview/src/main')
-rw-r--r--searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt6
1 files changed, 3 insertions, 3 deletions
diff --git a/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt b/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt
index 52a88a0..837b714 100644
--- a/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt
+++ b/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt
@@ -121,7 +121,7 @@ class SearchView @JvmOverloads constructor(
/**
* Hint string res to be set in the searchView
*/
- var hintTextRes: Int = -1
+ var hintTextRes: Int = INVALID_ID
/**
* StringRes for a "no results found" item
@@ -131,7 +131,7 @@ class SearchView @JvmOverloads constructor(
* For simplicity, kau contains [R.string.kau_no_results_found]
* which you may use
*/
- var noResultsFound: Int = -1
+ var noResultsFound: Int = INVALID_ID
/**
* Callback for when the query changes
@@ -212,7 +212,7 @@ class SearchView @JvmOverloads constructor(
var results: List<SearchItem>
get() = adapter.adapterItems
set(value) = context.runOnUiThread {
- val list = if (value.isEmpty() && configs.noResultsFound > 0)
+ val list = if (value.isEmpty() && configs.noResultsFound != INVALID_ID)
listOf(SearchItem("", context.string(configs.noResultsFound), iicon = null))
else value
if (configs.highlightQueryText && value.isNotEmpty()) list.forEach { it.withHighlights(editText.text.toString()) }