blob: 9471e04f1ad122a0bab8db49ef5bfb601a237ca6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
/***************************************************************************************************
* Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details.
**************************************************************************************************/
package at.bitfire.davdroid
import at.bitfire.davdroid.ui.AccountsDrawerHandler
import at.bitfire.davdroid.ui.OseAccountsDrawerHandler
import at.bitfire.davdroid.ui.intro.IntroFragmentFactory
import at.bitfire.davdroid.ui.intro.OpenSourceFragment
import at.bitfire.davdroid.ui.intro.PermissionsIntroFragment
import at.bitfire.davdroid.ui.intro.TasksIntroFragment
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ActivityComponent
import dagger.hilt.components.SingletonComponent
import dagger.multibindings.IntoSet
@Module
@InstallIn(SingletonComponent::class)
abstract class OseFlavorModule {
//// navigation drawer handler ////
@Binds
abstract fun accountsDrawerHandler(handler: OseAccountsDrawerHandler): AccountsDrawerHandler
//// intro fragments ////
// WelcomeFragment and BatteryOptimizationsFragment modules are hardcoded there
@Module
@InstallIn(ActivityComponent::class)
abstract class OpenSourceFragmentModule {
@Binds @IntoSet
abstract fun getFactory(factory: OpenSourceFragment.Factory): IntroFragmentFactory
}
@Module
@InstallIn(ActivityComponent::class)
abstract class PermissionsIntroFragmentModule {
@Binds @IntoSet
abstract fun getFactory(factory: PermissionsIntroFragment.Factory): IntroFragmentFactory
}
@Module
@InstallIn(ActivityComponent::class)
abstract class TasksIntroFragmentModule {
@Binds @IntoSet
abstract fun getFactory(factory: TasksIntroFragment.Factory): IntroFragmentFactory
}
}
|