├── .gitignore ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── ysfcyln │ │ └── daggermultimodule │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── ysfcyln │ │ │ └── daggermultimodule │ │ │ ├── MainActivity.kt │ │ │ ├── MyApp.kt │ │ │ └── di │ │ │ ├── AppComponent.kt │ │ │ ├── DiProvider.kt │ │ │ ├── SubComponents.kt │ │ │ ├── SubComponentsModule.kt │ │ │ └── main │ │ │ ├── MainComponent.kt │ │ │ └── MainComponentProvider.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── ysfcyln │ └── daggermultimodule │ └── ExampleUnitTest.kt ├── base ├── .gitignore ├── build.gradle ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── ysfcyln │ │ └── base │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── ysfcyln │ │ └── base │ │ ├── ActivityScope.kt │ │ ├── BaseModule.kt │ │ ├── DatabaseService.kt │ │ └── NetworkService.kt │ └── test │ └── java │ └── com │ └── ysfcyln │ └── base │ └── ExampleUnitTest.kt ├── build.gradle ├── feature-one ├── .gitignore ├── build.gradle ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── ysfcyln │ │ └── feature_one │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── ysfcyln │ │ │ └── feature_one │ │ │ ├── FeatureOneActivity.kt │ │ │ ├── FeatureOneObject.kt │ │ │ └── di │ │ │ ├── FeatureOneComponent.kt │ │ │ ├── FeatureOneComponentProvider.kt │ │ │ └── FeatureOneModule.kt │ └── res │ │ ├── layout │ │ └── activity_feature_one.xml │ │ └── values │ │ └── strings.xml │ └── test │ └── java │ └── com │ └── ysfcyln │ └── feature_one │ └── ExampleUnitTest.kt ├── feature-three ├── .gitignore ├── build.gradle ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── ysfcyln │ │ └── feature_three │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── ysfcyln │ │ │ └── feature_three │ │ │ ├── FeatureThreeActivity.kt │ │ │ ├── FeatureThreeObject.kt │ │ │ └── di │ │ │ ├── FeatureThreeComponent.kt │ │ │ ├── FeatureThreeComponentProvider.kt │ │ │ └── FeatureThreeModule.kt │ └── res │ │ ├── layout │ │ └── activity_feature_three.xml │ │ └── values │ │ └── strings.xml │ └── test │ └── java │ └── com │ └── ysfcyln │ └── feature_three │ └── ExampleUnitTest.kt ├── feature-two ├── .gitignore ├── build.gradle ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── ysfcyln │ │ └── feature_two │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── ysfcyln │ │ │ └── feature_two │ │ │ ├── FeatureTwoActivity.kt │ │ │ ├── FeatureTwoObject.kt │ │ │ └── di │ │ │ ├── FeatureTwoComponent.kt │ │ │ ├── FeatureTwoComponentProvider.kt │ │ │ └── FeatureTwoModule.kt │ └── res │ │ ├── layout │ │ └── activity_feature_two.xml │ │ └── values │ │ └── strings.xml │ └── test │ └── java │ └── com │ └── ysfcyln │ └── feature_two │ └── ExampleUnitTest.kt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/android,androidstudio 3 | # Edit at https://www.gitignore.io/?templates=android,androidstudio 4 | 5 | ### Android ### 6 | # Built application files 7 | *.apk 8 | *.ap_ 9 | *.aab 10 | 11 | # Files for the ART/Dalvik VM 12 | *.dex 13 | 14 | # Java class files 15 | *.class 16 | 17 | # Generated files 18 | bin/ 19 | gen/ 20 | out/ 21 | release/ 22 | 23 | # Gradle files 24 | .gradle/ 25 | build/ 26 | 27 | # Local configuration file (sdk path, etc) 28 | local.properties 29 | 30 | # Proguard folder generated by Eclipse 31 | proguard/ 32 | 33 | # Log Files 34 | *.log 35 | 36 | # Android Studio Navigation editor temp files 37 | .navigation/ 38 | 39 | # Android Studio captures folder 40 | captures/ 41 | 42 | # IntelliJ 43 | *.iml 44 | .idea/workspace.xml 45 | .idea/tasks.xml 46 | .idea/gradle.xml 47 | .idea/assetWizardSettings.xml 48 | .idea/dictionaries 49 | .idea/libraries 50 | # Android Studio 3 in .gitignore file. 51 | .idea/caches 52 | .idea/modules.xml 53 | # Comment next line if keeping position of elements in Navigation Editor is relevant for you 54 | .idea/navEditor.xml 55 | 56 | # Keystore files 57 | # Uncomment the following lines if you do not want to check your keystore files in. 58 | #*.jks 59 | #*.keystore 60 | 61 | # External native build folder generated in Android Studio 2.2 and later 62 | .externalNativeBuild 63 | 64 | # Google Services (e.g. APIs or Firebase) 65 | # google-services.json 66 | 67 | # Freeline 68 | freeline.py 69 | freeline/ 70 | freeline_project_description.json 71 | 72 | # fastlane 73 | fastlane/report.xml 74 | fastlane/Preview.html 75 | fastlane/screenshots 76 | fastlane/test_output 77 | fastlane/readme.md 78 | 79 | # Version control 80 | vcs.xml 81 | 82 | # lint 83 | lint/intermediates/ 84 | lint/generated/ 85 | lint/outputs/ 86 | lint/tmp/ 87 | # lint/reports/ 88 | 89 | ### Android Patch ### 90 | gen-external-apklibs 91 | output.json 92 | 93 | # Replacement of .externalNativeBuild directories introduced 94 | # with Android Studio 3.5. 95 | .cxx/ 96 | 97 | ### AndroidStudio ### 98 | # Covers files to be ignored for android development using Android Studio. 99 | 100 | # Built application files 101 | 102 | # Files for the ART/Dalvik VM 103 | 104 | # Java class files 105 | 106 | # Generated files 107 | 108 | # Gradle files 109 | .gradle 110 | 111 | # Signing files 112 | .signing/ 113 | 114 | # Local configuration file (sdk path, etc) 115 | 116 | # Proguard folder generated by Eclipse 117 | 118 | # Log Files 119 | 120 | # Android Studio 121 | /*/build/ 122 | /*/local.properties 123 | /*/out 124 | /*/*/build 125 | /*/*/production 126 | *.ipr 127 | *~ 128 | *.swp 129 | 130 | # Android Patch 131 | 132 | # External native build folder generated in Android Studio 2.2 and later 133 | 134 | # NDK 135 | obj/ 136 | 137 | # IntelliJ IDEA 138 | *.iws 139 | /out/ 140 | 141 | # User-specific configurations 142 | .idea/caches/ 143 | .idea/libraries/ 144 | .idea/shelf/ 145 | .idea/.name 146 | .idea/compiler.xml 147 | .idea/copyright/profiles_settings.xml 148 | .idea/encodings.xml 149 | .idea/misc.xml 150 | .idea/scopes/scope_settings.xml 151 | .idea/vcs.xml 152 | .idea/jsLibraryMappings.xml 153 | .idea/datasources.xml 154 | .idea/dataSources.ids 155 | .idea/sqlDataSources.xml 156 | .idea/dynamic.xml 157 | .idea/uiDesigner.xml 158 | 159 | # OS-specific files 160 | .DS_Store 161 | .DS_Store? 162 | ._* 163 | .Spotlight-V100 164 | .Trashes 165 | ehthumbs.db 166 | Thumbs.db 167 | 168 | # Legacy Eclipse project files 169 | .classpath 170 | .project 171 | .cproject 172 | .settings/ 173 | 174 | # Mobile Tools for Java (J2ME) 175 | .mtj.tmp/ 176 | 177 | # Package Files # 178 | *.war 179 | *.ear 180 | 181 | # virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml) 182 | hs_err_pid* 183 | 184 | ## Plugin-specific files: 185 | 186 | # mpeltonen/sbt-idea plugin 187 | .idea_modules/ 188 | 189 | # JIRA plugin 190 | atlassian-ide-plugin.xml 191 | 192 | # Mongo Explorer plugin 193 | .idea/mongoSettings.xml 194 | 195 | # Crashlytics plugin (for Android Studio and IntelliJ) 196 | com_crashlytics_export_strings.xml 197 | crashlytics.properties 198 | crashlytics-build.properties 199 | fabric.properties 200 | 201 | ### AndroidStudio Patch ### 202 | 203 | !/gradle/wrapper/gradle-wrapper.jar 204 | 205 | # End of https://www.gitignore.io/api/android,androidstudio -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dagger Multi Module Android 2 | Plain Dagger implementation in multi module project 3 | ### Articles 4 | 5 | - [Offical android dagger documentation](https://developer.android.com/training/dependency-injection/dagger-multi-module) 6 | - [Mindorks Multi-Module-Dagger article](https://blog.mindorks.com/dagger-in-a-multi-module-project) 7 | - [Step by step multi module dagger implementation](https://proandroiddev.com/android-multi-module-dagger-a-real-use-case-step-by-step-bbc03500f2f9) 8 | ### Reference projects that I get inspired 9 | - [https://github.com/MindorksOpenSource/Dagger-Multi-Module-Android](https://github.com/MindorksOpenSource/Dagger-Multi-Module-Android) 10 | - [https://github.com/elye/demo_android_dagger_modules_setup](https://github.com/elye/demo_android_dagger_modules_setup) 11 | - [https://github.com/Ladgertha/Dagger-Multi-Modules](https://github.com/Ladgertha/Dagger-Multi-Modules) 12 | 13 | Feel free to contribute 14 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | apply plugin: 'kotlin-kapt' 5 | 6 | android { 7 | compileSdkVersion 29 8 | buildToolsVersion "29.0.2" 9 | 10 | defaultConfig { 11 | applicationId "com.ysfcyln.daggermultimodule" 12 | minSdkVersion 21 13 | targetSdkVersion 29 14 | versionCode 1 15 | versionName "1.0" 16 | 17 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 18 | } 19 | 20 | buildTypes { 21 | release { 22 | minifyEnabled false 23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 24 | } 25 | } 26 | 27 | } 28 | 29 | dependencies { 30 | implementation fileTree(dir: 'libs', include: ['*.jar']) 31 | 32 | implementation project(":base") 33 | implementation project(":feature-one") 34 | implementation project(":feature-two") 35 | implementation project(":feature-three") 36 | 37 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 38 | implementation 'androidx.appcompat:appcompat:1.1.0' 39 | implementation 'androidx.core:core-ktx:1.2.0' 40 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 41 | testImplementation 'junit:junit:4.12' 42 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 43 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 44 | 45 | // Dagger dependencies 46 | implementation "com.google.dagger:dagger:$daggerVersion" 47 | kapt "com.google.dagger:dagger-compiler:$daggerVersion" 48 | } 49 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/ysfcyln/daggermultimodule/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.ysfcyln.daggermultimodule 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.ysfcyln.daggermultimodule", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/ysfcyln/daggermultimodule/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.ysfcyln.daggermultimodule 2 | 3 | import android.content.Intent 4 | import androidx.appcompat.app.AppCompatActivity 5 | import android.os.Bundle 6 | import android.util.Log 7 | import com.ysfcyln.base.DatabaseService 8 | import com.ysfcyln.base.NetworkService 9 | import com.ysfcyln.daggermultimodule.R 10 | import com.ysfcyln.daggermultimodule.di.main.MainComponentProvider 11 | import com.ysfcyln.feature_one.FeatureOneActivity 12 | import com.ysfcyln.feature_two.FeatureTwoActivity 13 | import kotlinx.android.synthetic.main.activity_main.* 14 | import javax.inject.Inject 15 | 16 | class MainActivity : AppCompatActivity() { 17 | 18 | @Inject 19 | lateinit var databaseService: DatabaseService 20 | 21 | @Inject 22 | lateinit var networkService: NetworkService 23 | 24 | /** 25 | * Create component and inject 26 | */ 27 | private fun inject() { 28 | // When rotation happens component and its dependencies recreated :( 29 | val mainComponent = (application as MainComponentProvider).provideMainComponent() 30 | mainComponent.inject(this) 31 | } 32 | 33 | override fun onCreate(savedInstanceState: Bundle?) { 34 | inject() 35 | super.onCreate(savedInstanceState) 36 | setContentView(R.layout.activity_main) 37 | Log.d("MainActivity", databaseService.toString()) 38 | Log.d("MainActivity", networkService.toString()) 39 | 40 | clickListeners() 41 | } 42 | 43 | /** 44 | * View click listeners 45 | */ 46 | private fun clickListeners() { 47 | btnFeatureOne.setOnClickListener { 48 | startActivity(Intent(this, FeatureOneActivity::class.java)) 49 | } 50 | 51 | btnFeatureTwo.setOnClickListener { 52 | startActivity(Intent(this, FeatureTwoActivity::class.java)) 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/ysfcyln/daggermultimodule/MyApp.kt: -------------------------------------------------------------------------------- 1 | package com.ysfcyln.daggermultimodule 2 | 3 | import android.app.Application 4 | import com.ysfcyln.daggermultimodule.di.DiProvider 5 | import com.ysfcyln.daggermultimodule.di.SubComponents 6 | 7 | class MyApp : Application(), SubComponents { 8 | 9 | override fun onCreate() { 10 | super.onCreate() 11 | DiProvider.buildDi(this) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /app/src/main/java/com/ysfcyln/daggermultimodule/di/AppComponent.kt: -------------------------------------------------------------------------------- 1 | package com.ysfcyln.daggermultimodule.di 2 | 3 | import android.app.Application 4 | import com.ysfcyln.base.BaseModule 5 | import com.ysfcyln.daggermultimodule.di.main.MainComponent 6 | import com.ysfcyln.feature_one.di.FeatureOneComponent 7 | import com.ysfcyln.feature_three.di.FeatureThreeComponent 8 | import com.ysfcyln.feature_two.di.FeatureTwoComponent 9 | import dagger.BindsInstance 10 | import dagger.Component 11 | import javax.inject.Singleton 12 | 13 | @Singleton 14 | @Component( 15 | modules = [ 16 | BaseModule::class, 17 | SubComponentsModule::class 18 | ] 19 | ) 20 | interface AppComponent { 21 | 22 | /** 23 | * A {@see [Component.Factory]} that initializes necessary implementations 24 | */ 25 | @Component.Factory 26 | interface Factory { 27 | fun create(@BindsInstance application: Application): AppComponent 28 | } 29 | 30 | // Save the reference of factories in the app component for creating sub components 31 | fun mainComponent() : MainComponent.Factory 32 | 33 | // Save the reference of factories in the app component for creating sub components 34 | fun featureOneComponent() : FeatureOneComponent.Factory 35 | 36 | // Save the reference of factories in the app component for creating sub components 37 | fun featureTwoComponent() : FeatureTwoComponent.Factory 38 | 39 | // Save the reference of factories in the app component for creating sub components 40 | fun featureThreeComponent() : FeatureThreeComponent.Factory 41 | 42 | } -------------------------------------------------------------------------------- /app/src/main/java/com/ysfcyln/daggermultimodule/di/DiProvider.kt: -------------------------------------------------------------------------------- 1 | package com.ysfcyln.daggermultimodule.di 2 | 3 | import android.app.Application 4 | 5 | object DiProvider { 6 | private lateinit var appComponent: AppComponent 7 | 8 | @JvmStatic 9 | fun appComponent() = appComponent 10 | 11 | fun buildDi(application: Application) { 12 | appComponent = DaggerAppComponent.factory().create(application) 13 | } 14 | } -------------------------------------------------------------------------------- /app/src/main/java/com/ysfcyln/daggermultimodule/di/SubComponents.kt: -------------------------------------------------------------------------------- 1 | package com.ysfcyln.daggermultimodule.di 2 | 3 | import com.ysfcyln.daggermultimodule.di.main.MainComponent 4 | import com.ysfcyln.daggermultimodule.di.main.MainComponentProvider 5 | import com.ysfcyln.feature_one.di.FeatureOneComponent 6 | import com.ysfcyln.feature_one.di.FeatureOneComponentProvider 7 | import com.ysfcyln.feature_three.di.FeatureThreeComponent 8 | import com.ysfcyln.feature_three.di.FeatureThreeComponentProvider 9 | import com.ysfcyln.feature_two.di.FeatureTwoComponent 10 | import com.ysfcyln.feature_two.di.FeatureTwoComponentProvider 11 | 12 | interface SubComponents: MainComponentProvider, FeatureOneComponentProvider, FeatureTwoComponentProvider, 13 | FeatureThreeComponentProvider { 14 | 15 | override fun provideMainComponent(): MainComponent { 16 | return DiProvider.appComponent().mainComponent().create() 17 | } 18 | 19 | override fun provideFeatureOneComponent(): FeatureOneComponent { 20 | return DiProvider.appComponent().featureOneComponent().create() 21 | } 22 | 23 | override fun provideFeatureTwoComponent(): FeatureTwoComponent { 24 | return DiProvider.appComponent().featureTwoComponent().create() 25 | } 26 | 27 | override fun provideFeatureThreeComponent(): FeatureThreeComponent { 28 | return DiProvider.appComponent().featureThreeComponent().create() 29 | } 30 | } -------------------------------------------------------------------------------- /app/src/main/java/com/ysfcyln/daggermultimodule/di/SubComponentsModule.kt: -------------------------------------------------------------------------------- 1 | package com.ysfcyln.daggermultimodule.di 2 | 3 | import com.ysfcyln.daggermultimodule.di.main.MainComponent 4 | import com.ysfcyln.feature_one.di.FeatureOneComponent 5 | import com.ysfcyln.feature_three.di.FeatureThreeComponent 6 | import com.ysfcyln.feature_two.di.FeatureTwoComponent 7 | import dagger.Module 8 | 9 | /** 10 | * Associate SubComponents with AppComponent 11 | */ 12 | @Module( 13 | subcomponents = [ 14 | MainComponent::class, 15 | FeatureOneComponent::class, 16 | FeatureTwoComponent::class, 17 | FeatureThreeComponent::class 18 | ] 19 | ) 20 | class SubComponentsModule { 21 | } -------------------------------------------------------------------------------- /app/src/main/java/com/ysfcyln/daggermultimodule/di/main/MainComponent.kt: -------------------------------------------------------------------------------- 1 | package com.ysfcyln.daggermultimodule.di.main 2 | 3 | import com.ysfcyln.daggermultimodule.MainActivity 4 | import dagger.Subcomponent 5 | 6 | @Subcomponent( 7 | modules = [ 8 | // Bounded main activity necessary modules comes here 9 | ] 10 | ) 11 | interface MainComponent { 12 | 13 | @Subcomponent.Factory 14 | interface Factory { 15 | fun create() : MainComponent 16 | } 17 | 18 | fun inject(mainActivity: MainActivity) // Add main activity to Dagger graph 19 | 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/ysfcyln/daggermultimodule/di/main/MainComponentProvider.kt: -------------------------------------------------------------------------------- 1 | package com.ysfcyln.daggermultimodule.di.main 2 | 3 | interface MainComponentProvider { 4 | fun provideMainComponent(): MainComponent 5 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 |