diff options
author | Allan Wang <me@allanwang.ca> | 2018-01-27 13:07:04 -0500 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2018-01-27 13:07:04 -0500 |
commit | f5d6ddb72a3dc369b95631a607471f9a6ea5e70f (patch) | |
tree | b458b744d36887603dd276533bb42211611eff3f | |
parent | 91e4b0cd099d24cc645d5c935c9ed0c97d7fa5d8 (diff) | |
download | kau-f5d6ddb72a3dc369b95631a607471f9a6ea5e70f.tar.gz kau-f5d6ddb72a3dc369b95631a607471f9a6ea5e70f.tar.bz2 kau-f5d6ddb72a3dc369b95631a607471f9a6ea5e70f.zip |
Update changelog3.6.3
-rw-r--r-- | sample/src/main/res/xml/kau_changelog.xml | 3 | ||||
-rw-r--r-- | searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt | 9 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sample/src/main/res/xml/kau_changelog.xml b/sample/src/main/res/xml/kau_changelog.xml index cd6c41a..d668eb6 100644 --- a/sample/src/main/res/xml/kau_changelog.xml +++ b/sample/src/main/res/xml/kau_changelog.xml @@ -9,11 +9,12 @@ <version title="v3.6.3" /> <item text=":core: Check for tablet in email builder" /> <item text=":kpref-activity: Simplify internal code and add better encapsulation" /> - <item text="" /> + <item text=":kpref-activity: Disable seekbar when kprefseekbar is disabled" /> <item text="Add Chinese, Indonesian, Norwegian, Polish, Thai, and Turkish translations" /> <item text="Add back git versioning" /> <item text="Created gradle plugin for getting version updates" /> <item text="" /> + <item text="" /> <version title="v3.6.2" /> <item text=":core: Pass null instead of bundle if bundle is empty for startActivity" /> 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 e3a4678..19f1a36 100644 --- a/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt +++ b/searchview/src/main/kotlin/ca/allanwang/kau/searchview/SearchView.kt @@ -240,8 +240,7 @@ class SearchView @JvmOverloads constructor( private val iconClear: ImageView by bindView(R.id.kau_search_clear) private val divider: View by bindView(R.id.kau_search_divider) private val recycler: RecyclerView by bindView(R.id.kau_search_recycler) - private var textCallback: Debouncer2<String, SearchView> - = debounce(0) { query, _ -> KL.d { "Search query $query found; set your own textCallback" } } + private var textCallback: Debouncer2<String, SearchView> = debounce(0) { query, _ -> KL.d { "Search query $query found; set your own textCallback" } } private val adapter = FastItemAdapter<SearchItem>() private var menuItem: MenuItem? = null val isOpen: Boolean @@ -343,7 +342,8 @@ class SearchView @JvmOverloads constructor( */ fun bind(menu: Menu, @IdRes id: Int, @ColorInt menuIconColor: Int = Color.WHITE, config: Configs.() -> Unit = {}): SearchView { config(config) - val menuItem = menu.findItem(id) ?: throw IllegalArgumentException("Menu item with given id doesn't exist") + val menuItem = menu.findItem(id) + ?: throw IllegalArgumentException("Menu item with given id doesn't exist") if (menuItem.icon == null) menuItem.icon = GoogleMaterial.Icon.gmd_search.toDrawable(context, 18, menuIconColor) card.gone() menuItem.setOnMenuItemClickListener { revealOpen(); true } @@ -459,8 +459,7 @@ annotation class KauSearch * Helper function that binds to an activity's main view */ @KauSearch -fun Activity.bindSearchView(menu: Menu, @IdRes id: Int, @ColorInt menuIconColor: Int = Color.WHITE, config: SearchView.Configs.() -> Unit = {}): SearchView - = findViewById<ViewGroup>(android.R.id.content).bindSearchView(menu, id, menuIconColor, config) +fun Activity.bindSearchView(menu: Menu, @IdRes id: Int, @ColorInt menuIconColor: Int = Color.WHITE, config: SearchView.Configs.() -> Unit = {}): SearchView = findViewById<ViewGroup>(android.R.id.content).bindSearchView(menu, id, menuIconColor, config) /** * Bind searchView to a menu item; call this in [Activity.onCreateOptionsMenu] |