Skip to content

Commit

Permalink
fix(deps): update dependency androidx.compose:compose-bom to v2023.06…
Browse files Browse the repository at this point in the history
….01 (#434)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Scott Rayapoullé <[email protected]>
  • Loading branch information
renovate[bot] and soulcramer authored Aug 3, 2023
1 parent 8b65c68 commit 8f5b23a
Show file tree
Hide file tree
Showing 18 changed files with 192 additions and 73 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ accompanist = "0.30.1"
android-gradlePlugin = "8.1.0"
androidx-activity = "1.7.2"
androidx-appCompat = "1.6.1"
androidx-compose-bom = "2023.04.01"
androidx-compose-bom = "2023.06.01"
androidx-compose-compiler = "1.4.8"
androidx-lifecycle = "2.6.1"
androidx-navigation = "2.6.0"
Expand Down
18 changes: 9 additions & 9 deletions spark-icons/dependencies/releaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ androidx.arch.core:core-common:2.2.0
androidx.arch.core:core-runtime:2.2.0
androidx.autofill:autofill:1.0.0
androidx.collection:collection:1.1.0
androidx.compose.runtime:runtime-saveable:1.4.2
androidx.compose.runtime:runtime:1.4.2
androidx.compose.ui:ui-geometry:1.4.2
androidx.compose.ui:ui-graphics:1.4.2
androidx.compose.ui:ui-text:1.4.2
androidx.compose.ui:ui-unit:1.4.2
androidx.compose.ui:ui-util:1.4.2
androidx.compose.ui:ui:1.4.2
androidx.compose:compose-bom:2023.04.01
androidx.compose.runtime:runtime-saveable:1.4.3
androidx.compose.runtime:runtime:1.4.3
androidx.compose.ui:ui-geometry:1.4.3
androidx.compose.ui:ui-graphics:1.4.3
androidx.compose.ui:ui-text:1.4.3
androidx.compose.ui:ui-unit:1.4.3
androidx.compose.ui:ui-util:1.4.3
androidx.compose.ui:ui:1.4.3
androidx.compose:compose-bom:2023.06.01
androidx.concurrent:concurrent-futures:1.1.0
androidx.core:core-ktx:1.9.0
androidx.core:core:1.9.0
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 7 additions & 6 deletions spark/dependencies/releaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ androidx.compose.animation:animation-core:1.4.3
androidx.compose.animation:animation:1.4.3
androidx.compose.foundation:foundation-layout:1.4.3
androidx.compose.foundation:foundation:1.4.3
androidx.compose.material3:material3-window-size-class:1.0.1
androidx.compose.material3:material3:1.0.1
androidx.compose.material:material-icons-core:1.4.2
androidx.compose.material:material-ripple:1.4.2
androidx.compose.material:material:1.4.2
androidx.compose.material3:material3-window-size-class:1.1.1
androidx.compose.material3:material3:1.1.1
androidx.compose.material:material-icons-core:1.4.3
androidx.compose.material:material-ripple:1.4.3
androidx.compose.material:material:1.4.3
androidx.compose.runtime:runtime-saveable:1.4.3
androidx.compose.runtime:runtime:1.4.3
androidx.compose.ui:ui-geometry:1.4.3
Expand All @@ -30,14 +30,15 @@ androidx.compose.ui:ui-tooling:1.4.3
androidx.compose.ui:ui-unit:1.4.3
androidx.compose.ui:ui-util:1.4.3
androidx.compose.ui:ui:1.4.3
androidx.compose:compose-bom:2023.04.01
androidx.compose:compose-bom:2023.06.01
androidx.concurrent:concurrent-futures:1.1.0
androidx.core:core-ktx:1.9.0
androidx.core:core:1.9.0
androidx.customview:customview-poolingcontainer:1.0.0
androidx.emoji2:emoji2:1.3.0
androidx.exifinterface:exifinterface:1.3.6
androidx.interpolator:interpolator:1.0.0
androidx.lifecycle:lifecycle-common-java8:2.6.1
androidx.lifecycle:lifecycle-common:2.6.1
androidx.lifecycle:lifecycle-livedata-core:2.6.1
androidx.lifecycle:lifecycle-process:2.6.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public fun TopAppBar(
navigationIcon = navigationIcon,
actions = actions,
windowInsets = windowInsets,
colors = TopAppBarDefaults.smallTopAppBarColors(),
colors = TopAppBarDefaults.topAppBarColors(),
scrollBehavior = scrollBehavior,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ internal fun ModalBottomSheetSample() {

items(50) {
ListItem(
headlineText = { Text("Item $it") },
headlineContent = { Text("Item $it") },
leadingContent = {
Icon(
SparkIcons.LikeFill,
Expand Down
182 changes: 137 additions & 45 deletions spark/src/main/kotlin/com/adevinta/spark/components/list/ListItem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
*/
package com.adevinta.spark.components.list

import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ListItem
import androidx.compose.foundation.layout.Column
import androidx.compose.material3.ListItemColors
import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
Expand All @@ -32,28 +32,32 @@ import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.unit.Dp
import com.adevinta.spark.ExperimentalSparkApi
import com.adevinta.spark.PreviewTheme
import com.adevinta.spark.components.divider.Divider
import com.adevinta.spark.components.icons.Icon
import com.adevinta.spark.icons.FavoriteFill
import com.adevinta.spark.icons.SparkIcons
import com.adevinta.spark.tools.preview.ThemeProvider
import com.adevinta.spark.tools.preview.ThemeVariant
import androidx.compose.material3.ListItem as MaterialListItem

@OptIn(ExperimentalMaterial3Api::class)
@ExperimentalSparkApi
@Composable
internal fun SparkListItem(
headlineText: @Composable () -> Unit,
headlineContent: @Composable () -> Unit,
modifier: Modifier = Modifier,
overlineText: (@Composable () -> Unit)? = null,
supportingText: (@Composable () -> Unit)? = null,
leadingContent: (@Composable () -> Unit)? = null,
trailingContent: (@Composable () -> Unit)? = null,
colors: ListItemColors = ListItemDefault.colors(),
tonalElevation: Dp = ListItemDefault.Elevation,
shadowElevation: Dp = ListItemDefault.Elevation,
overlineContent: @Composable (() -> Unit)? = null,
supportingContent: @Composable (() -> Unit)? = null,
leadingContent: @Composable (() -> Unit)? = null,
trailingContent: @Composable (() -> Unit)? = null,
colors: ListItemColors = ListItemDefaults.colors(),
tonalElevation: Dp = ListItemDefaults.Elevation,
shadowElevation: Dp = ListItemDefaults.Elevation,
) {
ListItem(
headlineText = headlineText,
MaterialListItem(
headlineContent = headlineContent,
modifier = modifier,
overlineText = overlineText,
supportingText = supportingText,
overlineContent = overlineContent,
supportingContent = supportingContent,
leadingContent = leadingContent,
trailingContent = trailingContent,
colors = colors,
Expand All @@ -63,41 +67,42 @@ internal fun SparkListItem(
}

/**
* Spark ListItem.
* Lists are continuous, vertical indexes of text or images.
*
* A ListItem is a simple list of items
* This component can be used to achieve the list item templates existing in the spec. One-line list
* items have a singular line of headline content. Two-line list items additionally have either
* supporting or overline content. Three-line list items have either both supporting and overline
* content, or extended (two-line) supporting text.
*
* ![ListItem image](https://developer.android.com/images/reference/androidx/compose/material3/lists.png)
*
* @param headlineText the headline text of the list item
* @param modifier the [Modifier] to be applied to the list item
* @param overlineText the text displayed above the headline text
* @param supportingText the supporting text of the list item
* @param leadingContent the leading supporting visual of the list item
* @param headlineContent the headline content of the list item
* @param modifier [Modifier] to be applied to the list item
* @param overlineContent the content displayed above the headline content
* @param supportingContent the supporting content of the list item
* @param leadingContent the leading content of the list item
* @param trailingContent the trailing meta text, icon, switch or checkbox
* @param colors ListItemColors that will be used to resolve the background and content color for this list item in different states. See ListItemDefaults.colors
* @param colors [ListItemColors] that will be used to resolve the background and content color for
* this list item in different states. See [ListItemDefaults.colors]
* @param tonalElevation the tonal elevation of this list item
* @param shadowElevation the shadow elevation of this list item
*/
@OptIn(ExperimentalMaterial3Api::class)
@ExperimentalSparkApi
@Composable
public fun ListItem(
headlineText: @Composable () -> Unit,
headlineContent: @Composable () -> Unit,
modifier: Modifier = Modifier,
overlineText: (@Composable () -> Unit)? = null,
supportingText: (@Composable () -> Unit)? = null,
leadingContent: (@Composable () -> Unit)? = null,
trailingContent: (@Composable () -> Unit)? = null,
colors: ListItemColors = ListItemDefault.colors(),
tonalElevation: Dp = ListItemDefault.Elevation,
shadowElevation: Dp = ListItemDefault.Elevation,
overlineContent: @Composable (() -> Unit)? = null,
supportingContent: @Composable (() -> Unit)? = null,
leadingContent: @Composable (() -> Unit)? = null,
trailingContent: @Composable (() -> Unit)? = null,
colors: ListItemColors = ListItemDefaults.colors(),
tonalElevation: Dp = ListItemDefaults.Elevation,
shadowElevation: Dp = ListItemDefaults.Elevation,
) {
SparkListItem(
headlineText = headlineText,
headlineContent = headlineContent,
modifier = modifier,
overlineText = overlineText,
supportingText = supportingText,
overlineContent = overlineContent,
supportingContent = supportingContent,
leadingContent = leadingContent,
trailingContent = trailingContent,
colors = colors,
Expand All @@ -106,20 +111,107 @@ public fun ListItem(
)
}

@OptIn(ExperimentalMaterial3Api::class)
@Preview(
group = "List",
name = "ListItem",
name = "One Line",
)
@Composable
internal fun OneLineListItemPreview(
@PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
) {
PreviewTheme(theme) {
Column {
ListItem(
headlineContent = { Text("One line list item with 24x24 icon") },
leadingContent = {
Icon(
sparkIcon = SparkIcons.FavoriteFill,
contentDescription = "Localized description",
)
},
)
Divider()
}
}
}

@Preview(
group = "List",
name = "Two Line",
)
@Composable
internal fun TwoLineListItemPreview(
@PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
) {
PreviewTheme(theme) {
Column {
ListItem(
headlineContent = { Text("Two line list item with trailing") },
supportingContent = { Text("Secondary text") },
trailingContent = { Text("meta") },
leadingContent = {
Icon(
sparkIcon = SparkIcons.FavoriteFill,
contentDescription = "Localized description",
)
},
)
Divider()
}
}
}

@Preview(
group = "List",
name = "Three Line",
)
@Composable
internal fun ThreeLineListItemPreview(
@PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
) {
PreviewTheme(theme) {
Column {
ListItem(
headlineContent = { Text("Three line list item") },
overlineContent = { Text("OVERLINE") },
supportingContent = { Text("Secondary text") },
leadingContent = {
Icon(
sparkIcon = SparkIcons.FavoriteFill,
contentDescription = "Localized description",
)
},
trailingContent = { Text("meta") },
)
Divider()
}
}
}

@Preview(
group = "List",
name = "Three Line Extended Content",
)
@Composable
internal fun ListItemPreview(
internal fun ThreeLineContentListItemPreview(
@PreviewParameter(ThemeProvider::class) theme: ThemeVariant,
) {
PreviewTheme(theme) {
ListItem(
headlineText = {
Text(text = "Headline text")
},
)
Column {
ListItem(
headlineContent = { Text("Three line list item") },
supportingContent = {
Text("Secondary text that is long and perhaps goes onto another line")
},
leadingContent = {
Icon(
sparkIcon = SparkIcons.FavoriteFill,
contentDescription = "Localized description",
)
},
trailingContent = { Text("meta") },
)
Divider()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import androidx.compose.material.icons.filled.Favorite
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.OutlinedTextFieldDefaults
import androidx.compose.material3.Text
import androidx.compose.material3.TextFieldColors
import androidx.compose.material3.TextFieldDefaults
Expand Down Expand Up @@ -320,14 +321,14 @@ private fun animateBorderStrokeAsState(
val focused by interactionSource.collectIsFocusedAsState()
val indicatorColor = colors.indicatorColor(enabled, state, interactionSource)
val targetThickness = if (focused || state != null) {
TextFieldDefaults.FocusedBorderThickness
OutlinedTextFieldDefaults.FocusedBorderThickness
} else {
TextFieldDefaults.UnfocusedBorderThickness
OutlinedTextFieldDefaults.UnfocusedBorderThickness
}
val animatedThickness = if (enabled) {
animateDpAsState(targetThickness, tween(durationMillis = 150))
} else {
rememberUpdatedState(TextFieldDefaults.UnfocusedBorderThickness)
rememberUpdatedState(OutlinedTextFieldDefaults.UnfocusedBorderThickness)
}
return rememberUpdatedState(
BorderStroke(animatedThickness.value, SolidColor(indicatorColor.value)),
Expand Down
Loading

0 comments on commit 8f5b23a

Please sign in to comment.