diff options
author | Allan Wang <me@allanwang.ca> | 2019-04-25 15:39:04 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-04-25 15:39:04 -0700 |
commit | 77d28c77ead6a2477e1e4df1b8e74bd08a3c2efd (patch) | |
tree | 202d31e3f8a93dd7b8988774fc8e91cb263b3365 | |
parent | 0b262754ad8489bda1ad21494b847652eb125aec (diff) | |
download | frost-77d28c77ead6a2477e1e4df1b8e74bd08a3c2efd.tar.gz frost-77d28c77ead6a2477e1e4df1b8e74bd08a3c2efd.tar.bz2 frost-77d28c77ead6a2477e1e4df1b8e74bd08a3c2efd.zip |
Move search view binding to separate func
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt | 6 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt index d8b29ddc..49d5f8bf 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt @@ -383,6 +383,11 @@ abstract class BaseMainActivity : BaseActivity(), MainActivityContract, R.id.action_settings to GoogleMaterial.Icon.gmd_settings, R.id.action_search to GoogleMaterial.Icon.gmd_search ) + bindSearchView(menu) + return true + } + + private fun bindSearchView(menu: Menu) { searchViewBindIfNull { bindSearchView(menu, R.id.action_search, Prefs.iconColor) { textCallback = { query, searchView -> @@ -414,7 +419,6 @@ abstract class BaseMainActivity : BaseActivity(), MainActivityContract, onItemClick = { _, key, _, _ -> launchWebOverlay(key) } } } - return true } @SuppressLint("RestrictedApi") diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt index 9ee34ab7..82e15111 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt @@ -56,6 +56,9 @@ enum class FbItem( PHOTOS(R.string.photos, GoogleMaterial.Icon.gmd_photo, "me/photos"), PROFILE(R.string.profile, CommunityMaterial.Icon.cmd_account, "me"), SAVED(R.string.saved, GoogleMaterial.Icon.gmd_bookmark, "saved"), + /** + * Note that this url only works if a query (?q=) is provided + */ _SEARCH(R.string.kau_search, GoogleMaterial.Icon.gmd_search, "search/top"), SETTINGS(R.string.settings, GoogleMaterial.Icon.gmd_settings, "settings"), ; |