Skip to content

Commit b54130e

Browse files
committed
first commit
0 parents  commit b54130e

File tree

157 files changed

+1505
-0
lines changed

Some content is hidden

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

157 files changed

+1505
-0
lines changed

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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

.idea/codeStyles/Project.xml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

android_commons.gradle

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apply plugin: 'kotlin-android'
2+
apply plugin: 'kotlin-android-extensions'
3+
4+
android {
5+
compileSdkVersion Versions.compileSdk
6+
defaultConfig {
7+
minSdkVersion Versions.minSdk
8+
targetSdkVersion Versions.targetSdk
9+
versionCode Releases.versionCode
10+
versionName Releases.versionName
11+
}
12+
buildTypes {
13+
release {
14+
minifyEnabled true
15+
}
16+
}
17+
}
18+
19+
dependencies {
20+
implementation KotlinLibraries.kotlin
21+
}

android_core_dependencies.gradle

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Shared dependencies between modules
3+
*/
4+
dependencies {
5+
// KOTLIN
6+
implementation KotlinLibraries.kotlin
7+
implementation KotlinLibraries.kotlinCoroutineCore
8+
implementation AndroidLibraries.kotlinCoroutineAndroid
9+
10+
// ANDROID
11+
implementation AndroidLibraries.appCompat
12+
implementation AndroidLibraries.materialDesign
13+
implementation AndroidLibraries.coreKtx
14+
implementation AndroidLibraries.constraintLayout
15+
implementation AndroidLibraries.lifecycleViewModel
16+
implementation AndroidLibraries.lifecycleExtensions
17+
implementation AndroidLibraries.recyclerView
18+
implementation AndroidLibraries.navigation
19+
implementation AndroidLibraries.navigationFrag
20+
}

android_feature_dependencies.gradle

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Feature dependencies
3+
*/
4+
apply plugin: 'com.android.library'
5+
apply from: '../../android_core_dependencies.gradle'
6+
apply from: '../../android_commons.gradle'
7+
8+
dependencies {
9+
implementation project(Modules.common)
10+
11+
implementation project(Modules.repository)
12+
implementation project(Modules.navigation)
13+
// TEST
14+
androidTestImplementation TestLibraries.androidTestRunner
15+
androidTestImplementation TestLibraries.junit
16+
androidTestImplementation project(Modules.commonTest)
17+
androidTestImplementation TestLibraries.mockkAndroid
18+
androidTestImplementation TestLibraries.fragmentNav
19+
androidTestImplementation TestLibraries.espresso
20+
androidTestImplementation TestLibraries.espressoContrib
21+
androidTestImplementation TestLibraries.koin
22+
androidTestImplementation TestLibraries.archCoreTest
23+
testImplementation TestLibraries.androidTestRunner
24+
testImplementation TestLibraries.junit
25+
testImplementation TestLibraries.mockk
26+
testImplementation TestLibraries.archCoreTest
27+
kaptAndroidTest TestLibraries.databinding
28+
testImplementation project(Modules.commonTest)
29+
}

android_test_dependencies.gradle

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
dependencies {
2+
// ANDROID TEST
3+
androidTestImplementation TestLibraries.androidTestRunner
4+
androidTestImplementation TestLibraries.espresso
5+
// ANDROID
6+
androidTestImplementation TestLibraries.archCoreTest
7+
androidTestImplementation TestLibraries.junit
8+
// MOCK
9+
androidTestImplementation TestLibraries.mockk
10+
}

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
apply plugin: 'com.android.application'
2+
apply plugin: 'kotlin-kapt'
3+
apply from: '../android_commons.gradle'
4+
android {
5+
defaultConfig {
6+
applicationId ApplicationId.id
7+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
8+
}
9+
dataBinding {
10+
enabled true
11+
}
12+
}
13+
14+
dependencies {
15+
implementation project(Modules.domain)
16+
implementation project(Modules.presentation)
17+
implementation project(Modules.data)
18+
19+
implementation Libraries.dagger
20+
implementation Libraries.daggerAndroid
21+
implementation Libraries.daggerAndroidSupport
22+
kapt Libraries.daggerCompiler
23+
kapt Libraries.daggerProcessor
24+
25+
implementation Libraries.retrofitCoroutineAdapter
26+
implementation Libraries.gson
27+
implementation Libraries.retrofit
28+
implementation Libraries.retrofitGsonConverter
29+
implementation Libraries.httpLoggingInterceptor
30+
}

app/proguard-rules.pro

+21
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.sample_coroutine_android
2+
3+
import androidx.test.InstrumentationRegistry
4+
import androidx.test.runner.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.getTargetContext()
22+
assertEquals("com.sample_coroutine_android", appContext.packageName)
23+
}
24+
}

app/src/main/AndroidManifest.xml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
package="com.sample_coroutine_android">
5+
6+
<application
7+
android:name=".MinDevApplication"
8+
android:allowBackup="true"
9+
android:icon="@mipmap/ic_launcher"
10+
android:label="@string/app_name"
11+
android:roundIcon="@mipmap/ic_launcher_round"
12+
android:supportsRtl="true"
13+
android:theme="@style/AppTheme"
14+
tools:ignore="GoogleAppIndexingWarning">
15+
<activity android:name="com.mindev.presentation.ui.main.MainActivity">
16+
<intent-filter>
17+
<action android:name="android.intent.action.MAIN" />
18+
19+
<category android:name="android.intent.category.LAUNCHER" />
20+
</intent-filter>
21+
</activity>
22+
</application>
23+
24+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.sample_coroutine_android
2+
3+
import android.app.Activity
4+
import android.app.Application
5+
import com.sample_coroutine_android.di.DaggerMindevComponent
6+
import dagger.android.AndroidInjector
7+
import dagger.android.DispatchingAndroidInjector
8+
import dagger.android.HasActivityInjector
9+
import javax.inject.Inject
10+
11+
class MinDevApplication : Application(), HasActivityInjector {
12+
13+
@Inject
14+
lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Activity>
15+
16+
override fun activityInjector(): AndroidInjector<Activity> = dispatchingAndroidInjector
17+
18+
override fun onCreate() {
19+
super.onCreate()
20+
DaggerMindevComponent.builder()
21+
.application(this)
22+
.build()
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.sample_coroutine_android.di
2+
3+
import com.sample_coroutine_android.MinDevApplication
4+
import com.sample_coroutine_android.di.module.ActivityBindingModule
5+
import com.sample_coroutine_android.di.module.NetWorkModule
6+
import com.sample_coroutine_android.di.module.ViewModelBindingModule
7+
import dagger.BindsInstance
8+
import dagger.Component
9+
import dagger.android.support.AndroidSupportInjectionModule
10+
import javax.inject.Singleton
11+
12+
@Singleton
13+
@Component(
14+
modules = [
15+
AndroidSupportInjectionModule::class,
16+
NetWorkModule::class,
17+
ViewModelBindingModule::class,
18+
ActivityBindingModule::class]
19+
)
20+
interface MindevComponent {
21+
@Component.Builder
22+
interface Builder {
23+
@BindsInstance
24+
fun application(app: MinDevApplication): Builder
25+
26+
fun build(): MindevComponent
27+
}
28+
29+
fun inject(app: MinDevApplication)
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.sample_coroutine_android.di.module
2+
3+
import com.mindev.presentation.ui.main.MainActivity
4+
import com.sample_coroutine_android.di.module.main.MainModule
5+
import com.sample_coroutine_android.di.qualifier.PerActivity
6+
import dagger.Module
7+
import dagger.android.ContributesAndroidInjector
8+
9+
@Module
10+
abstract class ActivityBindingModule {
11+
12+
@PerActivity
13+
@ContributesAndroidInjector
14+
abstract fun bindingMainActivity(): MainActivity
15+
}

0 commit comments

Comments
 (0)