Skip to content

Commit

Permalink
[#141] Rename one-line list to single-line list
Browse files Browse the repository at this point in the history
  • Loading branch information
florentmaitre committed Jul 12, 2022
1 parent 2252de9 commit 4712b66
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ sealed class Component(
R.drawable.il_lists,
null,
R.string.component_lists_description,
listOf(Variant.ListsOneLine, Variant.ListsTwoLines, Variant.ListsThreeLines)
listOf(Variant.ListsSingleLine, Variant.ListsTwoLine, Variant.ListsThreeLine)
)

object Progress : Component(R.string.component_progress, R.drawable.il_progress, null, R.string.component_progress_description)
Expand Down Expand Up @@ -125,9 +125,9 @@ sealed class Variant(
object Chip : Variant(R.string.component_chip)
object ChipFilter : Variant(R.string.component_chip_filter)

object ListsOneLine : Variant(R.string.component_lists_one_line)
object ListsTwoLines : Variant(R.string.component_lists_two_lines)
object ListsThreeLines : Variant(R.string.component_lists_three_lines)
object ListsSingleLine : Variant(R.string.component_lists_single_line)
object ListsTwoLine : Variant(R.string.component_lists_two_line)
object ListsThreeLine : Variant(R.string.component_lists_three_line)

object TextFieldsFilled : Variant(R.string.component_text_fields_filled)
object TextFieldsOutlined : Variant(R.string.component_text_fields_outlined)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ fun ComponentList(variant: Variant) {
@Composable
private fun VariantListContent(variant: Variant) {
when (variant) {
Variant.ListsOneLine -> ListOneLineContent()
Variant.ListsTwoLines -> ListTwoLinesContent()
Variant.ListsThreeLines -> ListThreeLinesContent()
Variant.ListsSingleLine -> VariantListSingleLine()
Variant.ListsTwoLine -> VariantListTwoLine()
Variant.ListsThreeLine -> VariantListThreeLine()
else -> {}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import com.orange.ods.demo.ui.utilities.composable.Title

@ExperimentalMaterialApi
@Composable
fun ListOneLineContent() {
fun VariantListSingleLine() {
Title(textRes = R.string.component_lists_with_label_text, withHorizontalPadding = true)
SingleLineList(text = null, secondaryText = stringResource(id = R.string.component_element_label))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import com.orange.ods.demo.ui.utilities.composable.Title

@ExperimentalMaterialApi
@Composable
fun ListThreeLinesContent() {
fun VariantListThreeLine() {
Title(textRes = R.string.component_lists_without_icon, withHorizontalPadding = true)
ThreeLineList()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import com.orange.ods.demo.ui.utilities.composable.Title

@ExperimentalMaterialApi
@Composable
fun ListTwoLinesContent() {
fun VariantListTwoLine() {
Title(textRes = R.string.component_lists_without_icon, withHorizontalPadding = true)
TwoLineList()

Expand Down
6 changes: 3 additions & 3 deletions demo/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@
<!-- Component Lists -->
<string name="component_lists">Lists</string>
<string name="component_lists_description">A list is a continuous vertical group of data entries like text, icons or images.</string>
<string name="component_lists_one_line">One-line list</string>
<string name="component_lists_two_lines">Two-line list</string>
<string name="component_lists_three_lines">Three-line list</string>
<string name="component_lists_single_line">Single-line list</string>
<string name="component_lists_two_line">Two-line list</string>
<string name="component_lists_three_line">Three-line list</string>
<string name="component_lists_with_label_text">With label text</string>
<string name="component_lists_with_normal_text">With normal text</string>
<string name="component_lists_without_icon">No icon/image</string>
Expand Down
12 changes: 6 additions & 6 deletions docs/components/Lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: Lists are continuous, vertical indexes of text or images.
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Variants](#variants)
* [One-line list](#one-line-list)
* [Single-line list](#single-line-list)
* [Two-line list](#two-line-list)
* [Three-line list](#three-line-list)
* [Component specific tokens](#component-specific-tokens)
Expand All @@ -30,17 +30,17 @@ Please follow [accessibility criteria for development](https://a11y-guidelines.o

## Variants

### One-line list
### Single-line list

There are two different displays for a one-line list:
There are two different displays for a single-line list:

1. with a wide thumbnail (without start padding)

![Lists one-line wide thumbnail](images/lists_one_line_wide_thumbnail_light.png) ![Lists one-line wide thumbnail dark](images/lists_one_line_wide_thumbnail_dark.png)
![Lists single-line wide thumbnail](images/lists_single_line_wide_thumbnail_light.png) ![Lists single-line wide thumbnail dark](images/lists_single_line_wide_thumbnail_dark.png)

2. standard (all other cases)

![Lists one-line](images/lists_one_line_light.png) ![Lists one-line dark](images/lists_one_line_dark.png)
![Lists single-line](images/lists_single_line_light.png) ![Lists single-line dark](images/lists_single_line_dark.png)

> **Jetpack Compose implementation**
Expand All @@ -56,7 +56,7 @@ In all other cases use `OdsListItem`.
)
```

To display a **one-line list item with a wide thumbnail** with a checkbox trailing element:
To display a **single-line list item with a wide thumbnail** with a checkbox trailing element:

```kotlin
OdsListItemWideThumbnail(
Expand Down

0 comments on commit 4712b66

Please sign in to comment.