Skip to content

Commit 4cae660

Browse files
committed
Merge remote-tracking branch 'origin/main' into chore-updated-icons
2 parents 1e11a12 + 7e43491 commit 4cae660

File tree

21 files changed

+478
-145
lines changed

21 files changed

+478
-145
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* @soulcramer @SimonMarquis @kazaky @adevinta/spark-contributors-android
2-
/.github/ @soulcramer @SimonMarquis @kazaky
3-
/gradle/ @soulcramer @SimonMarquis @kazaky
4-
/build-logic/ @soulcramer @SimonMarquis @kazaky
1+
* @soulcramer @SimonMarquis @adevinta/spark-contributors-android
2+
/.github/ @soulcramer @SimonMarquis
3+
/gradle/ @soulcramer @SimonMarquis
4+
/build-logic/ @soulcramer @SimonMarquis

.github/actions/setup-gradle/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: 'Gradle setup and wrapper validation'
33
runs:
44
using: composite
55
steps:
6-
- uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3.5.0
6+
- uses: gradle/actions/setup-gradle@16bf8bc8fe830fa669c3c9f914d3eb147c629707 # v4.0.1
77
with:
88
validate-wrappers: true
99
gradle-home-cache-cleanup: true

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
steps:
114114
- uses: actions/checkout@v4
115115
- name: '🌋 Run Lava Vulnerability Scanner'
116-
uses: adevinta/lava-action@9bfefe8e57b0bc9f90528edf385a01b6ecbed761 # v0.3.3
116+
uses: adevinta/lava-action@ddeeddd8ccf45b403741359471a5627644a0c5f6 # v0.3.4
117117
with:
118118
version: latest
119119
config: lava.yaml

.github/workflows/firebase-app-distribution.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ jobs:
8787

8888
- name: '📋 Prepare release note for scheduled build'
8989
if: github.event_name == 'schedule'
90-
run: git log --topo-order --since="24 hours ago" --format="• %s" --no-merges >> release-notes.txt
90+
run: git log --no-merges --topo-order --since="24 hours ago" --format="• %s" >> release-notes.txt
9191

9292
- name: '📋 Prepare release note for tagged build'
9393
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
9494
run: |
9595
from="$(git for-each-ref --sort=-v:refname --count=2 --format='%(tag)' refs/tags | tail -n +2)"
9696
to="$(git for-each-ref --sort=-v:refname --count=1 --format='%(tag)' refs/tags)"
97-
git log --topo-order --format="• %s" "$from..$to" --no-merges >> release-notes.txt
97+
git log --no-merges --topo-order --format="• %s" "$from..$to" >> release-notes.txt
9898
9999
- name: '📦 Archive release-notes.txt'
100100
uses: actions/upload-artifact@v4

CHANGELOG.md

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,49 @@
66

77
### Spark
88

9-
- 🎨 The Avatar component was using the color icon without tinting it rendering them incompatible with the dark mode
10-
119
### Catalog App
1210

13-
- 🎨 KA theme colors for outline has been changed in light mode and in dark mode it's the background + variants color.
14-
1511
### CI
1612

13+
## 0.11.0
14+
15+
_2024-08-13_
16+
17+
### Spark
18+
19+
#### 🆕 Divider
20+
> [!WARNING]
21+
> The Divider Component has been deprecated to use the `HorizontalDivider`
22+
23+
The divider component now has 2 fixed colors, `outline` and `outlineHigh`. I now accept a slot has a label indicator if you need to place a decorative text when separating your sections.
24+
25+
#### 🆕 New Dropdown specs
26+
> [!WARNING]
27+
> The previous SelectTextField Api has been deprecated but should still be used in Combobox usecases.
28+
29+
The Dropdown replace the existing SelectTextfield in readonly mode. It adds new api to handle item groupings with a proper title and remove the necessity to provide the `onValueChange` callback.
30+
31+
#### 🆕 Snackbar
32+
> [!CAUTION]
33+
> `SnackbarColors` & every colored Snackbar override have been deprecated as error as their api is not compatible with the new one. You'll need to migrate them to use this version.
34+
35+
The new Snackbar loses its title and icon slot to accept only a `SparkIcon`.
36+
It has 2 styles, intents and the new dismiss action that are also available on the `showSnackbar` function.
37+
38+
39+
- ⬆️ Spark now use Kotlin 2.0
40+
- ⬆️ Compose BOM has been increased from 2024.05.00 to 2024.06.00
41+
- 🐛 The Avatar component was using the color icon without tinting it rendering them incompatible with the dark mode
42+
- 🐛 Chip doesn't have a max width anymore.
43+
- 🐛 Textfield doesn't have a max width anymore.
44+
- 🐛 Progress Tracker Indicator size now follow the font scaling
45+
- 🐛 Textfield now correctly show the required indicator when the label fold in multiples lines
46+
47+
### Catalog App
48+
49+
- 🎨 KA theme colors for outline has been changed in light mode and in dark mode it's the background + variants color
50+
- 🆕 Examples on how to make a Button Toggle has been added
51+
1752
## [0.10.1]
1853

1954
_2024-06-18_
@@ -298,7 +333,9 @@ _2023-03-29_
298333

299334
<!-- Links -->
300335

301-
[Unreleased]: https://github.com/adevinta/spark-android/compare/0.10.1...HEAD
336+
[Unreleased]: https://github.com/adevinta/spark-android/compare/0.11.0...HEAD
337+
338+
[0.11.0]: https://github.com/adevinta/spark-android/releases/tag/0.11.0
302339

303340
[0.10.1]: https://github.com/adevinta/spark-android/releases/tag/0.10.1
304341

catalog/src/main/kotlin/com/adevinta/spark/catalog/configurator/samples/tags/TagsConfigurator.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ private fun ColumnScope.TagSample() {
7171
var icon: SparkIcon? by remember { mutableStateOf(null) }
7272
var style by remember { mutableStateOf(TagStyle.Filled) }
7373
var intent by remember { mutableStateOf(TagIntent.Main) }
74-
var buttonText by remember { mutableStateOf("Filled Tag") }
74+
var tagText by remember { mutableStateOf("Filled Tag") }
7575

7676
ConfigedTag(
7777
modifier = Modifier.align(Alignment.CenterHorizontally),
7878
style = style,
79-
tagText = buttonText,
79+
tagText = tagText,
8080
intent = intent,
8181
icon = icon,
8282
)
@@ -151,10 +151,8 @@ private fun ColumnScope.TagSample() {
151151

152152
TextField(
153153
modifier = Modifier.fillMaxWidth(),
154-
value = buttonText,
155-
onValueChange = {
156-
buttonText = it
157-
},
154+
value = tagText,
155+
onValueChange = { tagText = it },
158156
label = "Tag text",
159157
placeholder = "Vérifier les Disponibilité",
160158
)

catalog/src/main/kotlin/com/adevinta/spark/catalog/examples/example/Example.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
package com.adevinta.spark.catalog.examples.example
2323

2424
import androidx.compose.foundation.horizontalScroll
25+
import androidx.compose.foundation.layout.Arrangement
2526
import androidx.compose.foundation.layout.Column
2627
import androidx.compose.foundation.layout.Row
2728
import androidx.compose.foundation.layout.WindowInsets
@@ -73,6 +74,7 @@ public fun Example(example: Example) {
7374
} else {
7475
Column(
7576
modifier = commonModifier.verticalScroll(scrollState),
77+
verticalArrangement = Arrangement.spacedBy(8.dp),
7678
) {
7779
with(example) {
7880
columnContent?.let { content -> this@Column.content(snackbarHostState) }

catalog/src/main/kotlin/com/adevinta/spark/catalog/examples/samples/tokens/TokensExamples.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
package com.adevinta.spark.catalog.examples.samples.tokens
2323

2424
import com.adevinta.spark.catalog.examples.samples.tokens.colors.ColorSample
25+
import com.adevinta.spark.catalog.examples.samples.tokens.elevation.ElevationCustomSample
26+
import com.adevinta.spark.catalog.examples.samples.tokens.elevation.ElevationSample
2527
import com.adevinta.spark.catalog.model.Example
2628
import com.adevinta.spark.catalog.util.SampleSourceUrl
2729

@@ -34,4 +36,18 @@ public val TokensExamples: List<Example> = listOf(
3436
) {
3537
ColorSample()
3638
},
39+
Example(
40+
name = "Elevations",
41+
description = "Showcase the elevation tokens",
42+
sourceUrl = TokensExampleSourceUrl,
43+
) {
44+
ElevationSample()
45+
},
46+
Example(
47+
name = "Elevation showcase",
48+
description = "Showcase the elevation tokens",
49+
sourceUrl = TokensExampleSourceUrl,
50+
) {
51+
ElevationCustomSample()
52+
},
3753
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
/*
2+
* Copyright (c) 2023-2024 Adevinta
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*/
22+
package com.adevinta.spark.catalog.examples.samples.tokens.elevation
23+
24+
import androidx.compose.animation.core.animateDpAsState
25+
import androidx.compose.foundation.layout.Box
26+
import androidx.compose.foundation.layout.ColumnScope
27+
import androidx.compose.foundation.layout.fillMaxWidth
28+
import androidx.compose.foundation.layout.heightIn
29+
import androidx.compose.foundation.layout.padding
30+
import androidx.compose.foundation.layout.width
31+
import androidx.compose.runtime.Composable
32+
import androidx.compose.runtime.getValue
33+
import androidx.compose.runtime.mutableStateOf
34+
import androidx.compose.runtime.remember
35+
import androidx.compose.runtime.setValue
36+
import androidx.compose.ui.Alignment
37+
import androidx.compose.ui.Modifier
38+
import androidx.compose.ui.res.stringResource
39+
import androidx.compose.ui.text.style.TextAlign
40+
import androidx.compose.ui.tooling.preview.Preview
41+
import androidx.compose.ui.unit.Dp
42+
import androidx.compose.ui.unit.dp
43+
import com.adevinta.spark.SparkTheme
44+
import com.adevinta.spark.catalog.R
45+
import com.adevinta.spark.catalog.util.PreviewTheme
46+
import com.adevinta.spark.components.menu.DropdownMenuItem
47+
import com.adevinta.spark.components.slider.Slider
48+
import com.adevinta.spark.components.surface.Surface
49+
import com.adevinta.spark.components.text.Text
50+
import com.adevinta.spark.components.textfields.Dropdown
51+
import com.adevinta.spark.tokens.ElevationTokens
52+
import com.adevinta.spark.tokens.highlight
53+
import kotlin.math.roundToInt
54+
55+
@Composable
56+
internal fun ColumnScope.ElevationCustomSample() {
57+
val tokensElevationsGroups by remember {
58+
mutableStateOf(
59+
listOf(
60+
"Level0" to ElevationTokens.Level0,
61+
"Level1" to ElevationTokens.Level1,
62+
"Level2" to ElevationTokens.Level2,
63+
"Level3" to ElevationTokens.Level3,
64+
"Level4" to ElevationTokens.Level4,
65+
"Level5" to ElevationTokens.Level5,
66+
),
67+
)
68+
}
69+
var selectedElevation by remember { mutableStateOf(ElevationTokens.Level1) }
70+
71+
var expanded by remember { mutableStateOf(false) }
72+
Dropdown(
73+
modifier = Modifier.fillMaxWidth(),
74+
value = tokensElevationsGroups.firstOrNull {
75+
it.second == selectedElevation
76+
}?.first ?: "Custom",
77+
label = "Elevation",
78+
expanded = expanded,
79+
onExpandedChange = { expanded = !expanded },
80+
onDismissRequest = { expanded = false },
81+
dropdownContent = {
82+
tokensElevationsGroups.forEach { (title, elevation) ->
83+
DropdownMenuItem(
84+
text = { Text("$title $elevation") },
85+
onClick = {
86+
selectedElevation = elevation
87+
expanded = false
88+
},
89+
)
90+
}
91+
},
92+
)
93+
94+
Text(
95+
text = stringResource(
96+
id = R.string.example_tokens_elevation_label,
97+
selectedElevation.value.roundToInt(),
98+
),
99+
style = SparkTheme.typography.body2.highlight,
100+
)
101+
102+
Slider(
103+
value = selectedElevation.value,
104+
steps = 23,
105+
onValueChange = { selectedElevation = Dp(it) },
106+
valueRange = 0f..24f,
107+
)
108+
109+
ElevationItem(selectedElevation)
110+
}
111+
112+
@Composable
113+
private fun ColumnScope.ElevationItem(elevation: Dp) {
114+
val animatedElevation by animateDpAsState(elevation)
115+
Surface(
116+
modifier = Modifier
117+
.padding(8.dp)
118+
.width(104.dp)
119+
.heightIn(min = 104.dp)
120+
.align(Alignment.CenterHorizontally),
121+
elevation = animatedElevation,
122+
shape = SparkTheme.shapes.extraLarge,
123+
) {
124+
Box(
125+
modifier = Modifier.padding(8.dp),
126+
contentAlignment = Alignment.Center,
127+
) {
128+
Text(
129+
text = "Elevated surface",
130+
textAlign = TextAlign.Center,
131+
)
132+
}
133+
}
134+
}
135+
136+
@Preview
137+
@Composable
138+
private fun ElevationCustomSamplePreview() {
139+
PreviewTheme {
140+
ElevationCustomSample()
141+
}
142+
}

0 commit comments

Comments
 (0)