SettingsFragmentModule.kt 850 Bytes
Newer Older
samer's avatar
samer committed
1 2
package chat.rocket.android.settings.di

3
import androidx.lifecycle.LifecycleOwner
samer's avatar
samer committed
4 5 6 7 8 9 10 11 12 13
import chat.rocket.android.core.lifecycle.CancelStrategy
import chat.rocket.android.dagger.scope.PerFragment
import chat.rocket.android.settings.presentation.SettingsView
import chat.rocket.android.settings.ui.SettingsFragment
import dagger.Module
import dagger.Provides
import kotlinx.coroutines.experimental.Job

@Module
class SettingsFragmentModule {
14

samer's avatar
samer committed
15
    @Provides
Lucio Maciel's avatar
Lucio Maciel committed
16
    @PerFragment
samer's avatar
samer committed
17 18 19 20 21
    fun settingsView(frag: SettingsFragment): SettingsView {
        return frag
    }

    @Provides
Lucio Maciel's avatar
Lucio Maciel committed
22
    @PerFragment
samer's avatar
samer committed
23 24 25 26 27
    fun settingsLifecycleOwner(frag: SettingsFragment): LifecycleOwner {
        return frag
    }

    @Provides
Lucio Maciel's avatar
Lucio Maciel committed
28
    @PerFragment
samer's avatar
samer committed
29 30 31 32
    fun provideCancelStrategy(owner: LifecycleOwner, jobs: Job): CancelStrategy {
        return CancelStrategy(owner, jobs)
    }
}