From 7fdba39d6d5f840aaaf419926bdbfd35d3047e4f Mon Sep 17 00:00:00 2001 From: Jorge Martin Espinosa Date: Fri, 29 Dec 2023 12:41:08 +0100 Subject: [PATCH] Disable vector XML rasterisation on API 23 (#2128) * Disable vector XML rasterisation on API 23 --------- Co-authored-by: ElementBot --- app/build.gradle.kts | 4 ---- changelog.d/2124.bugfix | 1 + gradle/libs.versions.toml | 2 +- .../android/libraries/designsystem/icons/IconsList.kt | 2 +- .../main/res/drawable/{ic_plus.xml => ic_plus_composer.xml} | 0 .../textcomposer/components/ComposerOptionsButton.kt | 2 +- plugins/src/main/kotlin/extension/CommonExtension.kt | 5 +++++ samples/minimal/build.gradle.kts | 3 --- ...ull_CreateRoomRootView-Day-4_4_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...l_CreateRoomRootView-Night-4_5_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...pound_null_IconsCompound-Day_0_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...und_null_IconsCompound-Night_1_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...onsOther_null_IconsOther-Day_0_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...sOther_null_IconsOther-Night_1_null_0,NEXUS_5,1.0,en].png | 4 ++-- 14 files changed, 21 insertions(+), 22 deletions(-) create mode 100644 changelog.d/2124.bugfix rename libraries/designsystem/src/main/res/drawable/{ic_plus.xml => ic_plus_composer.xml} (100%) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f936e991fc..91f924af91 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -43,10 +43,6 @@ android { versionCode = Versions.versionCode versionName = Versions.versionName - vectorDrawables { - useSupportLibrary = true - } - // Keep abiFilter for the universalApk ndk { abiFilters += listOf("armeabi-v7a", "x86", "arm64-v8a", "x86_64") diff --git a/changelog.d/2124.bugfix b/changelog.d/2124.bugfix new file mode 100644 index 0000000000..1b81e44093 --- /dev/null +++ b/changelog.d/2124.bugfix @@ -0,0 +1 @@ +Disable rasterisation of Vector XMLs, which was causing crashes on API 23. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1f47d63f5a..91253fac21 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -142,7 +142,7 @@ coil = { module = "io.coil-kt:coil", version.ref = "coil" } coil_compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" } coil_gif = { module = "io.coil-kt:coil-gif", version.ref = "coil" } coil_test = { module = "io.coil-kt:coil-test", version.ref = "coil" } -compound = { module = "io.element.android:compound-android", version = "0.0.2" } +compound = { module = "io.element.android:compound-android", version = "0.0.3" } datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "datetime" } serialization_json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization_json" } kotlinx_collections_immutable = "org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.7" diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/icons/IconsList.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/icons/IconsList.kt index cd7e36d611..748f6dcd32 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/icons/IconsList.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/icons/IconsList.kt @@ -41,7 +41,7 @@ internal val iconsOther = listOf( R.drawable.ic_location_navigator_centered, R.drawable.ic_new_message, R.drawable.ic_numbered_list, - R.drawable.ic_plus, + R.drawable.ic_plus_composer, R.drawable.ic_quote, R.drawable.ic_reply, R.drawable.ic_retry, diff --git a/libraries/designsystem/src/main/res/drawable/ic_plus.xml b/libraries/designsystem/src/main/res/drawable/ic_plus_composer.xml similarity index 100% rename from libraries/designsystem/src/main/res/drawable/ic_plus.xml rename to libraries/designsystem/src/main/res/drawable/ic_plus_composer.xml diff --git a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/components/ComposerOptionsButton.kt b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/components/ComposerOptionsButton.kt index c833b46b23..c11516558e 100644 --- a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/components/ComposerOptionsButton.kt +++ b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/components/ComposerOptionsButton.kt @@ -41,7 +41,7 @@ internal fun ComposerOptionsButton( ) { Icon( modifier = Modifier.size(30.dp), - resourceId = CommonDrawables.ic_plus, + resourceId = CommonDrawables.ic_plus_composer, contentDescription = stringResource(R.string.rich_text_editor_a11y_add_attachment), tint = ElementTheme.colors.iconPrimary, ) diff --git a/plugins/src/main/kotlin/extension/CommonExtension.kt b/plugins/src/main/kotlin/extension/CommonExtension.kt index 9e903e9057..4f7a097e0f 100644 --- a/plugins/src/main/kotlin/extension/CommonExtension.kt +++ b/plugins/src/main/kotlin/extension/CommonExtension.kt @@ -28,6 +28,11 @@ fun CommonExtension<*, *, *, *, *>.androidConfig(project: Project) { compileSdk = Versions.compileSdk minSdk = Versions.minSdk testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + + vectorDrawables { + useSupportLibrary = true + generatedDensities() + } } compileOptions { diff --git a/samples/minimal/build.gradle.kts b/samples/minimal/build.gradle.kts index 150a718e44..edf2527572 100644 --- a/samples/minimal/build.gradle.kts +++ b/samples/minimal/build.gradle.kts @@ -28,9 +28,6 @@ android { versionCode = Versions.versionCode versionName = Versions.versionName testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - vectorDrawables { - useSupportLibrary = true - } } buildTypes { diff --git a/tests/uitests/src/test/snapshots/images/ui_S_t[f.createroom.impl.root_CreateRoomRootView_null_CreateRoomRootView-Day-4_4_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/ui_S_t[f.createroom.impl.root_CreateRoomRootView_null_CreateRoomRootView-Day-4_4_null_0,NEXUS_5,1.0,en].png index c5f3236dde..1fe1da734b 100644 --- a/tests/uitests/src/test/snapshots/images/ui_S_t[f.createroom.impl.root_CreateRoomRootView_null_CreateRoomRootView-Day-4_4_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/ui_S_t[f.createroom.impl.root_CreateRoomRootView_null_CreateRoomRootView-Day-4_4_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bb9b7d6711afd4c21acd3a5a1c93807c4add46cba94ede30aca92bfbc533a2da -size 23879 +oid sha256:ddcc4223f226314ebf06fdac43863179c5ae3bf3574351ed3a4114d48c0869e6 +size 23195 diff --git a/tests/uitests/src/test/snapshots/images/ui_S_t[f.createroom.impl.root_CreateRoomRootView_null_CreateRoomRootView-Night-4_5_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/ui_S_t[f.createroom.impl.root_CreateRoomRootView_null_CreateRoomRootView-Night-4_5_null_0,NEXUS_5,1.0,en].png index d0d90c769b..22825184b9 100644 --- a/tests/uitests/src/test/snapshots/images/ui_S_t[f.createroom.impl.root_CreateRoomRootView_null_CreateRoomRootView-Night-4_5_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/ui_S_t[f.createroom.impl.root_CreateRoomRootView_null_CreateRoomRootView-Night-4_5_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:14554d6b72e1daa3e7385fbc26e9f377d281f6f6bfa8d9c4b8048bf0f8fd104b -size 22339 +oid sha256:28a347a2b84dd63b6c434b64a42fff8b655bdb8f22ee69b8c0650d2eba59514a +size 21584 diff --git a/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsCompound_null_IconsCompound-Day_0_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsCompound_null_IconsCompound-Day_0_null_1,NEXUS_5,1.0,en].png index 7462a51174..8834b4a173 100644 --- a/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsCompound_null_IconsCompound-Day_0_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsCompound_null_IconsCompound-Day_0_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:93259e689404ece68cc2445e2ff67469f42305ea368dbe09aac31ef4836ff8e9 -size 80199 +oid sha256:83f4a320f72a3213da7f08ac77f4e13a51ac3bdbea5928eceef4d23a421f2346 +size 79190 diff --git a/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsCompound_null_IconsCompound-Night_1_null_1,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsCompound_null_IconsCompound-Night_1_null_1,NEXUS_5,1.0,en].png index aa1122237f..fa80251fbd 100644 --- a/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsCompound_null_IconsCompound-Night_1_null_1,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsCompound_null_IconsCompound-Night_1_null_1,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7f37427ccf7fcb57cf17d3d8783b4c90644685e994c651fd0243a95cecdb953c -size 77487 +oid sha256:5071fe12f35e6056bb7e04a6e66b9b401b4164d2cfbb28bb1e17ed83f315ec3e +size 76666 diff --git a/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsOther_null_IconsOther-Day_0_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsOther_null_IconsOther-Day_0_null_0,NEXUS_5,1.0,en].png index ff1f8a68f4..7e955fec7d 100644 --- a/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsOther_null_IconsOther-Day_0_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsOther_null_IconsOther-Day_0_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b56adae1ba8b83b4291aaf54a57a43bc7138b585a26fbf195a4969ba52129181 -size 71820 +oid sha256:4cf590f17e970865951d8e644ddf7863f2f0118677610cedc30b3986bec6f0d3 +size 72987 diff --git a/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsOther_null_IconsOther-Night_1_null_0,NEXUS_5,1.0,en].png b/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsOther_null_IconsOther-Night_1_null_0,NEXUS_5,1.0,en].png index b05ecbc480..6b3688866e 100644 --- a/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsOther_null_IconsOther-Night_1_null_0,NEXUS_5,1.0,en].png +++ b/tests/uitests/src/test/snapshots/images/ui_S_t[l.designsystem.icons_IconsOther_null_IconsOther-Night_1_null_0,NEXUS_5,1.0,en].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0a5398cd9a06246f0ada91f3e57bbfa13ed5f4b25ed3b48210cb437307a804db -size 68811 +oid sha256:1f33fc1af4beeb18997a2cc6c16f1c058222bca222ba812e9b3837fc87ee9f27 +size 69942