From 104b522c98d24fcdf6a2e42ef75f60f9b41f9008 Mon Sep 17 00:00:00 2001 From: dpastor Date: Thu, 2 Jan 2025 13:06:44 +0100 Subject: [PATCH] ANDROID-15581 Upgrade material lib & do not expose internal dependencies as api (#402) * ANDROID-15581 Upgrade material lib & do not expose internal dependencies as api * ANDROID-15581 Api 24 catalog crash * ANDROID-15581 Organize deps --- build.gradle | 1 + catalog/build.gradle | 1 + .../catalog/ui/compose/components/Tags.kt | 20 +++++++++---------- library-test-utils/build.gradle | 1 + library/build.gradle | 10 +++++----- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index f2f43594d..1edc7faf3 100644 --- a/build.gradle +++ b/build.gradle @@ -13,6 +13,7 @@ buildscript { constraintComposeVersion = '1.0.1' detekt_version = '1.23.7' roborazzi_version = "1.26.0" + material_version = "1.12.0" } repositories { google() diff --git a/catalog/build.gradle b/catalog/build.gradle index a30d22b5c..da140f459 100644 --- a/catalog/build.gradle +++ b/catalog/build.gradle @@ -51,6 +51,7 @@ task sourceJar(type: Jar) { dependencies { implementation project(':library') + implementation "com.google.android.material:material:$material_version" implementation 'androidx.core:core-ktx:1.9.0' implementation "androidx.constraintlayout:constraintlayout-compose:$constraintComposeVersion" implementation 'androidx.activity:activity-compose:1.4.0' diff --git a/catalog/src/main/java/com/telefonica/mistica/catalog/ui/compose/components/Tags.kt b/catalog/src/main/java/com/telefonica/mistica/catalog/ui/compose/components/Tags.kt index c0f543a0b..bb540f0b5 100644 --- a/catalog/src/main/java/com/telefonica/mistica/catalog/ui/compose/components/Tags.kt +++ b/catalog/src/main/java/com/telefonica/mistica/catalog/ui/compose/components/Tags.kt @@ -21,6 +21,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.text.input.TextFieldValue import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import com.telefonica.mistica.catalog.R import com.telefonica.mistica.compose.tag.Tag import com.telefonica.mistica.compose.theme.MisticaTheme import com.telefonica.mistica.compose.theme.brand.MovistarBrand @@ -64,25 +65,25 @@ fun Tags() { .padding(top = 16.dp) .height(60.dp) ) { - Tag(text = "Inverse", style = TagView.TYPE_INVERSE, modifier = Modifier.padding(8.dp), icon = android.R.drawable.ic_lock_power_off) + Tag(text = "Inverse", style = TagView.TYPE_INVERSE, modifier = Modifier.padding(8.dp), icon = R.drawable.icn_cross) } LazyVerticalGrid( columns = GridCells.Fixed(3), modifier = Modifier.padding(16.dp) ) { - item { Tag(text = "Promotion", style = TagView.TYPE_PROMO, modifier = Modifier.padding(4.dp), icon = android.R.drawable.ic_lock_power_off) } - item { Tag(text = "Active", style = TagView.TYPE_ACTIVE, modifier = Modifier.padding(4.dp), icon = android.R.drawable.ic_lock_power_off) } - item { Tag(text = "Inactive", style = TagView.TYPE_INACTIVE, modifier = Modifier.padding(4.dp), icon = android.R.drawable.ic_lock_power_off) } - item { Tag(text = "Success", style = TagView.TYPE_SUCCESS, modifier = Modifier.padding(4.dp), icon = android.R.drawable.ic_lock_power_off) } - item { Tag(text = "Warning", style = TagView.TYPE_WARNING, modifier = Modifier.padding(4.dp), icon = android.R.drawable.ic_lock_power_off) } - item { Tag(text = "Error", style = TagView.TYPE_ERROR, modifier = Modifier.padding(4.dp), icon = android.R.drawable.ic_lock_power_off) } + item { Tag(text = "Promotion", style = TagView.TYPE_PROMO, modifier = Modifier.padding(4.dp), icon = R.drawable.icn_cross) } + item { Tag(text = "Active", style = TagView.TYPE_ACTIVE, modifier = Modifier.padding(4.dp), icon = R.drawable.icn_cross) } + item { Tag(text = "Inactive", style = TagView.TYPE_INACTIVE, modifier = Modifier.padding(4.dp), icon = R.drawable.icn_cross) } + item { Tag(text = "Success", style = TagView.TYPE_SUCCESS, modifier = Modifier.padding(4.dp), icon = R.drawable.icn_cross) } + item { Tag(text = "Warning", style = TagView.TYPE_WARNING, modifier = Modifier.padding(4.dp), icon = R.drawable.icn_cross) } + item { Tag(text = "Error", style = TagView.TYPE_ERROR, modifier = Modifier.padding(4.dp), icon = R.drawable.icn_cross) } } } Divider(thickness = 2.dp) Tag(text = customText.value.text, style = TagView.TYPE_PROMO, modifier = Modifier.padding(top = 16.dp)) - Tag(text = customText.value.text, style = TagView.TYPE_PROMO, modifier = Modifier.padding(top = 8.dp), icon = android.R.drawable.ic_lock_power_off) + Tag(text = customText.value.text, style = TagView.TYPE_PROMO, modifier = Modifier.padding(top = 8.dp), icon = R.drawable.icn_cross) Surface( color = MisticaTheme.colors.brand, @@ -96,8 +97,7 @@ fun Tags() { verticalArrangement = Arrangement.Center, ) { Tag(text = customText.value.text, style = TagView.TYPE_INVERSE) - Tag(text = customText.value.text, style = TagView.TYPE_INVERSE, modifier = Modifier.padding(top = 8.dp), icon = android.R.drawable - .ic_lock_power_off) + Tag(text = customText.value.text, style = TagView.TYPE_INVERSE, modifier = Modifier.padding(top = 8.dp), icon = R.drawable.icn_cross) } } diff --git a/library-test-utils/build.gradle b/library-test-utils/build.gradle index ffc435e73..acd7abaee 100644 --- a/library-test-utils/build.gradle +++ b/library-test-utils/build.gradle @@ -36,6 +36,7 @@ android { dependencies { implementation project(':library') + implementation "androidx.compose.runtime:runtime:$compose_ui_version" implementation 'androidx.core:core-ktx:1.13.0' implementation 'androidx.appcompat:appcompat:1.6.1' diff --git a/library/build.gradle b/library/build.gradle index 7a9ba0504..f9c4a3dcd 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -72,11 +72,11 @@ task sourceJar(type: Jar) { } dependencies { - api "com.google.android.material:material:1.6.1" - api 'androidx.constraintlayout:constraintlayout:2.0.4' - api 'androidx.constraintlayout:constraintlayout-solver:2.0.4' - api 'androidx.recyclerview:recyclerview:1.1.0' - api "androidx.compose.runtime:runtime:$compose_ui_version" + implementation "com.google.android.material:material:$material_version" + implementation 'androidx.constraintlayout:constraintlayout:2.0.4' + implementation 'androidx.constraintlayout:constraintlayout-solver:2.0.4' + implementation 'androidx.recyclerview:recyclerview:1.1.0' + implementation "androidx.compose.runtime:runtime:$compose_ui_version" implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.activity:activity-compose:1.4.0'