diff options
author | Allan Wang <me@allanwang.ca> | 2021-04-17 17:09:52 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2021-04-17 17:09:52 -0700 |
commit | cb2adc75d8e105adfdf0d5646c1a9b6d39c292f8 (patch) | |
tree | 6f502ff43780cc037041700a88250047c5430677 /app/src/main/kotlin/com/pitchedapps | |
parent | 39db7f4c3d7b8f3d68ef1a8881b69624b721f6c6 (diff) | |
download | frost-cb2adc75d8e105adfdf0d5646c1a9b6d39c292f8.tar.gz frost-cb2adc75d8e105adfdf0d5646c1a9b6d39c292f8.tar.bz2 frost-cb2adc75d8e105adfdf0d5646c1a9b6d39c292f8.zip |
Add hilt to main activity
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/activities/BaseActivity.kt | 15 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt | 12 |
2 files changed, 20 insertions, 7 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseActivity.kt index 505738f3..5b2544c9 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseActivity.kt @@ -25,16 +25,23 @@ import com.pitchedapps.frost.facebook.FbCookie import com.pitchedapps.frost.injectors.ThemeProvider import com.pitchedapps.frost.prefs.Prefs import com.pitchedapps.frost.utils.setFrostTheme -import org.koin.android.ext.android.inject +import dagger.hilt.android.AndroidEntryPoint +import javax.inject.Inject /** * Created by Allan Wang on 2017-06-12. */ +@AndroidEntryPoint abstract class BaseActivity : KauBaseActivity() { - val fbCookie: FbCookie by inject() - val prefs: Prefs by inject() - val themeProvider: ThemeProvider by inject() + @Inject + lateinit var fbCookie: FbCookie + + @Inject + lateinit var prefs: Prefs + + @Inject + lateinit var themeProvider: ThemeProvider /** * Inherited consumer to customize back press 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 35dd4141..b043cb2e 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt @@ -128,10 +128,11 @@ import com.pitchedapps.frost.views.BadgedIcon import com.pitchedapps.frost.views.FrostVideoViewer import com.pitchedapps.frost.views.FrostViewPager import com.pitchedapps.frost.widgets.NotificationWidget +import dagger.hilt.android.AndroidEntryPoint +import javax.inject.Inject import kotlin.math.abs import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.launch -import org.koin.android.ext.android.inject /** * Created by Allan Wang on 20/12/17. @@ -139,6 +140,7 @@ import org.koin.android.ext.android.inject * Most of the logic that is unrelated to handling fragments */ @UseExperimental(ExperimentalCoroutinesApi::class) +@AndroidEntryPoint abstract class BaseMainActivity : BaseActivity(), MainActivityContract, FileChooserContract by FileChooserDelegate(), VideoViewHolder, SearchViewHolder { @@ -150,8 +152,12 @@ abstract class BaseMainActivity : BaseActivity(), MainActivityContract, override val frameWrapper: FrameLayout get() = drawerWrapperBinding.mainContainer lateinit var drawerWrapperBinding: ActivityMainDrawerWrapperBinding lateinit var contentBinding: ActivityMainContentBinding - val cookieDao: CookieDao by inject() - val genericDao: GenericDao by inject() + + @Inject + lateinit var cookieDao: CookieDao + + @Inject + lateinit var genericDao: GenericDao interface ActivityMainContentBinding { val root: View |