Skip to content

Commit

Permalink
ANDROID-15581 Upgrade material lib & do not expose internal dependenc…
Browse files Browse the repository at this point in the history
…ies 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
  • Loading branch information
dpastor authored Jan 2, 2025
1 parent d7574a8 commit 104b522
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions catalog/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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)
}
}

Expand Down
1 change: 1 addition & 0 deletions library-test-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
10 changes: 5 additions & 5 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 104b522

Please sign in to comment.