Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions app/build.gradle

This file was deleted.

47 changes: 47 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
plugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-kapt")
}

android {
compileSdk = rootProject.extra["compileSdkVersion"] as Int

defaultConfig {
applicationId = "com.mironchik.multimodule"
minSdk = rootProject.extra["minSdkVersion"] as Int
versionCode = 1
versionName = "1.0"
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro")
}
}

compileOptions {
sourceCompatibility = rootProject.extra["javaCompatibility"] as JavaVersion
targetCompatibility = rootProject.extra["javaCompatibility"] as JavaVersion
}

kotlinOptions {
jvmTarget = "17"
}

namespace = "com.mironchik.multimodule"
}

dependencies {
implementation(project(":modules:core:api_factory"))
implementation(project(":modules:features:producer_impl"))
implementation(project(":modules:features:receiver_impl"))
implementation(project(":modules:features:screen"))

implementation(platform(project(":modules:platform")))
implementation("com.google.dagger:dagger")
kapt("com.google.dagger:dagger-compiler:2.52")
}
14 changes: 3 additions & 11 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="ru.otus.daggerhomework">
xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.DaggerHomework">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
android:theme="@style/Theme.DaggerHomework"/>

</manifest>
6 changes: 0 additions & 6 deletions app/src/main/java/ru/otus/daggerhomework/App.kt

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions app/src/main/java/ru/otus/daggerhomework/ColorGenerator.kt

This file was deleted.

26 changes: 0 additions & 26 deletions app/src/main/java/ru/otus/daggerhomework/FragmentProducer.kt

This file was deleted.

31 changes: 0 additions & 31 deletions app/src/main/java/ru/otus/daggerhomework/FragmentReceiver.kt

This file was deleted.

12 changes: 0 additions & 12 deletions app/src/main/java/ru/otus/daggerhomework/MainActivity.kt

This file was deleted.

16 changes: 0 additions & 16 deletions app/src/main/java/ru/otus/daggerhomework/ViewModelProducer.kt

This file was deleted.

15 changes: 0 additions & 15 deletions app/src/main/java/ru/otus/daggerhomework/ViewModelReceiver.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.mironchik.multimodule

import com.mironchik.multimodule.core.api.AggregatingProvider
import com.mironchik.multimodule.core.api.CoreProvider
import com.mironchik.multimodule.features.producer_impl.ProducerModuleExternal
import com.mironchik.multimodule.features.receiver_impl.ReceiverModuleExternal
import dagger.Component
import javax.inject.Singleton

@Singleton
@Component(
dependencies = [CoreProvider::class],
modules = [ProducerModuleExternal::class, ReceiverModuleExternal::class]
)
interface AggregatingComponent : AggregatingProvider {
@Component.Factory
interface Factory {
fun create(rootProvider: CoreProvider): AggregatingComponent
}
}
12 changes: 12 additions & 0 deletions app/src/main/kotlin/com/mironchik/multimodule/App.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.mironchik.multimodule

import android.app.Application
import com.mironchik.multimodule.core.api.AggregatingHolder
import com.mironchik.multimodule.core.api.AggregatingProvider
import com.mironchik.multimodule.core.api_factory.CoreFactory

class App : Application(), AggregatingHolder {
override val aggregatingProvider: AggregatingProvider by lazy {
DaggerAggregatingComponent.factory().create(CoreFactory.create(this))
}
}
26 changes: 15 additions & 11 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
tools:context=".MainActivity"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<FrameLayout
android:id="@+id/fragment_producer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"/>

</androidx.constraintlayout.widget.ConstraintLayout>
<FrameLayout
android:id="@+id/fragment_receiver"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"/>

</LinearLayout>
23 changes: 0 additions & 23 deletions build.gradle

This file was deleted.

23 changes: 23 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath("com.android.tools.build:gradle:8.5.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.21")
}
}

val namespace by extra { "com.mironchik.multimodule" }
val compileSdkVersion by extra { 34 }
val minSdkVersion by extra { 23 }
val targetSdkVersion by extra { 34 }
val javaCompatibility by extra { JavaVersion.VERSION_17 }

allprojects {
repositories {
mavenCentral()
google()
}
}
Loading