-
Notifications
You must be signed in to change notification settings - Fork 1
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 #44 from stslex/dev
Dev
- Loading branch information
Showing
107 changed files
with
999 additions
and
669 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,19 +1,16 @@ | ||
import java.io.FileInputStream | ||
import java.io.InputStreamReader | ||
import java.util.Properties | ||
|
||
plugins { | ||
id("notes.android.application") | ||
id("notes.android.application.compose") | ||
} | ||
|
||
android.namespace = "com.stslex93.notes" | ||
|
||
dependencies { | ||
implementation(project(":core:core")) | ||
implementation(project(":core:ui")) | ||
implementation(project(":core:database")) | ||
implementation(project(":core:notes")) | ||
implementation(project(":core:navigation")) | ||
implementation(project(":feature:home")) | ||
implementation(project(":feature:edit")) | ||
} | ||
|
||
android.namespace = "com.stslex93.notes" |
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,31 +1,25 @@ | ||
package com.stslex93.notes | ||
|
||
import android.app.Application | ||
import com.stslex93.notes.core.database.coreDatabaseModule | ||
import com.stslex93.notes.core.notes.di.coreNotesModule | ||
import com.stslex93.notes.feature.edit.di.featureEditModule | ||
import com.stslex93.notes.feature.home.di.featureHomeModule | ||
import org.koin.android.ext.koin.androidContext | ||
import org.koin.android.ext.koin.androidLogger | ||
import org.koin.core.context.startKoin | ||
import com.stslex93.notes.core.core.AppApi | ||
import com.stslex93.notes.core.core.ApplicationApi | ||
import com.stslex93.notes.di.app.AppComponent | ||
import com.stslex93.notes.di.app.DaggerAppComponent | ||
|
||
class NoteApplication : Application() { | ||
class NoteApplication : Application(), ApplicationApi { | ||
|
||
override fun onCreate() { | ||
setUpKoin() | ||
super.onCreate() | ||
private val appComponent: AppComponent by lazy { | ||
DaggerAppComponent | ||
.builder() | ||
.context(this) | ||
.build() | ||
} | ||
|
||
private fun setUpKoin() { | ||
startKoin { | ||
androidLogger() | ||
androidContext(this@NoteApplication) | ||
modules( | ||
coreDatabaseModule, | ||
coreNotesModule, | ||
featureEditModule, | ||
featureHomeModule, | ||
) | ||
} | ||
override val appApi: AppApi | ||
get() = appComponent | ||
|
||
override fun onCreate() { | ||
appComponent.inject(this) | ||
super.onCreate() | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
app/src/main/java/com/stslex93/notes/di/app/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 com.stslex93.notes.di.app | ||
|
||
import android.content.Context | ||
import com.stslex93.notes.NoteApplication | ||
import com.stslex93.notes.core.core.AppApi | ||
import dagger.BindsInstance | ||
import dagger.Component | ||
import javax.inject.Singleton | ||
|
||
@Singleton | ||
@Component | ||
interface AppComponent : AppApi { | ||
|
||
@Component.Builder | ||
interface Builder { | ||
|
||
@BindsInstance | ||
fun context(context: Context): Builder | ||
|
||
fun build(): AppComponent | ||
} | ||
|
||
fun inject(application: NoteApplication) | ||
} |
27 changes: 27 additions & 0 deletions
27
app/src/main/java/com/stslex93/notes/di/main/MainComponent.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,27 @@ | ||
package com.stslex93.notes.di.main | ||
|
||
import com.stslex93.notes.core.core.AppApi | ||
import com.stslex93.notes.core.ui.di.NavigationApi | ||
import dagger.Component | ||
|
||
@Component(dependencies = [MainDependencies::class]) | ||
interface MainComponent { | ||
|
||
@Component.Factory | ||
interface Factory { | ||
fun create(dependencies: MainDependencies): MainComponent | ||
} | ||
|
||
@Component(dependencies = [AppApi::class, NavigationApi::class]) | ||
interface MainDependenciesComponent : MainDependencies { | ||
|
||
@Component.Factory | ||
interface Factory { | ||
fun create( | ||
appApi: AppApi, | ||
navigationApi: NavigationApi | ||
): MainDependenciesComponent | ||
} | ||
} | ||
} | ||
|
32 changes: 32 additions & 0 deletions
32
app/src/main/java/com/stslex93/notes/di/main/MainComponentBuilder.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,32 @@ | ||
package com.stslex93.notes.di.main | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.platform.LocalContext | ||
import com.stslex93.notes.core.core.AppApi | ||
import com.stslex93.notes.core.core.appApi | ||
import com.stslex93.notes.core.ui.di.NavigationApi | ||
|
||
object MainComponentBuilder { | ||
|
||
fun build( | ||
appApi: AppApi, | ||
navigationApi: NavigationApi | ||
): MainComponent = DaggerMainComponent | ||
.factory() | ||
.create( | ||
DaggerMainComponent_MainDependenciesComponent.factory() | ||
.create( | ||
appApi = appApi, | ||
navigationApi = navigationApi | ||
) | ||
) | ||
|
||
@Composable | ||
fun Build(navigationApi: NavigationApi) { | ||
val context = LocalContext.current | ||
build( | ||
appApi = context.appApi, | ||
navigationApi = navigationApi | ||
) | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
app/src/main/java/com/stslex93/notes/di/main/MainDependencies.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 com.stslex93.notes.di.main | ||
|
||
import com.stslex93.notes.core.ui.di.Navigator | ||
|
||
interface MainDependencies { | ||
|
||
val navigator: Navigator | ||
} |
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 was deleted.
Oops, something went wrong.
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
68 changes: 0 additions & 68 deletions
68
app/src/test/java/com/stslex93/notes/data/di/AppModuleTest.kt
This file was deleted.
Oops, something went wrong.
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,4 +1,4 @@ | ||
object AppVersion { | ||
const val VERSION_CODE = 12 | ||
const val VERSION_NAME = "1.12" | ||
const val VERSION_CODE = 16 | ||
const val VERSION_NAME = "1.16" | ||
} |
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 |
---|---|---|
@@ -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,5 @@ | ||
plugins { | ||
id("notes.android.library") | ||
} | ||
|
||
android.namespace = "com.stslex93.notes.core.core" |
Empty file.
Oops, something went wrong.