mirror of
https://github.com/AllanWang/Frost-for-Facebook.git
synced 2024-11-08 12:02:33 +01:00
Add hilt to main activity
This commit is contained in:
parent
39db7f4c3d
commit
cb2adc75d8
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user