This commit is contained in:
2026-02-27 12:50:54 +03:00
commit c6c8897cb4
105 changed files with 2935 additions and 0 deletions

1
app/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/build

83
app/build.gradle.kts Normal file
View File

@@ -0,0 +1,83 @@
plugins {
id("com.android.application")
id("kotlin-android")
id("org.jetbrains.kotlin.android")
id("com.google.dagger.hilt.android")
id("com.google.devtools.ksp")
}
android {
compileSdk = Config.SdkVersion.COMPILE
namespace = "com.testapp.test"
defaultConfig {
applicationId = "com.testapp.test"
minSdk = Config.SdkVersion.MIN
targetSdk = Config.SdkVersion.COMPILE
versionCode = System.getenv("BUILD_NUMBER")?.toInt() ?: Config.Version.CODE
versionName = Config.Version.NAME
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}
buildTypes {
getByName(BuildType.DEBUG) {
isDebuggable = true
isMinifyEnabled = false
}
create(BuildType.STAGING) {
isDebuggable = true
isMinifyEnabled = true
isShrinkResources = true
}
getByName(BuildType.RELEASE) {
isDebuggable = false
isMinifyEnabled = true
isShrinkResources = true
}
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
buildFeatures {
viewBinding = true
}
lint {
abortOnError = false
}
// kapt block удаляем при переходе на KSP
}
dependencies {
implementation(fileTree("dir" to "libs", "include" to listOf("*.jar", "*.aar")))
// Modules
implementation(project(":style"))
implementation(project(":presentation"))
implementation(project(":data"))
implementation(project(":domain:domain"))
implementation(project(":domain:domain_impl"))
implementation(libs.appcompat)
implementation(libs.material)
implementation(libs.activity.ktx)
implementation(libs.core.ktx)
implementation(libs.fragment.ktx)
implementation(libs.splashscreen)
implementation(libs.hilt.android)
ksp(libs.hilt.compiler)
debugImplementation(libs.leakcanary)
coreLibraryDesugaring(libs.desugar.jdk.libs)
}

21
app/proguard-rules.pro vendored Normal file
View File

@@ -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.kts.
#
# 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

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name="com.example.testproject.application.WeatherApp"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.TestProject"
tools:targetApi="31">
</application>
</manifest>

View File

@@ -0,0 +1,8 @@
package com.example.testproject.application
import android.app.Application
import dagger.hilt.android.HiltAndroidApp
@HiltAndroidApp
class WeatherApp : Application() {
}

View File

@@ -0,0 +1,32 @@
package com.example.testproject.di.modules
import com.testapp.data.api.RemoteWeatherDataSourceImpl
import com.testapp.data.api.RestClient
import com.testapp.data.api.RestClientImpl
import com.testapp.data.datasource.LocalWeatherStorage
import com.testapp.data.datasource.RemoteWeatherDataSource
import com.testapp.data.db.LocalWeatherStorageImpl
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
interface DataSourceModule {
@Singleton
@Binds
fun restClient(impl: RestClientImpl): RestClient
@Singleton
@Binds
fun localWeatherStorage(impl: LocalWeatherStorageImpl): LocalWeatherStorage
@Singleton
@Binds
fun weatherApi(impl: RemoteWeatherDataSourceImpl): RemoteWeatherDataSource
}

View File

@@ -0,0 +1,20 @@
package com.example.testproject.di.modules
import com.testapp.data.gatway.WeatherGateWayImpl
import com.testapp.domain.domain.gatway.WeatherGateWay
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
interface GateWayModule {
@Singleton
@Binds
fun bindGateWay(impl: WeatherGateWayImpl): WeatherGateWay
}

View File

@@ -0,0 +1,37 @@
package com.example.testproject.di.modules
import com.testapp.domain.domain.usecase.GetWeather
import com.testapp.domain.domain.usecase.GetWeatherList
import com.testapp.domain.domain.usecase.RequestNewWeather
import com.testapp.domain.usecase.RequestNewWeatherImpl
import com.testapp.domain.domain.usecase.SaveWeather
import com.testapp.domain.usecase.GetWeatherImpl
import com.testapp.domain.usecase.GetWeatherListImpl
import com.testapp.domain.usecase.SaveWeatherImpl
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
interface UseCaseWeather {
@Binds
@Singleton
fun getWeather(impl: GetWeatherImpl): GetWeather
@Binds
@Singleton
fun requestNewWeather(impl: RequestNewWeatherImpl): RequestNewWeather
@Binds
@Singleton
fun getWeatherList(impl: GetWeatherListImpl): GetWeatherList
@Binds
@Singleton
fun saveWeatherImpl(impl: SaveWeatherImpl): SaveWeather
}