Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANDROID-15581 Upgrade material lib & do not expose internal dependencies as api #402

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android resource not available in older api levels, this was crashing when opening the catalog in an api 24 device.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow cool

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
Loading