aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-04-25 15:39:04 -0700
committerAllan Wang <me@allanwang.ca>2019-04-25 15:39:04 -0700
commit77d28c77ead6a2477e1e4df1b8e74bd08a3c2efd (patch)
tree202d31e3f8a93dd7b8988774fc8e91cb263b3365 /app
parent0b262754ad8489bda1ad21494b847652eb125aec (diff)
downloadfrost-77d28c77ead6a2477e1e4df1b8e74bd08a3c2efd.tar.gz
frost-77d28c77ead6a2477e1e4df1b8e74bd08a3c2efd.tar.bz2
frost-77d28c77ead6a2477e1e4df1b8e74bd08a3c2efd.zip
Move search view binding to separate func
Diffstat (limited to 'app')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt6
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt3
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"),
;