-
Notifications
You must be signed in to change notification settings - Fork 0
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 #3 from AnteeOne/feature/add_new_modules
feature: implement new core and common modules
- Loading branch information
Showing
65 changed files
with
790 additions
and
63 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
17 changes: 16 additions & 1 deletion
17
app/src/main/java/tech/antee/compose_multimodule_template/MyApplication.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 |
---|---|---|
@@ -1,5 +1,20 @@ | ||
package tech.antee.compose_multimodule_template | ||
|
||
import android.app.Application | ||
import tech.antee.compose_multimodule_template.di.AppProvider | ||
|
||
class MyApplication : Application() | ||
// TODO("Implement your app") | ||
class MyApplication : Application() { | ||
|
||
lateinit var appProvider: AppProvider | ||
|
||
// override fun onCreate() { | ||
// super.onCreate() | ||
// appProvider = DaggerMyApplicationComponent.factory().create(this).apply { | ||
// inject(this@App) | ||
// } | ||
// } | ||
} | ||
|
||
val Application.appProvider: AppProvider | ||
get() = (this as MyApplication).appProvider |
24 changes: 24 additions & 0 deletions
24
app/src/main/java/tech/antee/compose_multimodule_template/di/AppComponent.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,24 @@ | ||
package tech.antee.compose_multimodule_template.di | ||
|
||
import android.content.Context | ||
import dagger.BindsInstance | ||
import dagger.Component | ||
import tech.antee.compose_multimodule_template.MyApplication | ||
import tech.antee.compose_multimodule_template.di.qualifiers.ApplicationContext | ||
import javax.inject.Singleton | ||
|
||
@Singleton | ||
@Component(modules = [AppModule::class, FeaturesModule::class]) | ||
interface AppComponent : AppProvider { | ||
|
||
fun inject(app: MyApplication) | ||
|
||
@Component.Factory | ||
interface Factory { | ||
fun create( | ||
@BindsInstance | ||
@ApplicationContext | ||
context: Context | ||
): AppComponent | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/tech/antee/compose_multimodule_template/di/AppModule.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,9 @@ | ||
package tech.antee.compose_multimodule_template.di | ||
|
||
import dagger.Module | ||
import tech.antee.compose_multimodule_template.data.di.DataModule | ||
|
||
@Module( | ||
includes = [DataModule::class] | ||
) | ||
interface AppModule |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/tech/antee/compose_multimodule_template/di/AppProvider.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,10 @@ | ||
package tech.antee.compose_multimodule_template.di | ||
|
||
import androidx.compose.runtime.compositionLocalOf | ||
import tech.antee.compose_multimodule_template.multi_compose.Destinations | ||
|
||
interface AppProvider { | ||
val destinations: Destinations | ||
} | ||
|
||
val LocalAppProvider = compositionLocalOf<AppProvider> { error("No app provider found!") } |
8 changes: 8 additions & 0 deletions
8
app/src/main/java/tech/antee/compose_multimodule_template/di/FeaturesModule.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,8 @@ | ||
package tech.antee.compose_multimodule_template.di | ||
|
||
import dagger.Module | ||
|
||
@Module( | ||
includes = [] | ||
) | ||
interface FeaturesModule |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
object Modules { | ||
const val app = ":app" | ||
|
||
const val commonMultiCompose = ":common:multi_compose" | ||
const val commonUiComponents = ":common:ui-components" | ||
const val coreUi = ":core:ui" | ||
const val coreUtils = ":core:utils" | ||
const val coreStrings = ":core:strings" | ||
|
||
const val commonDomain = ":common:domain" | ||
const val commonData = ":common:data" | ||
const val commonDataRemote = ":common:data-remote" | ||
const val commonDataLocal = ":common:data-local" | ||
const val commonDi = ":common:di" | ||
const val commonUi = ":common:ui" | ||
const val commonUiComponents = ":common:ui-components" | ||
const val commonMultiCompose = ":common:multi-compose" | ||
} |
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 @@ | ||
/build |
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,22 @@ | ||
plugins { | ||
id(Plugins.androidLibrary) | ||
id(Plugins.androidBase) | ||
id(Plugins.kotlinKapt) | ||
} | ||
|
||
dependencies { | ||
projectImplementation(Modules.coreUtils) | ||
projectApi(Modules.commonDomain) | ||
projectImplementation(Modules.commonDi) | ||
|
||
implementation(Deps.appCompat) | ||
implementation(Deps.coreKtx) | ||
implementation(Deps.Coroutines.kotlinCore) | ||
|
||
implementation(Deps.Local.room) | ||
implementation(Deps.Local.roomKtx) | ||
kapt(Deps.Local.roomKapt) | ||
|
||
implementation(Deps.Dagger.core) | ||
kapt(Deps.Dagger.compiler) | ||
} |
Empty file.
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 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
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,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="tech.antee.compose_multimodule_template.data.local"> | ||
|
||
</manifest> |
6 changes: 6 additions & 0 deletions
6
...data-local/src/main/java/tech/antee/compose_multimodule_template/data/local/dao/AppDao.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,6 @@ | ||
package tech.antee.compose_multimodule_template.data.local.dao | ||
|
||
import androidx.room.Dao | ||
|
||
@Dao | ||
interface AppDao |
20 changes: 20 additions & 0 deletions
20
...-local/src/main/java/tech/antee/compose_multimodule_template/data/local/db/AppDatabase.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,20 @@ | ||
package tech.antee.compose_multimodule_template.data.local.db | ||
|
||
import androidx.room.Database | ||
import androidx.room.RoomDatabase | ||
import tech.antee.compose_multimodule_template.data.local.dao.AppDao | ||
|
||
@Database( | ||
entities = [], | ||
version = 1 | ||
) | ||
abstract class AppDatabase : RoomDatabase() { | ||
abstract fun appDao(): AppDao | ||
|
||
|
||
companion object { | ||
const val NAME = "app-database" | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.