aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/TabCustomizerActivity.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentBase.kt15
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/iitems/TabIItem.kt13
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/services/UpdateReceiver.kt7
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/views/FrostVideoViewer.kt15
5 files changed, 33 insertions, 19 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/TabCustomizerActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/TabCustomizerActivity.kt
index 1b81d333..4c85a084 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/TabCustomizerActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/TabCustomizerActivity.kt
@@ -85,7 +85,7 @@ class TabCustomizerActivity : BaseActivity() {
val remaining = FbItem.values().filter { it.name[0] != '_' }.toMutableList()
remaining.removeAll(tabs)
tabs.addAll(remaining)
- adapter.set(tabs.map(::TabIItem))
+ adapter.set(tabs.map { TabIItem(it, themeProvider) })
bindSwapper(adapter, tabRecycler)
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentBase.kt b/app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentBase.kt
index f7d6b0ad..c4f7d6fb 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentBase.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/fragments/FragmentBase.kt
@@ -49,7 +49,6 @@ import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.channels.ReceiveChannel
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
-import org.koin.android.ext.android.inject
import javax.inject.Inject
import kotlin.coroutines.CoroutineContext
@@ -90,11 +89,17 @@ abstract class BaseFragment :
}
@Inject
- lateinit var mainContract: MainActivityContract
+ protected lateinit var mainContract: MainActivityContract
+
+ @Inject
+ protected lateinit var fbCookie: FbCookie
+
+ @Inject
+ protected lateinit var prefs: Prefs
+
+ @Inject
+ protected lateinit var themeProvider: ThemeProvider
- protected val fbCookie: FbCookie by inject()
- protected val prefs: Prefs by inject()
- protected val themeProvider: ThemeProvider by inject()
open lateinit var job: Job
override val coroutineContext: CoroutineContext
get() = ContextHelper.dispatcher + job
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/iitems/TabIItem.kt b/app/src/main/kotlin/com/pitchedapps/frost/iitems/TabIItem.kt
index 0fb91aca..f9f9064b 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/iitems/TabIItem.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/iitems/TabIItem.kt
@@ -30,24 +30,23 @@ import com.mikepenz.fastadapter.drag.IDraggable
import com.pitchedapps.frost.R
import com.pitchedapps.frost.facebook.FbItem
import com.pitchedapps.frost.injectors.ThemeProvider
-import org.koin.core.component.KoinComponent
-import org.koin.core.component.inject
/**
* Created by Allan Wang on 26/11/17.
*/
-class TabIItem(val item: FbItem) :
+class TabIItem(val item: FbItem, private val themeProvider: ThemeProvider) :
KauIItem<TabIItem.ViewHolder>(
R.layout.iitem_tab_preview,
- { ViewHolder(it) }
+ { ViewHolder(it, themeProvider) }
),
IDraggable {
override val isDraggable: Boolean = true
- class ViewHolder(itemView: View) : FastAdapter.ViewHolder<TabIItem>(itemView), KoinComponent {
-
- private val themeProvider: ThemeProvider by inject()
+ class ViewHolder(
+ itemView: View,
+ private val themeProvider: ThemeProvider
+ ) : FastAdapter.ViewHolder<TabIItem>(itemView) {
val image: ImageView by bindView(R.id.image)
val text: TextView by bindView(R.id.text)
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/UpdateReceiver.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/UpdateReceiver.kt
index 439838a9..81e08e71 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/services/UpdateReceiver.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/services/UpdateReceiver.kt
@@ -21,17 +21,20 @@ import android.content.Context
import android.content.Intent
import com.pitchedapps.frost.prefs.Prefs
import com.pitchedapps.frost.utils.L
+import dagger.hilt.android.AndroidEntryPoint
import org.koin.core.component.KoinComponent
-import org.koin.core.component.inject
+import javax.inject.Inject
/**
* Created by Allan Wang on 2017-05-31.
*
* Receiver that is triggered whenever the app updates so it can bind the notifications again
*/
+@AndroidEntryPoint
class UpdateReceiver : BroadcastReceiver(), KoinComponent {
- private val prefs: Prefs by inject()
+ @Inject
+ lateinit var prefs: Prefs
override fun onReceive(context: Context, intent: Intent) {
if (intent.action != Intent.ACTION_MY_PACKAGE_REPLACED) return
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostVideoViewer.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostVideoViewer.kt
index ca57732c..85b58698 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostVideoViewer.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostVideoViewer.kt
@@ -48,12 +48,14 @@ import com.pitchedapps.frost.injectors.ThemeProvider
import com.pitchedapps.frost.prefs.Prefs
import com.pitchedapps.frost.utils.L
import com.pitchedapps.frost.utils.frostDownload
+import dagger.hilt.android.AndroidEntryPoint
import org.koin.core.component.KoinComponent
-import org.koin.core.component.inject
+import javax.inject.Inject
/**
* Created by Allan Wang on 2017-10-13.
*/
+@AndroidEntryPoint
class FrostVideoViewer @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
@@ -88,9 +90,14 @@ class FrostVideoViewer @JvmOverloads constructor(
}
}
- private val prefs: Prefs by inject()
- private val themeProvider: ThemeProvider by inject()
- private val cookieDao: CookieDao by inject()
+ @Inject
+ lateinit var prefs: Prefs
+
+ @Inject
+ lateinit var themeProvider: ThemeProvider
+
+ @Inject
+ lateinit var cookieDao: CookieDao
private val binding: ViewVideoBinding =
ViewVideoBinding.inflate(LayoutInflater.from(context), this, true)