diff --git a/.gitignore b/.gitignore index e1f51e7..2cc2b0c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,10 @@ .externalNativeBuild /.idea + +### Store key ### +*.jks + ### Android ### # Built application files *.apk diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a15a8fb..b2e4cef 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,3 +1,8 @@ + +import java.io.FileInputStream +import java.util.Properties +import kotlin.apply + plugins { id("com.android.application") id("org.jetbrains.kotlin.android") @@ -14,12 +19,24 @@ android { applicationId = "com.developer.valyutaapp" minSdk = 21 targetSdk = 34 - versionCode = 20 - versionName = "2.5.9" + versionCode = 21 + versionName = "2.6.0" vectorDrawables.useSupportLibrary = true testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" multiDexEnabled = true } + + val prop = Properties().apply { + load(FileInputStream(File(rootProject.rootDir, "local.properties"))) + } + + signingConfigs.create("release") { + storeFile = file("store_key.jks") + storePassword = prop.getProperty("KEYSTORE_PASSWORD") + keyAlias = prop.getProperty("KEY_ALIAS") + keyPassword = prop.getProperty("KEY_PASSWORD") + } + buildTypes { debug { isMinifyEnabled = false @@ -28,15 +45,65 @@ android { } release { isMinifyEnabled = false + signingConfig = signingConfigs.getByName("release") proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") } } + val googlePlay = "https://play.google.com/store/apps/dev?id=5402022606902660683" + val appGallery = + "https://appgallery.huawei.ru/#/tab/appdetailCommon%7CC109579467%7Cautomore%7Cdoublecolumncardwithstar%7C903547" + val ruStore = "https://www.rustore.ru/catalog/developer/ktgto9" + + sourceSets { + named("main") { + java.srcDir("src/main/java") + java.srcDir("src/huawei/java") + java.srcDir("src/rustore/java") + } + create("google").manifest.srcFile("src/google/AndroidManifest.xml") + create("huawei").manifest.srcFile("src/huawei/AndroidManifest.xml") + create("rustore").manifest.srcFile("src/rustore/AndroidManifest.xml") + } + + flavorDimensions += listOf("bundle", "type", "store") + + productFlavors { + // Bundles: + create("currency") { + dimension = "bundle" + applicationId = "com.developer.valyutaapp" + } + + // Types: + create("prod") { + dimension = "type" + } + + create("google") { + dimension = "store" + buildConfigField("String", "MARKET_URL", "\"$googlePlay\"") + } + create("huawei") { + versionNameSuffix = ".hms" + dimension = "store" + buildConfigField("String", "MARKET_URL", "\"$appGallery\"") + } + create("rustore") { + versionNameSuffix = ".ru" + dimension = "store" + buildConfigField("String", "MARKET_URL", "\"$ruStore\"") + } + } + compileOptions { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 + sourceCompatibility = JavaVersion.VERSION_19 + targetCompatibility = JavaVersion.VERSION_19 } + kotlin.jvmToolchain(19) + kotlinOptions.jvmTarget = "19" + buildFeatures.viewBinding = true buildFeatures.buildConfig = true namespace = "com.developer.currency" @@ -58,8 +125,8 @@ dependencies { implementation("com.github.kirich1409:viewbindingpropertydelegate-noreflection:1.5.9") - implementation("androidx.navigation:navigation-fragment-ktx:2.8.3") - implementation("androidx.navigation:navigation-ui-ktx:2.8.3") + implementation("androidx.navigation:navigation-fragment-ktx:2.8.4") + implementation("androidx.navigation:navigation-ui-ktx:2.8.4") // Logging: api("com.jakewharton.timber:timber:5.0.1") @@ -97,9 +164,9 @@ dependencies { implementation("com.github.PhilJay:MPAndroidChart:v3.1.0") - implementation("com.yandex.android:mobileads:7.6.0") + implementation("com.yandex.android:mobileads:7.7.0") - implementation(platform("com.google.firebase:firebase-bom:33.5.1")) + implementation(platform("com.google.firebase:firebase-bom:33.6.0")) implementation("com.google.firebase:firebase-crashlytics-ktx:19.2.1") implementation("com.google.firebase:firebase-analytics-ktx:22.1.2") } \ No newline at end of file diff --git a/app/src/main/java/com/developer/currency/core/base/BaseAdapter.kt b/app/src/main/java/com/developer/currency/core/base/BaseAdapter.kt index 446c285..735b13f 100644 --- a/app/src/main/java/com/developer/currency/core/base/BaseAdapter.kt +++ b/app/src/main/java/com/developer/currency/core/base/BaseAdapter.kt @@ -22,9 +22,7 @@ class BaseAdapter(private val bases: List>) : } override fun onBindViewHolder( - holder: BaseViewHolder, - position: Int, - payloads: MutableList + holder: BaseViewHolder, position: Int, payloads: MutableList ) { if (payloads.isEmpty()) { super.onBindViewHolder(holder, position, payloads) diff --git a/app/src/main/java/com/developer/currency/di/modules/Module.kt b/app/src/main/java/com/developer/currency/di/modules/Module.kt index 6c841b3..bb4244c 100644 --- a/app/src/main/java/com/developer/currency/di/modules/Module.kt +++ b/app/src/main/java/com/developer/currency/di/modules/Module.kt @@ -37,21 +37,21 @@ import okhttp3.OkHttpClient import okhttp3.logging.HttpLoggingInterceptor import org.koin.android.ext.koin.androidApplication import org.koin.android.ext.koin.androidContext -import org.koin.androidx.viewmodel.dsl.viewModel +import org.koin.core.module.dsl.viewModelOf import org.koin.dsl.module import retrofit2.Retrofit import retrofit2.converter.simplexml.SimpleXmlConverterFactory import java.util.concurrent.TimeUnit val viewModelModule = module { - viewModel { MainViewModel(get()) } - viewModel { HomeViewModel(get()) } - viewModel { ConverterViewModel(get()) } - viewModel { AllValutesViewModel(get()) } - viewModel { NetworkStatusViewModel() } - viewModel { ChartViewModel(get(), get()) } - viewModel { WidgetViewModel(get()) } - viewModel { SettingsViewModel() } + viewModelOf(::MainViewModel) + viewModelOf(::HomeViewModel) + viewModelOf(::ConverterViewModel) + viewModelOf(::AllValutesViewModel) + viewModelOf(::NetworkStatusViewModel) + viewModelOf(::ChartViewModel) + viewModelOf(::WidgetViewModel) + viewModelOf(::SettingsViewModel) } val sharedPreference = module { diff --git a/build.gradle.kts b/build.gradle.kts index 01d6eef..b651792 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,9 +1,9 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { id("com.android.application") version "8.7.2" apply false - id("org.jetbrains.kotlin.android") version "2.0.20" apply false - id("com.google.devtools.ksp") version "2.0.20-1.0.24" apply false - id("androidx.navigation.safeargs") version "2.8.3" apply false + id("org.jetbrains.kotlin.android") version "2.0.21" apply false + id("com.google.devtools.ksp") version "2.0.21-1.0.28" apply false + id("androidx.navigation.safeargs") version "2.8.4" apply false id("com.google.gms.google-services") version "4.4.2" apply false id("com.google.firebase.crashlytics") version "3.0.2" apply false id("org.jlleitschuh.gradle.ktlint") version "12.1.1" apply false diff --git a/docs/11.png b/docs/11.png new file mode 100644 index 0000000..dda6c60 Binary files /dev/null and b/docs/11.png differ diff --git a/docs/22.png b/docs/22.png new file mode 100644 index 0000000..a7dbc3a Binary files /dev/null and b/docs/22.png differ diff --git a/docs/33.png b/docs/33.png new file mode 100644 index 0000000..e100a56 Binary files /dev/null and b/docs/33.png differ diff --git a/docs/44.png b/docs/44.png new file mode 100644 index 0000000..2885857 Binary files /dev/null and b/docs/44.png differ diff --git a/docs/55.png b/docs/55.png new file mode 100644 index 0000000..992ebce Binary files /dev/null and b/docs/55.png differ