-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from iamport/dev
Dev
- Loading branch information
Showing
21 changed files
with
264 additions
and
87 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
25 changes: 25 additions & 0 deletions
25
app/src/main/java/com/iamport/sampleapp/BaseApplication.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,25 @@ | ||
package com.iamport.sampleapp | ||
|
||
import android.app.Application | ||
import com.iamport.sdk.domain.core.Iamport | ||
import org.koin.android.ext.koin.androidContext | ||
import org.koin.android.logger.AndroidLogger | ||
import org.koin.core.context.startKoin | ||
import org.koin.core.logger.Level | ||
|
||
|
||
class BaseApplication : Application() { | ||
override fun onCreate() { | ||
super.onCreate() | ||
Iamport.create(this) | ||
|
||
/** | ||
* DI 로 KOIN 사용시 아래와 같이 사용 | ||
val koinApp = startKoin { | ||
logger(AndroidLogger(Level.DEBUG)) | ||
androidContext(this@BaseApplication) | ||
} | ||
Iamport.create(this, koinApp) | ||
*/ | ||
} | ||
} |
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
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
14 changes: 14 additions & 0 deletions
14
sdk/src/main/java/com/iamport/sdk/domain/di/IamportKoinComponent.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,14 @@ | ||
package com.iamport.sdk.domain.di | ||
|
||
import org.koin.core.Koin | ||
import org.koin.core.KoinApplication | ||
import org.koin.core.component.KoinComponent | ||
|
||
// lib module | ||
object IamportKoinContext { | ||
var koinApp: KoinApplication? = null | ||
} | ||
|
||
interface IamportKoinComponent : KoinComponent { | ||
override fun getKoin(): Koin = IamportKoinContext.koinApp?.koin!! | ||
} |
Oops, something went wrong.