aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2020-02-23 16:36:31 -0800
committerAllan Wang <me@allanwang.ca>2020-02-23 16:36:31 -0800
commit0dfc1b3e6542b9deca6c56236b46e71e4c6976f5 (patch)
treed16e4c34b86b0cc236fce32baa38d71f3b7adfbf /app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt
parentcd69ccf7c49f486a6c90a7cee0d32a74ea00247d (diff)
downloadfrost-0dfc1b3e6542b9deca6c56236b46e71e4c6976f5.tar.gz
frost-0dfc1b3e6542b9deca6c56236b46e71e4c6976f5.tar.bz2
frost-0dfc1b3e6542b9deca6c56236b46e71e4c6976f5.zip
Remove singleton pattern for fbcookie
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt b/app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt
index 8459fdf0..1262c078 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt
@@ -27,6 +27,7 @@ import com.mikepenz.fastadapter.GenericItem
import com.mikepenz.fastadapter.IAdapter
import com.mikepenz.fastadapter.select.selectExtension
import com.pitchedapps.frost.R
+import com.pitchedapps.frost.facebook.FbCookie
import com.pitchedapps.frost.utils.Prefs
import com.pitchedapps.frost.utils.launchWebOverlay
import org.koin.core.KoinComponent
@@ -43,20 +44,20 @@ interface ClickableIItemContract {
val url: String?
- fun click(context: Context) {
+ fun click(context: Context, fbCookie: FbCookie) {
val url = url ?: return
- context.launchWebOverlay(url)
+ context.launchWebOverlay(url, fbCookie)
}
companion object {
- fun bindEvents(adapter: IAdapter<GenericItem>) {
+ fun bindEvents(adapter: IAdapter<GenericItem>, fbCookie: FbCookie) {
adapter.fastAdapter?.apply {
selectExtension {
isSelectable = false
}
onClickListener = { v, _, item, _ ->
if (item is ClickableIItemContract) {
- item.click(v!!.context)
+ item.click(v!!.context, fbCookie)
true
} else
false