Skip to content

Commit 0d3eaf3

Browse files
koin example added
1 parent 11fc092 commit 0d3eaf3

47 files changed

Lines changed: 1114 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

KoinAndroidExample/.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx

KoinAndroidExample/.idea/codeStyles/Project.xml

Lines changed: 122 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

KoinAndroidExample/.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

KoinAndroidExample/.idea/gradle.xml

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

KoinAndroidExample/.idea/misc.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

KoinAndroidExample/.idea/runConfigurations.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

KoinAndroidExample/app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
apply plugin: 'com.android.application'
2+
3+
apply plugin: 'kotlin-android'
4+
5+
apply plugin: 'kotlin-android-extensions'
6+
7+
android {
8+
compileSdkVersion 29
9+
buildToolsVersion "29.0.2"
10+
defaultConfig {
11+
applicationId "com.example.koinandroidexample"
12+
minSdkVersion 23
13+
targetSdkVersion 29
14+
versionCode 1
15+
versionName "1.0"
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17+
}
18+
buildTypes {
19+
release {
20+
minifyEnabled false
21+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22+
}
23+
}
24+
}
25+
26+
dependencies {
27+
implementation fileTree(dir: 'libs', include: ['*.jar'])
28+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
29+
implementation 'androidx.appcompat:appcompat:1.0.2'
30+
implementation 'androidx.core:core-ktx:1.0.2'
31+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
32+
testImplementation 'junit:junit:4.12'
33+
androidTestImplementation 'androidx.test:runner:1.1.1'
34+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
35+
36+
//koin
37+
implementation 'org.koin:koin-android:1.0.2'
38+
implementation 'org.koin:koin-android-viewmodel:1.0.2'
39+
implementation 'org.koin:koin-androidx-scope:1.0.2'
40+
41+
//ViewModel
42+
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0-alpha03'
43+
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.2.0-alpha02'
44+
45+
//retrofit
46+
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
47+
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.1'
48+
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
49+
implementation "com.squareup.retrofit2:adapter-rxjava2:2.4.0"
50+
implementation 'androidx.cardview:cardview:1.0.0'
51+
implementation 'androidx.recyclerview:recyclerview:1.0.0'
52+
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
53+
implementation 'io.reactivex.rxjava2:rxjava:2.0.3'
54+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.example.koinandroidexample
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.example.koinandroidexample", appContext.packageName)
23+
}
24+
}

0 commit comments

Comments
 (0)