aboutsummaryrefslogtreecommitdiff
path: root/library/src/main/kotlin/ca/allanwang
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-26 13:25:17 -0700
committerAllan Wang <me@allanwang.ca>2017-06-26 13:25:17 -0700
commitc9302a7b0f3c66b3514f1f5b83c86757db33008a (patch)
treec14f8b1ae70997be4905d0675deffd37b0ca0562 /library/src/main/kotlin/ca/allanwang
parent3839f9a406b4da9ba888afdaa6ba9c9a157badf6 (diff)
downloadkau-c9302a7b0f3c66b3514f1f5b83c86757db33008a.tar.gz
kau-c9302a7b0f3c66b3514f1f5b83c86757db33008a.tar.bz2
kau-c9302a7b0f3c66b3514f1f5b83c86757db33008a.zip
add Extra icon
Diffstat (limited to 'library/src/main/kotlin/ca/allanwang')
-rw-r--r--library/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt12
1 files changed, 12 insertions, 0 deletions
diff --git a/library/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt b/library/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt
index e3931b9..46bce6a 100644
--- a/library/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt
+++ b/library/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt
@@ -55,6 +55,17 @@ class SearchView @JvmOverloads constructor(
iconNav.setSearchIcon(value)
if (value == null) iconNav.gone()
}
+ /**
+ * Optional icon just to the left of the clear icon
+ * This is not implemented by default, but can be used for anything, such as mic or redirects
+ * Make sure you add a click listener to [iconExtra] if you plan on using this
+ */
+ var extraIcon: IIcon? = null
+ set(value) {
+ field = value
+ iconExtra.setSearchIcon(value)
+ if (value == null) iconClear.gone()
+ }
var clearIcon: IIcon? = GoogleMaterial.Icon.gmd_clear
set(value) {
field = value
@@ -145,6 +156,7 @@ class SearchView @JvmOverloads constructor(
private val editText: AppCompatEditText by bindView(R.id.search_edit_text)
val textEvents: Observable<String>
private val progress: ProgressBar by bindView(R.id.search_progress)
+ val iconExtra: ImageView by bindView(R.id.search_extra)
private val iconClear: ImageView by bindView(R.id.search_clear)
private val divider: View by bindView(R.id.search_divider)
private val recycler: RecyclerView by bindView(R.id.search_recycler)