aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/facebook
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt8
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt3
2 files changed, 7 insertions, 4 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)
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
index 3298ff15..4db75fff 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
@@ -12,9 +12,6 @@ import java.nio.charset.StandardCharsets
inline val String.formattedFbUrl: String
get() = FbUrlFormatter(this).toString()
-inline val String.formattedFbUrlCss: String
- get() = FbUrlFormatter(this).toString()
-
class FbUrlFormatter(url: String) {
private val queries = mutableMapOf<String, String>()
private val cleaned: String