diff options
author | Allan Wang <me@allanwang.ca> | 2017-10-25 12:41:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-25 12:41:05 -0400 |
commit | e04487f5b1a4c6a5999db8d9746a07919ae9a333 (patch) | |
tree | 4a60e9369dbb957c0f47f6052510433bc9d37e01 /app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt | |
parent | 2d6b790643078b9b5ff2869c74dc941212087864 (diff) | |
download | frost-e04487f5b1a4c6a5999db8d9746a07919ae9a333.tar.gz frost-e04487f5b1a4c6a5999db8d9746a07919ae9a333.tar.bz2 frost-e04487f5b1a4c6a5999db8d9746a07919ae9a333.zip |
Update search logic (#444)
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt | 8 |
1 files changed, 7 insertions, 1 deletions
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 a4736091..2f478d44 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt @@ -29,11 +29,17 @@ enum class FbItem(@StringRes val titleId: Int, val icon: IIcon, relativeUrl: Str 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"), - SEARCH(R.string.search_menu_title, GoogleMaterial.Icon.gmd_search, "search"), + _SEARCH(R.string.search_menu_title, GoogleMaterial.Icon.gmd_search, "search/top"), SETTINGS(R.string.settings, GoogleMaterial.Icon.gmd_settings, "settings"), ; val url = "$FB_URL_BASE$relativeUrl" } +inline val fbSearch + get() = fbSearch() + +fun fbSearch(query: String = "a") = "${FB_SEARCH}$query" + +private const val FB_SEARCH = "${FB_URL_BASE}search/top/?q=" fun defaultTabs(): List<FbItem> = listOf(FbItem.FEED, FbItem.MESSAGES, FbItem.NOTIFICATIONS, FbItem.MENU) |