-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
52 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/example/komoriwu/kotlintest/component/ArticleComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.example.komoriwu.kotlintest.component | ||
|
||
import android.content.Context | ||
import com.example.komoriwu.kotlintest.article.MainActivity | ||
import com.example.komoriwu.kotlintest.article.view.ArticleView | ||
import com.example.komoriwu.kotlintest.module.ArticleModule | ||
import dagger.Component | ||
|
||
/** | ||
* Created by KomoriWu | ||
* on 2017-06-05. | ||
*/ | ||
|
||
@Component(modules = arrayOf(ArticleModule::class)) | ||
interface ArticleComponent { | ||
fun inject(mainActivity: MainActivity) | ||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/example/komoriwu/kotlintest/module/ArticleModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.example.komoriwu.kotlintest.module | ||
|
||
import android.content.Context | ||
import com.example.komoriwu.kotlintest.article.presenter.ArticlePresenter | ||
import com.example.komoriwu.kotlintest.article.presenter.ArticlePresenterImpl | ||
import com.example.komoriwu.kotlintest.article.view.ArticleView | ||
import dagger.Module | ||
import dagger.Provides | ||
|
||
/** | ||
* Created by KomoriWu | ||
* on 2017-06-05. | ||
*/ | ||
@Module | ||
class ArticleModule(private var mContext: Context, | ||
private var mArticleView: ArticleView) { | ||
@Provides | ||
fun providePresenter(): ArticlePresenter { | ||
return ArticlePresenterImpl(mContext, mArticleView) | ||
} | ||
} |