From fb138c24127f8d47e400f29d2bef91c2a7cef7b6 Mon Sep 17 00:00:00 2001 From: Milan Date: Mon, 22 Jul 2024 15:24:14 +0200 Subject: [PATCH] [#234] AppCompat removal (#1509) * [#234] AppCompat removal Closes #234 * [#234] Crash fix Closes #234 * Changelog update --------- Co-authored-by: Honza --- CHANGELOG.md | 6 +++++- gradle.properties | 2 +- settings.gradle.kts | 4 ++-- ui-design-lib/build.gradle.kts | 1 + ui-lib/build.gradle.kts | 1 - .../src/main/java/co/electriccoin/zcash/ui/MainActivity.kt | 4 ++-- ui-lib/src/main/res/ui/common/values/themes.xml | 2 +- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66a6c632..091d81c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ and this application adheres to [Semantic Versioning](https://semver.org/spec/v2 - These release notes and release priority are both propagated to every new Google Play release using CI logic - Copying sensitive information like addresses, transaction IDs, or wallet secrets into the device clipboard is now masked out from the system visual confirmation, but it's still copied as expected. `ClipDescription.EXTRA_IS_SENSITIVE` -flag is used on Android SDK level 33 and higher, masking out the `Toast` text on levels below it. +flag is used on Android SDK level 33 and higher, masking out the `Toast` text on levels below it. +- `androidx.fragment:fragment-compose` dependency has been added ### Changed - The About screen has been redesigned to align with the new design guidelines @@ -30,6 +31,9 @@ flag is used on Android SDK level 33 and higher, masking out the `Toast` text on option has been added to the app's `AndroidManifest.xml`, leaving the configuration changes handling entirely to the Jetpack Compose layer. +## Removed +- `androidx.appcompat:appcompat` dependency has been removed + ## [1.1.3 (682)] - 2024-07-03 ### Added diff --git a/gradle.properties b/gradle.properties index 7f8b883d..2d0bae49 100644 --- a/gradle.properties +++ b/gradle.properties @@ -160,7 +160,6 @@ KTLINT_VERSION=1.2.1 ACCOMPANIST_PERMISSIONS_VERSION=0.34.0 ANDROIDX_ACTIVITY_VERSION=1.8.2 ANDROIDX_ANNOTATION_VERSION=1.7.1 -ANDROIDX_APPCOMPAT_VERSION=1.6.1 ANDROIDX_BIOMETRIC_VERSION=1.2.0-alpha05 ANDROIDX_CAMERA_VERSION=1.3.2 ANDROIDX_COMPOSE_COMPILER_VERSION=1.5.11 @@ -171,6 +170,7 @@ ANDROIDX_CONSTRAINTLAYOUT_VERSION=1.0.1 ANDROIDX_CORE_VERSION=1.12.0 ANDROIDX_ESPRESSO_VERSION=3.5.1 ANDROIDX_LIFECYCLE_VERSION=2.7.0 +ANDROIDX_FRAGMENT_VERSION=1.8.1 ANDROIDX_NAVIGATION_COMPOSE_VERSION=2.7.7 ANDROIDX_PROFILE_INSTALLER_VERSION=1.3.1 ANDROIDX_SECURITY_CRYPTO_VERSION=1.1.0-alpha06 diff --git a/settings.gradle.kts b/settings.gradle.kts index d61e6fa0..bc36c3ef 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -143,7 +143,6 @@ dependencyResolutionManagement { val accompanistPermissionsVersion = extra["ACCOMPANIST_PERMISSIONS_VERSION"].toString() val androidxActivityVersion = extra["ANDROIDX_ACTIVITY_VERSION"].toString() val androidxAnnotationVersion = extra["ANDROIDX_ANNOTATION_VERSION"].toString() - val androidxAppcompatVersion = extra["ANDROIDX_APPCOMPAT_VERSION"].toString() val androidxBiometricVersion = extra["ANDROIDX_BIOMETRIC_VERSION"].toString() val androidxCameraVersion = extra["ANDROIDX_CAMERA_VERSION"].toString() val androidxComposeCompilerVersion = extra["ANDROIDX_COMPOSE_COMPILER_VERSION"].toString() @@ -154,6 +153,7 @@ dependencyResolutionManagement { val androidxCoreVersion = extra["ANDROIDX_CORE_VERSION"].toString() val androidxEspressoVersion = extra["ANDROIDX_ESPRESSO_VERSION"].toString() val androidxLifecycleVersion = extra["ANDROIDX_LIFECYCLE_VERSION"].toString() + val androidxFragmentVersion = extra["ANDROIDX_FRAGMENT_VERSION"].toString() val androidxNavigationComposeVersion = extra["ANDROIDX_NAVIGATION_COMPOSE_VERSION"].toString() val androidxProfileInstallerVersion = extra["ANDROIDX_PROFILE_INSTALLER_VERSION"].toString() val androidxSecurityCryptoVersion = extra["ANDROIDX_SECURITY_CRYPTO_VERSION"].toString() @@ -193,7 +193,6 @@ dependencyResolutionManagement { library("androidx-activity", "androidx.activity:activity-ktx:$androidxActivityVersion") library("androidx-activity-compose", "androidx.activity:activity-compose:$androidxActivityVersion") library("androidx-annotation", "androidx.annotation:annotation:$androidxAnnotationVersion") - library("androidx-appcompat", "androidx.appcompat:appcompat:$androidxAppcompatVersion") library("androidx-biometric", "androidx.biometric:biometric:$androidxBiometricVersion") library("androidx-biometric-ktx", "androidx.biometric:biometric-ktx:$androidxBiometricVersion") library("androidx-camera", "androidx.camera:camera-camera2:$androidxCameraVersion") @@ -209,6 +208,7 @@ dependencyResolutionManagement { library("androidx-compose-compiler", "androidx.compose.compiler:compiler:$androidxComposeCompilerVersion") library("androidx-core", "androidx.core:core-ktx:$androidxCoreVersion") library("androidx-constraintlayout", "androidx.constraintlayout:constraintlayout-compose:$androidxConstraintLayoutVersion") + library("androidx-fragment", "androidx.fragment:fragment-compose:$androidxFragmentVersion") library("androidx-lifecycle-livedata", "androidx.lifecycle:lifecycle-livedata-ktx:$androidxLifecycleVersion") library("androidx-lifecycle-compose", "androidx.lifecycle:lifecycle-runtime-compose:$androidxLifecycleVersion") library("androidx-navigation-compose", "androidx.navigation:navigation-compose:$androidxNavigationComposeVersion") diff --git a/ui-design-lib/build.gradle.kts b/ui-design-lib/build.gradle.kts index 89cf4fa1..f7b64387 100644 --- a/ui-design-lib/build.gradle.kts +++ b/ui-design-lib/build.gradle.kts @@ -41,6 +41,7 @@ dependencies { api(libs.kotlinx.immutable) implementation(libs.zcash.sdk.incubator) implementation(projects.spackleAndroidLib) + api(libs.androidx.fragment) androidTestImplementation(libs.bundles.androidx.test) androidTestImplementation(libs.androidx.compose.test.junit) diff --git a/ui-lib/build.gradle.kts b/ui-lib/build.gradle.kts index 689edd06..e55d711f 100644 --- a/ui-lib/build.gradle.kts +++ b/ui-lib/build.gradle.kts @@ -88,7 +88,6 @@ androidComponents { dependencies { implementation(libs.accompanist.permissions) implementation(libs.androidx.activity) - implementation(libs.androidx.appcompat) implementation(libs.androidx.annotation) implementation(libs.androidx.constraintlayout) implementation(libs.androidx.core) diff --git a/ui-lib/src/main/java/co/electriccoin/zcash/ui/MainActivity.kt b/ui-lib/src/main/java/co/electriccoin/zcash/ui/MainActivity.kt index 3c7e0d1b..87715e9f 100644 --- a/ui-lib/src/main/java/co/electriccoin/zcash/ui/MainActivity.kt +++ b/ui-lib/src/main/java/co/electriccoin/zcash/ui/MainActivity.kt @@ -8,7 +8,6 @@ import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge import androidx.activity.viewModels import androidx.annotation.VisibleForTesting -import androidx.appcompat.app.AppCompatActivity import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.imePadding @@ -17,6 +16,7 @@ import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.LaunchedEffect import androidx.compose.ui.Modifier import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen +import androidx.fragment.app.FragmentActivity import androidx.lifecycle.Lifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.lifecycleScope @@ -62,7 +62,7 @@ import kotlin.time.Duration import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.seconds -class MainActivity : AppCompatActivity() { +class MainActivity : FragmentActivity() { private val homeViewModel by viewModels() val walletViewModel by viewModels() diff --git a/ui-lib/src/main/res/ui/common/values/themes.xml b/ui-lib/src/main/res/ui/common/values/themes.xml index dc06e0e9..1ff6e0c9 100644 --- a/ui-lib/src/main/res/ui/common/values/themes.xml +++ b/ui-lib/src/main/res/ui/common/values/themes.xml @@ -3,6 +3,6 @@