diff --git a/changelog.md b/changelog.md
index 7ca4c937d..dc189a0a8 100644
--- a/changelog.md
+++ b/changelog.md
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://github.com/Orange-OpenSource/ods-android/compare/0.16.0...develop)
+### Changed
+
+- \[Lib\] Review and update technical documentation ([#638](https://github.com/Orange-OpenSource/ods-android/issues/638))
+
### Fixed
- \[App\] Change illustrations alignment for slider and text field components ([#618](https://github.com/Orange-OpenSource/ods-android/issues/618))
diff --git a/docs/_layouts/main.html b/docs/_layouts/main.html
index 959e4ea1e..bdd0eddd7 100644
--- a/docs/_layouts/main.html
+++ b/docs/_layouts/main.html
@@ -17,6 +17,14 @@
max-height: 100%;
}
+ h2, h3 {
+ margin-top: 3rem;
+ }
+
+ h4, h5 {
+ margin-top: 2rem;
+ }
+
#outer {
width:100%;
height:100%;
diff --git a/docs/components/AppBarsBottom.md b/docs/components/AppBarsBottom.md
index c78807e84..8c7367f02 100644
--- a/docs/components/AppBarsBottom.md
+++ b/docs/components/AppBarsBottom.md
@@ -4,14 +4,10 @@ title: "App bars: bottom"
description: A bottom app bar displays navigation and key actions at the bottom of mobile screens.
---
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
-* [Implementation](#implementation)
-* [Component specific tokens](#component-specific-tokens)
---
@@ -19,7 +15,6 @@ description: A bottom app bar displays navigation and key actions at the bottom
- [Design System Manager - App bars](https://system.design.orange.com/0c1af118d/p/23e0e6-app-bars/b/620966)
- [Material Design - App bars: bottom](https://material.io/components/app-bars-bottom)
-- *Technical documentation soon available*
## Accessibility
@@ -33,135 +28,4 @@ action performs. While optional, their use is strongly encouraged.
When using icons for navigation icons, action items and other elements of bottom
app bars, you should set a content description on them so that screen readers
-like TalkBack are able to announce their purpose or action, if any.
-
-For an overall content description of the bottom app bar, set an
-`android:contentDescription` or use the `setContentDescription` method on the
-`BottomAppBar`.
-
-For the navigation icon, this can be achieved via the
-`app:navigationContentDescription` attribute or
-`setNavigationContentDescription` method.
-
-For action items and items within the overflow menu, the content description
-needs to be set in the menu:
-
-```xml
-
-```
-
-## Implementation
-
-Bottom app bars provide access to a bottom navigation drawer and up to four
-actions, including the floating action button.
-
-> **Jetpack Compose implementation**
-
-*Not available yet*
-
-> **XML implementation**
-
-API and source code:
-
-* `CoordinatorLayout`: [Class definition](https://developer.android.com/reference/androidx/coordinatorlayout/widget/CoordinatorLayout)
-* `BottomAppBar`: [Class definition](https://developer.android.com/reference/com/google/android/material/bottomappbar/BottomAppBar), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/bottomappbar/BottomAppBar.java)
-* `FloatingActionButton`: [Class definition](https://developer.android.com/reference/com/google/android/material/floatingactionbutton/FloatingActionButton), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/floatingactionbutton/FloatingActionButton.java)
-
-In the layout:
-
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-```
-
-In `menu/bottom_app_bar.xml`:
-
-```xml
-
-```
-
-In menu/navigation icon drawables:
-
-```xml
-
-
-```
-
-In code:
-
-```kotlin
-bottomAppBar.setNavigationOnClickListener {
- // Handle navigation icon press
-}
-
-bottomAppBar.setOnMenuItemClickListener { menuItem ->
- when (menuItem.itemId) {
- R.id.search -> {
- // Handle search icon press
- true
- }
- R.id.more -> {
- // Handle more item (inside overflow menu) press
- true
- }
- else -> false
- }
-}
-```
-
-## Component specific tokens
-
-_Soon available_
+like TalkBack are able to announce their purpose or action, if any.
\ No newline at end of file
diff --git a/docs/components/AppBarsTop.md b/docs/components/AppBarsTop.md
index b51fb0d83..1024be842 100644
--- a/docs/components/AppBarsTop.md
+++ b/docs/components/AppBarsTop.md
@@ -4,18 +4,17 @@ title: "App bars: top"
description: Top app bars display information and actions relating to the current screen.
---
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Variants](#variants)
* [Regular top app bar](#regular-top-app-bar)
+ * [Jetpack Compose](#jetpack-compose)
+ * [OdsTopAppBar API](#odstopappbar-api)
* [Large top app bar](#large-top-app-bar)
-* [Extras](#extras)
- * [Overflow menu](#overflow-menu)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose-1)
+ * [OdsLargeTopAppBar API](#odslargetopappbar-api)
---
@@ -23,51 +22,23 @@ description: Top app bars display information and actions relating to the curren
- [Design System Manager - App bars](https://system.design.orange.com/0c1af118d/p/23e0e6-app-bars/b/620966)
- [Material Design - App bars: top](https://material.io/components/app-bars-top/)
-- Technical documentation soon available
## Accessibility
Please follow [accessibility criteria for development](https://a11y-guidelines.orange.com/en/mobile/android/development/)
-Android's top app bar component APIs provide support for the navigation icon,
+`OdsTopAppBar` provides accessibility support for the navigation icon,
action items, overflow menu and more for informing the user as to what each
-action performs. While optional, their use is strongly encouraged.
-
-**Content descriptions**
-
-When using icons for navigation icons, action items and other elements of top
-app bars, you should set a content description on them so that screen readers
-like TalkBack are able to announce their purpose or action, if any.
-
-For an overall content description of the top app bar, set an
-`android:contentDescription` or use the `setContentDescription` method on the
-`MaterialToolbar`.
-
-For the navigation icon, this can be achieved via the
-`app:navigationContentDescription` attribute or
-`setNavigationContentDescription` method.
-
-For action items and items within the overflow menu, the content description
-needs to be set in the menu:
-
-```xml
-
-
-```
-
-For images within top app bars, set an `android:contentDescription`
-or use the `setContentDescription` method on the `ImageView`.
+action performs.
## Variants
### Regular top app bar
-> **Jetpack Compose implementation**
+#### Jetpack Compose
-Add `OdsTopAppBar` composable to your Scaffold topBar:
+Add `OdsTopAppBar` composable to your Scaffold `topBar`.
+Here is an example of use:
```kotlin
OdsTopAppBar(
@@ -75,20 +46,20 @@ OdsTopAppBar(
navigationIcon = OdsTopAppBarNavigationIcon(
painter = painterResource(id = R.drawable.ic_back),
contentDescription = "content description",
- onClick = { /* Do something */ }
+ onClick = { doSomething() }
),
actions = listOf(
OdsTopAppBarActionButton(
painter = painterResource(id = R.drawable.ic_share),
contentDescription = "content description",
- onClick = { }
+ onClick = { doSomething() }
),
// ...
),
overflowMenuActions = listOf(
OdsTopAppBarOverflowMenuActionItem(
text = "Text",
- onClick = { }
+ onClick = { doSomething() }
),
// ...
)
@@ -97,140 +68,21 @@ OdsTopAppBar(
Note: By default, the `OdsTopAppBar` is elevated but you can set `elevated` parameter to `false` if you don't want any shadow below it (for example if you want to display tabs below).
-> **XML implementation**
-
-API and source code:
-
-* `CoordinatorLayout`: [Class definition](https://developer.android.com/reference/androidx/coordinatorlayout/widget/CoordinatorLayout)
-* `AppBarLayout`: [Class definition](https://developer.android.com/reference/com/google/android/material/appbar/AppBarLayout), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/appbar/AppBarLayout.java)
-* `MaterialToolbar`: [Class definition](https://developer.android.com/reference/com/google/android/material/appbar/MaterialToolbar), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/appbar/MaterialToolbar.java)
-* `CollapsingToolbarLayout`: [Class definition](https://developer.android.com/reference/com/google/android/material/appbar/CollapsingToolbarLayout), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/appbar/CollapsingToolbarLayout.java)
-
-In the layout:
-
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-```
-
-In `@menu/top_app_bar.xml`:
-
-```xml
-
-
-```
-
-In menu/navigation icons:
-
-```xml
-
-
-```
-
-In code:
+##### OdsTopAppBar API
-```kotlin
-topAppBar.setNavigationOnClickListener {
- // Handle navigation icon press
-}
-
-topAppBar.setOnMenuItemClickListener { menuItem ->
- when (menuItem.itemId) {
- R.id.favorite -> {
- // Handle favorite icon press
- true
- }
- R.id.search -> {
- // Handle search icon press
- true
- }
- R.id.more -> {
- // Handle more item (inside overflow menu) press
- true
- }
- else -> false
- }
-}
-```
-
-_**Applying scrolling behavior to the top app bar**_
-
-The following example shows the top app bar positioned at the same elevation as
-content. Upon scroll, it increases elevation and lets content scroll behind it.
-
-In the layout:
-
-```xml
-
-
-
-
-
-
-
-
-
-
-```
-
-_**Raised top app bar**_
-
-If you need to have a top app bar with some elevation you can set the `@style/Widget.Orange.Toolbar.Raised`
-
-```xml
-
-
-
-
-
-
-
-
-
-
-```
+Parameter | Default value | Description
+-- | -- | --
+`title: String` | | Title to be displayed in the center of the top app bar
+`modifier: Modifier` | `Modifier` |`Modifier` to be applied to the top app bar
+`navigationIcon: OdsTopAppBarNavigationIcon?` | `null` | Icon to be displayed at the start of the top app bar
+`actions: List` | `emptyList()` | Actions to be displayed at the end of the top app bar. The default layout here is a `Row`, so icons inside will be placed horizontally.
+`overflowMenuActions: List` | `emptyList()` | Actions to be displayed in the overflow menu
+`elevated: Boolean` | `true` | Controls the elevation of the top app bar: `true` to set an elevation to the top app bar (a shadow is displayed below), `false` otherwise
+{:.table}
### Large top app bar
-> **Jetpack Compose implementation**
+#### Jetpack Compose
First, you have to add this line in your application `build.gradle.kts` file cause this component relies on Compose Material 3 implementation:
@@ -238,7 +90,7 @@ First, you have to add this line in your application `build.gradle.kts` file cau
implementation("androidx.compose.material3:material3:")
```
-Then you can add `OdsLargeTopAppBar` composable to your Scaffold topBar:
+Then you can add `OdsLargeTopAppBar` composable to your Scaffold `topBar`:
```kotlin
OdsLargeTopAppBar(
@@ -246,23 +98,23 @@ OdsLargeTopAppBar(
navigationIcon = OdsTopAppBarNavigationIcon(
painter = painterResource(id = R.drawable.ic_back),
contentDescription = "content description",
- onClick = { /* Do something */ }
+ onClick = { doSomething() }
),
actions = listOf(
OdsTopAppBarActionButton(
painter = painterResource(id = R.drawable.ic_share),
contentDescription = "content description",
- onClick = { }
+ onClick = { doSomething() }
),
// ...
),
overflowMenuActions = listOf(
OdsTopAppBarOverflowMenuActionItem(
text = "Text",
- onClick = { }
+ onClick = { doSomething() }
),
// ...
- )
+ ),
scrollBehavior = null // See below to attach a scroll behavior and make the top app bar collapsible
)
```
@@ -292,32 +144,14 @@ Scaffold(
}
```
-## Extras
-
-### Overflow menu
-
-![Overflow menu light](images/app_bar_top_overflow_menu_light.png)
-![Overflow menu dark](images/app_bar_top_overflow_menu_dark.png)
-
-You can easily add an overflow menu to your top app bar by using the `OdsTopAppBarOverflowMenuBox` composable as follow:
-
-```kotlin
-OdsTopAppBarOverflowMenuBox(overflowIconContentDescription = "more actions") {
- OdsDropdownMenuItem(
- text = "account",
- onClick = {
- // Do something
- }
- )
- OdsDropdownMenuItem(
- text = "settings",
- onClick = {
- // Do something
- }
- )
-}
-```
-
-## Component specific tokens
-
-_Soon available_
+##### OdsLargeTopAppBar API
+
+Parameter | Default value | Description
+-- | -- | --
+`title: String` | | Title displayed in the center of the top app bar
+`modifier: Modifier` | `Modifier` |`Modifier` applied to the top app bar
+`navigationIcon: OdsTopAppBarNavigationIcon?` | `null` | Icon displayed at the start of the top app bar
+`actions: List` | `emptyList()` | Actions displayed at the end of the top app bar. The default layout here is a `Row`, so icons inside will be placed horizontally.
+`overflowMenuActions: List` | `emptyList()` | Actions displayed in the overflow menu
+`scrollBehavior: TopAppBarScrollBehavior?` | `null` | `TopAppBarScrollBehavior` attached to the top app bar
+{:.table}
diff --git a/docs/components/Banners.md b/docs/components/Banners.md
index 5311c240a..8db1347dc 100644
--- a/docs/components/Banners.md
+++ b/docs/components/Banners.md
@@ -10,14 +10,13 @@ It requires a user action to be dismissed.
Banners should be displayed at the top of the screen, below a top app bar. They’re persistent and nonmodal, allowing the user to either ignore them or interact with them at any time.
Only one banner should be shown at a time
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Implementation](#implementation)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose)
+ * [OdsBanner API](#odsbanner-api)
---
@@ -25,15 +24,12 @@ Only one banner should be shown at a time
- [Design System Manager - Banners](https://system.design.orange.com/0c1af118d/p/19a040-banners/b/497b77)
- [Material Design - Banners](https://m2.material.io/components/banners)
-- Technical documentation soon available
## Accessibility
Please follow [accessibility criteria for development](https://a11y-guidelines.orange.com/en/mobile/android/development/)
-Users should be able to use the left phone buttons to interact with the banner.
-The user should be able to hear the current state of the banner at all times.
-Recommendation is available at the Orange Accessibility site
+`OdsBanner` is built to support accessibility criteria and is readable by most screen readers, such as TalkBack. The use of an `OdsBannerImage` force the developer to associate a content description to the banner image.
## Implementation
@@ -41,26 +37,26 @@ Recommendation is available at the Orange Accessibility site
![Banner dark](images/banner_dark.png)
-> **Jetpack Compose implementation**
+### Jetpack Compose
You can use the `OdsBanner` composable like this:
```kotlin
OdsBanner(
- message = "Message displayed in the banner.",
- button1Text = "Dismiss",
- button2Text = "Detail", // Optional
- image = painterResource(id = R.drawable.placeholder), // Optional
- imageContentDescription = "", // Optional
- onButton1Click = {
- // Do something
- },
- onButton2Click = {
- // Do something
- }, // Optional
+ message = "Message displayed into the banner.",
+ firstButton = OdsBannerButton("Dismiss") { doSomething() },
+ secondButton = OdsBannerButton("Detail") { doSomething() },
+ image = OdsBannerImage(painterResource(id = R.drawable.placeholder), "")
)
```
-## Component specific tokens
+#### OdsBanner API
-_Soon available_
\ No newline at end of file
+Parameter | Default value | Description
+-- | -- | --
+`message: String` | | Text displayed into the banner
+`firstButton: OdsBannerButton` | | Primary button displayed in the banner
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the banner
+`image: OdsBannerImage?` | `null` | Image displayed in the banner in a circle shape
+`secondButton: OdsBannerButton?` | `null` | Secondary button displayed into the banner next to the primary one
+{:.table}
diff --git a/docs/components/Buttons.md b/docs/components/Buttons.md
index 269a6776a..893b847c7 100644
--- a/docs/components/Buttons.md
+++ b/docs/components/Buttons.md
@@ -4,21 +4,32 @@ title: Buttons
description: Buttons allow users to take actions, and make choices, with a single tap.
---
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Variants](#variants)
+ * [Contained button](#contained-button)
+ * [Jetpack Compose](#jetpack-compose)
+ * [OdsButton API](#odsbutton-api)
* [Text button](#text-button)
+ * [Jetpack Compose](#jetpack-compose-1)
+ * [OdsTextButton API](#odstextbutton-api)
* [Outlined button](#outlined-button)
- * [Contained button](#contained-button)
+ * [Jetpack Compose](#jetpack-compose-2)
+ * [OdsOutlinedButton API](#odsoutlinedbutton-api)
* [Text toggle buttons group](#text-toggle-buttons-group)
+ * [Jetpack Compose](#jetpack-compose-3)
+ * [OdsTextToggleButtonsRow API](#odstexttogglebuttonsrow-api)
* [Icon button](#icon-button)
+ * [Jetpack Compose](#jetpack-compose-4)
+ * [OdsIconButton API](#odsiconbutton-api)
* [Icon toggle button](#icon-toggle-button)
+ * [Jetpack Compose](#jetpack-compose-5)
+ * [OdsIconToggleButton API](#odsicontogglebutton-api)
* [Icon toggle buttons group](#icon-toggle-buttons-group)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose-6)
+ * [OdsIconToggleButtonsRow API](#odsicontogglebuttonsrow-api)
---
@@ -26,104 +37,16 @@ description: Buttons allow users to take actions, and make choices, with a singl
- [Design System Manager - Buttons](https://system.design.orange.com/0c1af118d/p/06a393-buttons/b/530521)
- [Material Design - Buttons](https://material.io/components/buttons/)
-- Technical documentation soon available
## Accessibility
Please follow [accessibility criteria for development](https://a11y-guidelines.orange.com/en/mobile/android/development/)
-Buttons support content labeling for accessibility and are readable by most screen readers, such as
-TalkBack. Text rendered in buttons is automatically provided to accessibility services. Additional
-content labels are usually unnecessary.
-
-## Variants
-
-### Text button
-
-Text buttons are typically used for less-pronounced actions, including those located in dialogs and
-cards. In cards, text buttons help maintain an emphasis on card content.
-
-![TextButton](images/button_text_light.png) ![TextButton dark](images/button_text_dark.png)
-
-> **Jetpack Compose implementation**
-
-Use the `OdsTextButton` composable:
-
-```kotlin
-OdsTextButton(
- text = "Text button",
- onClick = {},
- enabled = true,
- icon = OdsButtonIcon(painterResource(R.drawable.ic_coffee)), // Optional, line can be removed if you don't need any icon
- style = OdsTextButtonStyle.Primary
-)
-```
-
-> **XML implementation**
-
-To create a Text Button using Orange theme you will need to apply
-style `@style/Widget.Orange.Button.Text` on your `Button` layout
-
-In the layout:
-
-```xml
-
-
-```
-
-To create a **Text Button having an icon** using Orange theme you will need to apply
-style `@style/Widget.Orange.Button.Text.Icon` on your `Button` layout
-
-```xml
-
-
-```
-
-### Outlined button
-
-Outlined buttons are medium-emphasis buttons. They contain actions that are important, but aren’t
-the primary action in an app.
-
-![ButtonOutlined](images/button_outlined_light.png) ![ButtonOutlined dark](images/button_outlined_dark.png)
-
-> **Jetpack Compose implementation**
-
-Use the `OdsOutlinedButton` composable:
-
-```kotlin
-OdsOutlinedButton(
- text = "Outlined button",
- onClick = {},
- enabled = true,
- icon = OdsButtonIcon(painterResource(R.drawable.ic_coffee)) // Optional, line can be removed if you don't need any icon
-)
-```
-
-> **XML implementation**
-
-To create an Outlined Button using Orange theme you will need to apply
-style `@style/Widget.Orange.Button.Outlined` on your `Button` layout.
-
-In the layout:
+ODS buttons support accessibility criteria and are readable by most screen readers, such as TalkBack.
-```xml
+Content descriptions for icons are unnecessary in the case of buttons containing text. For other buttons types, such as `OdsIconButton`, icons content descriptions are mandatory in the APIs.
-
-```
-
-To create an **Outlined Button having an icon** using Orange theme you will need to apply
-style `@style/Widget.Orange.Button.Outlined.Icon` on your `Button` layout.
-
-```xml
-
-
-```
+## Variants
### Contained button
@@ -140,16 +63,16 @@ Functional negative:
![ContainedButton negative light](images/button_contained_negative_light.png) ![ContainedButton negative dark](images/button_contained_negative_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
Use the `OdsButton` composable:
```kotlin
OdsButton(
text = "Contained button",
- onClick = {},
+ onClick = { doSomething() },
enabled = true,
- icon = OdsButtonIcon(painterResource(R.drawable.ic_coffee)) // Optional, line can be removed if you don't need any icon
+ icon = OdsButtonIcon(painterResource(R.drawable.ic_coffee)) // Line can be removed if you don't need any icon
)
```
@@ -159,46 +82,92 @@ through the `style` parameter:
```kotlin
OdsButton(
text = "Positive button",
- onClick = {},
+ onClick = { doSomething() },
enabled = true,
- icon = OdsButtonIcon(painterResource(R.drawable.ic_coffee)), // Optional, line can be removed if you don't need any icon
+ icon = OdsButtonIcon(painterResource(R.drawable.ic_coffee)), // Line can be removed if you don't need any icon
style = OdsButtonStyle.FunctionalPositive
)
```
-> **XML implementation**
+##### OdsButton API
+
+Parameter | Default value | Description
+-- | -- | --
+`text: String` | | Text displayed into the button
+`onClick: () -> Unit` | | Callback invoked when the button is clicked
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the button
+`icon: OdsButtonIcon?` | `null` | Icon displayed in the button before the text
+`enabled: Boolean` | `true` | Controls the enabled state of the button. When `false`, this button will not be clickable.
+`style: OdsButtonStyle` | `OdsButtonStyle.Default` | Style applied to the button. Set it to `OdsButtonStyle.Primary` for an highlighted button style or use `OdsButtonStyle.FunctionalPositive`/ `OdsButtonStyle.FunctionalNegative` for a functional green/red button style.
+`displaySurface: OdsDisplaySurface` | `OdsDisplaySurface.Default` | `OdsDisplaySurface` applied to the button. It allows to force the button display on light or dark surface. By default, the appearance applied is based on the system night mode value.
+{:.table}
-_**Note** In XML, the contained button is the default style if the style is not set._
+### Text button
-To create a Contained Button using Orange theme you will need to apply
-style `@style/Widget.Orange.Button.Contained` on your `Button` layout
+Text buttons are typically used for less-pronounced actions, including those located in dialogs and
+cards. In cards, text buttons help maintain an emphasis on card content.
+
+![TextButton](images/button_text_light.png) ![TextButton dark](images/button_text_dark.png)
-In the layout:
+#### Jetpack Compose
-```xml
+Use the `OdsTextButton` composable:
-
+```kotlin
+OdsTextButton(
+ text = "Text button",
+ onClick = { doSomething() },
+ enabled = true,
+ icon = OdsButtonIcon(painterResource(R.drawable.ic_coffee)), // Line can be removed if you don't need any icon
+ style = OdsTextButtonStyle.Primary
+)
```
-or
+##### OdsTextButton API
-```xml
+Parameter | Default value | Description
+-- | -- | --
+`text: String` | | Text displayed into the button
+`onClick: () -> Unit` | | Callback invoked on button click
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the button
+`icon: OdsButtonIcon?` | `null` | Icon displayed in the button before the text
+`enabled: Boolean` | `true` | Controls the enabled state of the button. When `false`, this button will not be clickable.
+`style: OdsTextButtonStyle` | `OdsTextButtonStyle.Default` | Style applied to the button. By default `onSurface` color is used for text color. Use `OdsTextButtonStyle.Primary` for an highlighted text color.
+`displaySurface: OdsDisplaySurface` | `OdsDisplaySurface.Default` | `OdsDisplaySurface` applied to the button. It allows to force the button display on light or dark surface. By default, the appearance applied is based on the system night mode value.
+{:.table}
-
-```
+### Outlined button
-To create a **Contained Button having an icon** using Orange theme you will need to apply
-style `@style/Widget.Orange.Button.Contained.Icon` on your `Button` layout
+Outlined buttons are medium-emphasis buttons. They contain actions that are important, but aren’t
+the primary action in an app.
-```xml
+![ButtonOutlined](images/button_outlined_light.png) ![ButtonOutlined dark](images/button_outlined_dark.png)
+
+#### Jetpack Compose
-
+Use the `OdsOutlinedButton` composable:
+
+```kotlin
+OdsOutlinedButton(
+ text = "Outlined button",
+ onClick = {},
+ enabled = true,
+ icon = OdsButtonIcon(painterResource(R.drawable.ic_coffee)) // Line can be removed if you don't need any icon
+)
```
+##### OdsOutlinedButton API
+
+Parameter | Default value | Description
+-- | -- | --
+`text: String` | | Text displayed into the button
+`onClick: () -> Unit` | | Callback invoked on button click
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the button
+`icon: OdsButtonIcon?` | `null` | Icon displayed in the button before the text
+`enabled: Boolean` | `true` | Controls the enabled state of the button. When `false`, the button is not clickable.
+`displaySurface: OdsDisplaySurface` | `OdsDisplaySurface.Default` | `OdsDisplaySurface` applied to the button. It allows to force the button display on light or dark surface. By default, the appearance applied is based on the system night mode value.
+{:.table}
+
### Text toggle buttons group
A group of text toggle buttons. Only one option in a group of toggle buttons can be selected and active at a time.
@@ -206,7 +175,7 @@ Selecting one option deselects any other.
![Button text toggle group light](images/button_text_toggle_group_light.png) ![Button text toggle group dark](images/button_text_toggle_group_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
Use the `OdsTextToggleButtonsRow` composable:
@@ -218,12 +187,24 @@ OdsTextToggleButtonsRow(
),
selectedIndex = 0,
onSelectedIndexChange = {
- // Do something like changing selectedIndex to refresh composable with new selection
+ doSomething() // Do something like changing selectedIndex to refresh composable with new selection
},
sameItemsWeight = false
)
```
+##### OdsTextToggleButtonsRow API
+
+Parameter | Default value | Description
+-- | -- | --
+`textToggleButtons: List` | | Items displayed into the toggle group
+`selectedIndex: Int` | | `textToggleButtons` list index of the selected button
+`onSelectedIndexChange: (Int) -> Unit` | | Callback invoked on selection change
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the toggle buttons row
+`sameItemsWeight: Boolean` | `false` | Controls the place occupied by each item. When `true`, same weight of importance will be applied to each item, they will occupy the same width.
+`displaySurface: OdsDisplaySurface` | `OdsDisplaySurface.Default` | `OdsDisplaySurface` applied to the button. It allows to force the button display on light or dark surface. By default, the appearance applied is based on the system night mode value.
+{:.table}
+
### Icon button
An icon button is a clickable icon, used to represent actions. This component is typically used
@@ -231,7 +212,7 @@ inside an App Bar for the navigation icon / actions.
![OdsIconButton](images/button_icon_light.png) ![OdsIconButton dark](images/button_icon_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
Use the `OdsIconButton` composable:
@@ -241,12 +222,21 @@ OdsIconButton(
painterResource(id = R.drawable.ic_ui_light_mode),
stringResource(id = R.string.theme_changer_icon_content_description_light)
),
- onClick = {
- // Do something
- },
+ onClick = { doSomething() },
)
```
+##### OdsIconButton API
+
+Parameter | Default value | Description
+-- | -- | --
+`icon: OdsIconButtonIcon` | | Icon to be drawn into the button
+`onClick: () -> Unit` | | Callback to be invoked when the button is clicked
+`modifier: Modifier` | `Modifier` | `Modifier` to be applied to the button
+`enabled: Boolean` | `true` | Controls the enabled state of the button. When `false`, this button will not be clickable.
+`displaySurface: OdsDisplaySurface` | `OdsDisplaySurface.Default` | `OdsDisplaySurface` to be applied to the button. It allows to force the button display on light or dark surface. By default, the appearance applied is based on the system night mode value.
+{:.table}
+
### Icon toggle button
An icon button with two states, for icons that can be toggled 'on' and 'off', such as a bookmark
@@ -254,14 +244,14 @@ icon, or a navigation icon that opens a drawer.
![Button icon toggle light](images/button_icon_toggle_light.png) ![Button icon toggle dark](images/button_icon_toggle_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
Use the `OdsIconToggleButton` composable:
```kotlin
OdsIconToggleButton(
checked = false,
- onCheckedChange = { },
+ onCheckedChange = { doSomething() },
uncheckedIcon = OdsIconButtonIcon(
painterResource(R.drawable.ic_heart_outlined),
"Add to favorites"
@@ -270,6 +260,19 @@ OdsIconToggleButton(
)
```
+##### OdsIconToggleButton API
+
+Parameter | Default value | Description
+-- | -- | --
+`checked: Boolean` | | Controls the checked state of the button
+`onCheckedChange: (Boolean) -> Unit` | | Callback invoked when the button is checked
+`uncheckedIcon: OdsIconButtonIcon` | | Icon displayed when the button is unchecked
+`checkedIcon: OdsIconButtonIcon` | | Icon displayed when the button is checked
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the button
+`enabled: Boolean` | `true` | Controls the enabled state of the button. When `false`, this button will not be clickable.
+`displaySurface: OdsDisplaySurface` | `OdsDisplaySurface.Default` | `OdsDisplaySurface` applied to the button. It allows to force the button display on light or dark surface. By default, the appearance applied is based on the system night mode value.
+{:.table}
+
### Icon toggle buttons group
A group of toggle buttons. Only one option in a group of toggle buttons can be selected and active
@@ -278,7 +281,7 @@ Selecting one option deselects any other.
![Button icon toggle group light](images/button_icon_toggle_group_light.png) ![Button icon toggle group dark](images/button_icon_toggle_group_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
Use the `OdsIconToggleButtonsRow` composable:
@@ -295,52 +298,19 @@ OdsIconToggleButtonsRow(
),
selectedIndex = 0,
onSelectedIndexChange = {
- // Do something like changing selectedIndex to refresh composable with new selection
+ doSomething() // Do something like changing selectedIndex to refresh composable with new selection
},
- displaySurface = displaySurface // Optional
+ displaySurface = displaySurface
)
```
-> **XML implementation**
-
-API and source code:
-
-* `MaterialButtonToggleGroup`: [Class description](https://developer.android.com/reference/com/google/android/material/button/MaterialButtonToggleGroup)
- , [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/button/MaterialButtonToggleGroup.java)
-* `MaterialButton`: [Class description](https://developer.android.com/reference/com/google/android/material/button/MaterialButton)
- , [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/button/MaterialButton.java)
-
-In the layout:
-
-```xml
-
-
-
-
-
-
-```
-
-To create an **icon-only toggle button** using Orange theme you will need to apply
-style `@style/Widget.Orange.Button.Outlined.IconOnly` on your `Button` layout.
-
-```xml
-
-
-
-
-
-
-```
-
-## Component specific tokens
+##### OdsIconToggleButtonsRow API
-_Soon available_
+Parameter | Default value | Description
+-- | -- | --
+`icons: List` | | Icons to be displayed into the toggle group
+`selectedIndex: Int` | | `icons` list index of the selected button
+`onSelectedIndexChange: (Int) -> Unit` | | Callback invoked on selection change
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the toggle buttons group
+`displaySurface: OdsDisplaySurface` | `OdsDisplaySurface.Default` | `OdsDisplaySurface` applied to the button. It allows to force the button display on light or dark surface. By default, the appearance applied is based on the system night mode value.
+{:.table}
diff --git a/docs/components/Cards.md b/docs/components/Cards.md
index 0b2edea6e..dec684134 100644
--- a/docs/components/Cards.md
+++ b/docs/components/Cards.md
@@ -4,18 +4,23 @@ title: Cards
description: Cards contain content and actions about a single subject.
---
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Variants](#variants)
* [Vertical image first card](#vertical-image-first-card)
+ * [Jetpack Compose](#jetpack-compose)
+ * [OdsVerticalImageFirstCard API](#odsverticalimagefirstcard-api)
* [Vertical header first card](#vertical-header-first-card)
+ * [Jetpack Compose](#jetpack-compose-1)
+ * [OdsVerticalHeaderFirstCard API](#odsverticalheaderfirstcard-api)
* [Small card](#small-card)
+ * [Jetpack Compose](#jetpack-compose-2)
+ * [OdsSmallCard API](#odssmallcard-api)
* [Horizontal card](#horizontal-card)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose-3)
+ * [OdsHorizontalCard API](#odshorizontalcard-api)
---
@@ -23,30 +28,25 @@ description: Cards contain content and actions about a single subject.
- [Design System Manager - Cards](https://system.design.orange.com/0c1af118d/p/272739-cards/b/991690)
- [Material Design - Cards](https://material.io/components/cards/)
-- Technical documentation soon available
## Accessibility
Please follow [accessibility criteria for development](https://a11y-guidelines.orange.com/en/mobile/android/development/)
The contents within a card should follow their own accessibility guidelines, such as images having content descriptions set on them.
-
-If you have a draggable card, you should set an
-[`AccessibilityDelegate`](https://developer.android.com/reference/android/view/View.AccessibilityDelegate)
-on it, so that the behavior can be accessible via screen readers such as TalkBack.
-See the [draggable card section](https://material.io/components/cards/android#making-a-card-draggable) section for more info.
+The ODS library cards APIs forces the developers to add content descriptions on card images.
## Variants
-The library offers several Composables for Jetpack Compose implementation. In XML, the library is only styling `MaterialCardView`.
+The library offers several Composables for Jetpack Compose implementation.
### Vertical image first card
This is a full width card containing elements arranged vertically with an image as first element.
- ![Vertical image first card light](images/card_vertical_image_first_light.png) ![Vertical image first card dark](images/card_vertical_image_first_dark.png)
+![Vertical image first card light](images/card_vertical_image_first_light.png) ![Vertical image first card dark](images/card_vertical_image_first_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
In your composable screen you can use `OdsVerticalImageFirstCard` composable:
@@ -58,27 +58,37 @@ OdsVerticalImageFirstCard(
"Picture content description",
Alignment.Center,
ContentScale.Crop,
- Color(0xff1b1b1b) //Optional
+ Color(0xff1b1b1b)
),
- subtitle = "Subtitle", //Optional
- text = "Text", //Optional
- firstButton = OdsCardButton("First button") {}, //Optional
- secondButton = OdsCardButton("Second button") {}, //Optional
- onClick = {} //Optional
+ subtitle = "Subtitle",
+ text = "Text",
+ firstButton = OdsCardButton("First button") { doSomething() },
+ secondButton = OdsCardButton("Second button") { doSomething() },
+ onClick = { doSomething() }
)
```
-> **XML implementation**
+##### OdsVerticalImageFirstCard API
-See [Cards implementation in XML](#cards-implementation-in-xml)
+Parameter | Default value | Description
+-- | -- | --
+`title: String` | | Title displayed into the card
+`image: OdsCardImage` | | Image displayed into the card
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the layout of the card
+`subtitle: String?` | `null` | Subtitle displayed into the card
+`text: String?` | `null` | Text displayed into the card
+`firstButton: OdsCardButton?` | `null` | First button displayed into the card
+`secondButton: OdsCardButton?` | `null` | Second button displayed into the card
+`onClick: (() -> Unit)?` | `null` | Callback invoked on card click
+{:.table}
### Vertical header first card
This is a full width card containing elements arranged vertically with a header (thumbnail, title & subtitle) as first element.
- ![Vertical header first card light](images/card_vertical_header_first_light.png) ![Vertical header first card dark](images/card_vertical_header_first_dark.png)
+![Vertical header first card light](images/card_vertical_header_first_light.png) ![Vertical header first card dark](images/card_vertical_header_first_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
In your composable screen you can use `OdsVerticalHeaderFirstCard` composable:
@@ -90,33 +100,44 @@ OdsVerticalHeaderFirstCard(
"Picture content description",
Alignment.Center,
ContentScale.Crop,
- Color(0xff1b1b1b) //Optional
+ Color(0xff1b1b1b)
),
thumbnail = OdsCardThumbnail(
painterResource(R.drawable.thumbnail),
"Thumbnail content description"
- ), //Optional
- subtitle = "Subtitle", //Optional
- text = "Text", //Optional
- firstButton = OdsCardButton("First button") {}, //Optional
- secondButton = OdsCardButton("Second button") {}, //Optional
- onClick = {} //Optional
+ ),
+ subtitle = "Subtitle",
+ text = "Text",
+ firstButton = OdsCardButton("First button") { doSomething() },
+ secondButton = OdsCardButton("Second button") { doSomething() },
+ onClick = { doSomething() }
)
```
-> **XML implementation**
-
-See [Cards implementation in XML](#cards-implementation-in-xml)
+##### OdsVerticalHeaderFirstCard API
+
+Parameter | Default value | Description
+-- | -- | --
+`title: String` | | Title displayed into the card
+`image: OdsCardImage` | | Image displayed into the card
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the layout of the card
+`thumbnail: OdsCardThumbnail?` | `null` | Thumbnail displayed into the card next to the title: avatar, logo or icon.
+`subtitle: String?` | `null` | Subtitle displayed into the card
+`text: String?` | `null` | Text displayed into the card
+`firstButton: OdsCardButton?` | `null` | First button displayed into the card
+`secondButton: OdsCardButton?` | `null` | Second button displayed into the card
+`onClick: (() -> Unit)?` | `null` | Callback called on card click
+{:.table}
### Small card
This is a small card which takes the half screen width.
- ![CardSmall](images/card_small_light.png) ![CardSmall dark](images/card_small_dark.png)
+![CardSmall](images/card_small_light.png) ![CardSmall dark](images/card_small_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
-You can add an `OdsSmallCard`composable in your screen to add a small card:
+You can add an `OdsSmallCard` composable in your screen to add a small card:
```kotlin
Row(
@@ -129,7 +150,7 @@ Row(
"Picture content description"
),
modifier = Modifier.weight(0.5f),
- onClick = {}
+ onClick = { doSomething() }
)
OdsSmallCard(
title = "Title",
@@ -138,22 +159,29 @@ Row(
"Picture content description"
),
modifier = Modifier.weight(0.5f),
- onClick = {}
+ onClick = { doSomething() }
)
}
```
-> **XML implementation**
+##### OdsSmallCard API
-See [Cards implementation in XML](#cards-implementation-in-xml)
+Parameter | Default value | Description
+-- | -- | --
+`title: String` | | Title displayed into the card
+`image: OdsCardImage` | | Image displayed into the card
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the layout of the card
+`subtitle: String?` | `null` | Subtitle displayed into the card
+`onClick: (() -> Unit)?` | `null` | Callback invoked on card click
+{:.table}
### Horizontal card
This is a full screen width card with an image on the side. The image can be displayed on the left or on the right.
- ![Horizontal card light](images/card_horizontal_light.png) ![Horizontal card dark](images/card_horizontal_dark.png)
+![Horizontal card light](images/card_horizontal_light.png) ![Horizontal card dark](images/card_horizontal_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
In your screen you can use `OdsHorizontalCard` composable:
@@ -165,112 +193,30 @@ OdsHorizontalCard(
"Picture content description",
Alignment.Center,
ContentScale.Crop,
- Color(0xff1b1b1b) //Optional
+ Color(0xff1b1b1b)
),
- subtitle = "Subtitle", //Optional
- text = "Text", //Optional
- firstButton = OdsCardButton("First button") {}, //Optional
- secondButton = OdsCardButton("Second button") {}, //Optional
- imagePosition = OdsHorizontalCardImagePosition.Start, //Optional. Start by default.
- divider = false, // Optional. True by default.
- onClick = {} //Optional
+ subtitle = "Subtitle",
+ text = "Text",
+ firstButton = OdsCardButton("First button") { doSomething() },
+ secondButton = OdsCardButton("Second button") { doSomething() },
+ imagePosition = OdsHorizontalCardImagePosition.Start,
+ divider = false,
+ onClick = { doSomething() }
)
```
-
-> **XML implementation**
-
-See [Cards implementation in XML](#cards-implementation-in-xml)
-
-### Cards implementation in XML
-
-To have a Card in your layout you must add `com.google.android.material.card.MaterialCardView` in your layout.
-
-API and source code:
-
-* `MaterialCardView`: [Class definition](https://developer.android.com/reference/com/google/android/material/card/MaterialCardView), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/card/MaterialCardView.java)
-
-In the layout:
-
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-```
-
-## Component specific tokens
-
-_Soon available_
+##### OdsHorizontalCard API
+
+Parameter | Default value | Description
+-- | -- | --
+`title: String` | | Title displayed into the card
+`image: OdsCardImage` | | Image displayed into the card
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the layout of the card
+`subtitle: String?` | `null` | Subtitle displayed into the card
+`text: String?` | `null` | Text displayed into the card
+`firstButton: OdsCardButton?` | `null` | First button displayed into the card
+`secondButton: OdsCardButton?` | `null` | Second button displayed into the card
+`imagePosition: OdsHorizontalCardImagePosition` | `OdsHorizontalCardImagePosition.Start` | Position of the image within the card, it can be set to `OdsHorizontalCardImagePosition.Start` or `OdsHorizontalCardImagePosition.End`
+`divider: Boolean` | `true` | Controls the divider display. If `true`, it will be displayed between the card content and the action buttons.
+`onClick: (() -> Unit)?` | `null` | Callback invoked on card click
+{:.table}
diff --git a/docs/components/Checkboxes.md b/docs/components/Checkboxes.md
index af6f09eb5..e15648bf3 100644
--- a/docs/components/Checkboxes.md
+++ b/docs/components/Checkboxes.md
@@ -5,18 +5,18 @@ description: Checkbox selection control allows the user to select options.
---
Use checkboxes to:
+
* Select one or more options from a list
* Present a list containing sub-selections
* Turn an item on or off in a desktop environment
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Implementation](#implementation)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose)
+ * [OdsCheckbox API](#odscheckbox-api)
---
@@ -24,7 +24,6 @@ Use checkboxes to:
- [Design System Manager - Selection controls](https://system.design.orange.com/0c1af118d/p/14638a-selection-controls/b/352c00)
- [Material Design - Checkboxes](https://material.io/components/checkboxes/)
-- Technical documentation soon available
## Accessibility
@@ -34,39 +33,30 @@ Checkboxes support content labeling for accessibility and are readable by most s
as TalkBack. Text rendered in check boxes is automatically provided to accessibility services.
Additional content labels are usually unnecessary.
-### Implementation
+## Implementation
![Checkbox](images/checkbox_light.png) ![Checkbox dark](images/checkbox_dark.png)
-> **Jetpack Compose implementation**
+### Jetpack Compose
In your composable screen you can use:
```kotlin
+var checked by remember { mutableStateOf(false) }
OdsCheckbox(
- checked = true,
- onCheckedChange = { },
- enabled = true,
+ checked = checked,
+ onCheckedChange = { checked = it },
+ enabled = true
)
```
-> **XML implementation**
-
-To create a Checkbox you just have to add a `Checkbox` in your layout. Orange theme will be
-automatically applied
-
-In the layout:
-
-```xml
-
-
-```
+#### OdsCheckbox API
-## Component specific tokens
+Parameter | Default value | Description
+-- | -- | --
+`checked: Boolean` | | Controls checked state of the checkbox
+`onCheckedChange: ((Boolean) -> Unit)?` | | Callback invoked on checkbox click. If `null`, then this is passive and relies entirely on a higher-level component to control the checked state.
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the checkbox
+`enabled: Boolean` | `true` | Controls enabled state of the checkbox. When `false`, this checkbox will not be clickable.
+{:.table}
-_Soon available_
diff --git a/docs/components/Chips.md b/docs/components/Chips.md
index 99420dd5f..20a15a8bb 100644
--- a/docs/components/Chips.md
+++ b/docs/components/Chips.md
@@ -4,20 +4,24 @@ title: Chips
description: Chips are compact elements that represent an input, attribute, or action.
---
----
-
-**Page summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Variants](#variants)
* [Input chip](#input-chip)
+ * [Jetpack Compose](#jetpack-compose)
+ * [OdsChip API](#odschip-api)
* [Choice chip](#choice-chip)
+ * [Jetpack Compose](#jetpack-compose-1)
* [Filter chip](#filter-chip)
+ * [Jetpack Compose](#jetpack-compose-2)
+ * [OdsFilterChip API](#odsfilterchip-api)
* [Action chip](#action-chip)
-* [Modules](#modules)
+ * [Jetpack Compose](#jetpack-compose-3)
+* [Extras](#extras)
* [Choice chips flow row](#choice-chips-flow-row)
-* [Component specific tokens](#component-specific-tokens)
+ * [OdsChoiceChipsFlowRow API](#odschoicechipsflowrow-api)
---
@@ -25,7 +29,6 @@ description: Chips are compact elements that represent an input, attribute, or a
- [Design System Manager](https://system.design.orange.com/0c1af118d/p/81aa91-chips/b/13c40e)
- [Material Design](https://material.io/components/chips)
-- Technical documentation soon available
## Accessibility
@@ -47,7 +50,7 @@ that input by converting text into chips.
![Light outlined input chip](images/chips_input_outlined_light.png) ![Dark outlined input chip](images/chips_input_outlined_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
Use the `OdsChip` composable.
Note that the chip style is outlined or filled according to your OdsTheme component configuration,
@@ -57,36 +60,33 @@ outlined by default.
OdsChip(
text = "chip text",
onClick = {
- // Something executed on chip click
+ doSomething()
},
leadingIcon = null,
leadingAvatar = OdsChipLeadingAvatar(
painterResource(id = R.drawable.avatar),
"Avatar"
- ), // set it to `null` for no avatar or provide a `leadingIcon`
- enabled = true, // Set it to `false` to disabled the chip
+ ), // Set it to `null` for no avatar or provide a `leadingIcon`
+ enabled = true,
onCancel = {
- // Something executed on cancel cross click
+ doSomething()
}
)
```
-> **XML implementation**
-
-To create an input chip you must add a `com.google.android.material.chip.Chip` component to your
-layout and set `style` property to `@style/Widget.MaterialComponents.Chip.Entry`
-
-In the layout:
-
-```xml
-
-
-
+##### OdsChip API
-
-```
+Parameter | Default value | Description
+-- | -- | --
+`text: String` | | Text to be displayed into the chip
+`onClick: () -> Unit` | | Callback called on chip click
+`modifier: Modifier` | `Modifier` | `Modifier` to be applied to the chip
+`enabled: Boolean` | `true` | Controls the enabled state of the chip. When `false`, this chip will not respond to user input.
+`selected: Boolean` | `false` | Controls the selected state of the chip. When `true`, the chip is highlighted (useful for choice chips).
+`leadingIcon: OdsChipLeadingIcon?` | `null` | Icon to be displayed at the start of the chip, preceding the text
+`leadingAvatar: OdsChipLeadingAvatar?` | `null` | Avatar to be displayed in a circle shape at the start of the chip, preceding the content text
+`onCancel: (() -> Unit)?` | `null` | Callback called on chip cancel cross click. Pass `null` for no cancel cross.
+{:.table}
### Choice chip
@@ -102,7 +102,7 @@ toggle buttons, radio buttons, and single select menus.
![Light outlined choice chips](images/chips_choice_outlined_light.png) ![Dark outlined choice chips](images/chips_choice_outlined_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
Use the `OdsChip` composable.
Note that the chip style is outlined or filled according to your OdsTheme component configuration,
@@ -112,28 +112,13 @@ outlined by default.
OdsChip(
text = "chip text",
onClick = {
- // Something executed on chip click
+ doSomething()
},
- enabled = true, // Set it to `false` to disabled the chip
+ enabled = true,
)
```
-> **XML implementation**
-
-To create a choice chip you must add a `com.google.android.material.chip.Chip` component to your
-layout and set `style` property to `@style/Widget.MaterialComponents.Chip.Choice`
-
-In the layout:
-
-```xml
-
-
-
-
-
-```
+Use the [OdsChip API](#odschip-api).
### Filter chip
@@ -146,7 +131,7 @@ toggle buttons or checkboxes.
![Light filter chips with avatar](images/chips_filter_avatar_light.png) ![Dark filter chips with avatar](images/chips_filter_avatar_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
Use the `OdsFilterChip` composable.
Note that the chip style is outlined or filled according to your OdsTheme component configuration,
@@ -156,33 +141,28 @@ outlined by default.
OdsFilterChip(
text = "chip text",
onClick = {
- // Something executed on chip click
+ doSomething()
},
leadingAvatar = OdsChipLeadingAvatar(
painterResource(id = R.drawable.avatar),
""
- ), // set it to `null` for no avatar
- selected = false, // `true` to display the chip selected
- enabled = true, // Set it to `false` to disabled the chip
+ ), // Set it to `null` for no avatar
+ selected = false,
+ enabled = true,
)
```
-> **XML implementation**
-
-To create a filter chip you must add a `com.google.android.material.chip.Chip` component to your
-layout and set `style` property to `@style/Widget.MaterialComponents.Chip.Filter`
-
-In the layout:
+##### OdsFilterChip API
-```xml
-
-
-
-
-
-```
+Parameter | Default value | Description
+-- | -- | --
+`text: String` | | Text to be displayed into the chip
+`onClick: () -> Unit` | | Callback called on chip click
+`modifier: Modifier` | `Modifier` | `Modifier` to be applied to the chip
+`enabled: Boolean` | `true` | Controls the enabled state of the chip. When `false`, this chip will not respond to user input. It also appears visually disabled and is disabled to accessibility services.
+`selected: Boolean` | `false` | Controls the selected state of the chip. When `true`, the chip is highlighted.
+`leadingAvatar: OdsChipLeadingAvatar?` | `null` | Avatar to be displayed in a circle shape at the start of the chip, preceding the content text
+{:.table}
### Action chip
@@ -195,7 +175,7 @@ An alternative to action chips are buttons, which should appear persistently and
![Light outlined action chip](images/chips_action_outlined_light.png) ![Dark outlined action chip](images/chips_action_outlined_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
Use the `OdsChip` composable.
Note that the chip style is outlined or filled according to your OdsTheme component configuration,
@@ -205,38 +185,23 @@ outlined by default.
OdsChip(
text = "chip text",
onClick = {
- // Something executed on chip click
+ doSomething()
},
leadingIcon = OdsChipLeadingIcon(
painterResource(id = R.drawable.ic_heart),
"Heart"
), // set it to `null` for no icon
- enabled = true, // Set it to `false` to disabled the chip
+ enabled = true,
)
```
-> **XML implementation**
-
-To create an action chip you must add a `com.google.android.material.chip.Chip` component to your
-layout and set `style` property to `@style/Widget.MaterialComponents.Chip.Action`
-
-In the layout:
-
-```xml
-
-
-
-
-
-```
+Use the [OdsChip API](#odschip-api).
-## Modules
+## Extras
-The ODS library provides some modules directly related to chips.
+The ODS library provides some chips related components to facilitate the implementation of chips groups.
-## Choice chips flow row
+### Choice chips flow row
This is a full width `FlowRow` containing selectable chips. It works like radio buttons, only one chip of the set can be selected.
@@ -260,6 +225,12 @@ OdsChoiceChipsFlowRow(
)
```
-## Component specific tokens
+#### OdsChoiceChipsFlowRow API
-_Soon available_
+Parameter | Default value | Description
+-- | -- | --
+`value: String` | | Initial value of the choice chips flow row
+`onValueChange: (value: T) -> Unit` | | Callback invoked when the value changes. The new value is provided as parameter.
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the chips flow row
+`chips: List>` | | Chips displayed into the flow row
+{:.table}
diff --git a/docs/components/Dialogs.md b/docs/components/Dialogs.md
index f497f7210..f8c7d642a 100644
--- a/docs/components/Dialogs.md
+++ b/docs/components/Dialogs.md
@@ -11,16 +11,14 @@ or a required action has been taken.
Dialogs are purposefully interruptive, so they should be used sparingly.
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Variants](#variants)
* [Alert dialog](#alert-dialog)
- * [Simple dialog](#simple-dialog)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose)
+ * [OdsAlertDialog API](#odsalertdialog-api)
---
@@ -28,17 +26,11 @@ Dialogs are purposefully interruptive, so they should be used sparingly.
- [Design System Manager - Dialogs](https://system.design.orange.com/0c1af118d/p/02ae02-dialogs/b/81772e)
- [Material Design - Dialogs](https://material.io/components/dialogs)
-- Technical documentation soon available
## Accessibility
Please follow [accessibility criteria for development](https://a11y-guidelines.orange.com/en/mobile/android/development/)
-The contents within a dialog should follow their own accessibility guidelines,
-such as an icon on a title having a content description via the
-`android:contentDescription` attribute set in the
-`MaterialAlertDialog.MaterialComponents.Title.Icon` style or descendant.
-
## Variants
### Alert dialog
@@ -47,81 +39,30 @@ Alert dialogs interrupt users with urgent information, details, or actions.
![Alert dialog light](images/dialog_alert_light.png) ![Alert dialog dark](images/dialog_alert_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
To display an alert dialog in your composable screen, you can use:
```kotlin
OdsAlertDialog(
- modifier = Modifier, // Optional, `Modifier` if not set
- title = "title", // Optional
+ modifier = Modifier,
+ title = "title",
text = "content text of the dialog",
confirmButton = OdsAlertDialogButton("confirm") { doSomething() },
- dismissButton = OdsAlertDialogButton("dismiss") { doSomething() }, // Optional
- properties = DialogProperties() // Optional, `DialogProperties()` if not set
+ dismissButton = OdsAlertDialogButton("dismiss") { doSomething() },
+ properties = DialogProperties()
)
```
-> **XML implementation**
-
-In code:
-
-```kotlin
-MaterialAlertDialogBuilder(context)
- .setTitle(resources.getString(R.string.title))
- .setMessage(resources.getString(R.string.supporting_text))
- .setNeutralButton(resources.getString(R.string.cancel)) { dialog, which ->
- // Respond to neutral button press
- }
- .setNegativeButton(resources.getString(R.string.decline)) { dialog, which ->
- // Respond to negative button press
- }
- .setPositiveButton(resources.getString(R.string.accept)) { dialog, which ->
- // Respond to positive button press
- }
- .show()
-```
-
-Centered dialog:
-
-```kotlin
-MaterialAlertDialogBuilder(context, R.style.Widget.Orange.Dialog.Centered)
- .setTitle("title")
- .setMessage("message")
- .setPositiveButton("positiveText", null)
- .setNegativeButton("negativeText", null)
- .setIcon(R.drawable.your_drawable)
- .show()
-```
-
-### Simple dialog
-
-Simple dialogs can display items that are immediately actionable when selected.
-They don’t have text buttons.
-
-As simple dialogs are interruptive, they should be used sparingly.
-Alternatively, dropdown menus provide options in a non-modal, less disruptive
-way.
-
-> **Jetpack Compose implementation**
-
-*Not available yet*
-
-> **XML implementation**
-
-In code:
-
-```kotlin
-val items = arrayOf("Item 1", "Item 2", "Item 3")
-
-MaterialAlertDialogBuilder(context)
- .setTitle(resources.getString(R.string.title))
- .setItems(items) { dialog, which ->
- // Respond to item chosen
- }
- .show()
-```
-
-## Component specific tokens
-
-_Soon available_
+##### OdsAlertDialog API
+
+Parameter | Default value | Description
+-- | -- | --
+`text: String` | | Text displayed into the dialog which presents the details regarding the Dialog's purpose
+`confirmButton: OdsAlertDialogButton` | | Button displayed into the dialog which is meant to confirm a proposed action, thus resolving what triggered the dialog
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the layout of the dialog
+`onDismissRequest: () -> Unit` | `{}` | Callback invoked when the user tries to dismiss the dialog by clicking outside or pressing the back button. This is not called when the dismiss button is clicked.
+`dismissButton: OdsAlertDialogButton?` | `null` | Button displayed into the dialog which is meant to dismiss the dialog
+`title: String?` | `null` | Title displayed into the dialog which should specify the purpose of the dialog. The title is not mandatory, because there may be sufficient information inside the `text`.
+`properties: DialogProperties` | `DialogProperties()` | Typically platform specific properties to further configure the dialog
+{:.table}
diff --git a/docs/components/FloatingActionButtons.md b/docs/components/FloatingActionButtons.md
index c8abb5e2e..07afac47c 100644
--- a/docs/components/FloatingActionButtons.md
+++ b/docs/components/FloatingActionButtons.md
@@ -4,39 +4,36 @@ title: Floating action buttons
description: A floating action button (FAB) represents the primary action of a screen.
---
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Variants](#variants)
* [Regular FAB](#regular-fab)
+ * [Jetpack Compose](#jetpack-compose)
+ * [OdsFloatingActionButton API](#odsfloatingactionbutton-api)
* [Mini FAB](#mini-fab)
+ * [Jetpack Compose](#jetpack-compose-1)
* [Extended FAB](#extended-fab)
-* [More implementation information](#more-implementation-information)
- * [Visibility](#visibility)
- * [Extending and Shrinking](#extending-and-shrinking)
- * [Sizing FABs](#sizing-fabs)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose-2)
+ * [OdsExtendedFloatingActionButton API](#odsextendedfloatingactionbutton-api)
---
## Specifications references
-- Design System Manager - Floating Action Button (soon available)
+- [Design System Manager - Floating Action Button](https://system.design.orange.com/0c1af118d/p/577022-buttons-fab/b/101b2a)
- [Material Design - Buttons: floating action button](https://material.io/components/buttons-floating-action-button/)
-- Technical documentation soon available
## Accessibility
Please follow [accessibility criteria for development](https://a11y-guidelines.orange.com/en/mobile/android/development/)
-You should set a content description on a FAB via the
-`android:contentDescription` attribute or `setContentDescription` method so that
-screen readers like TalkBack are able to announce their purpose or action. Text
-rendered in Extended FABs is automatically provided to accessibility services,
-so additional content labels are usually unnecessary.
+The `OdsFloatingActionButtonIcon` used in Floating Action Buttons APIs force the developers to set a content description to the FABs so that
+screen readers like TalkBack are able to announce their purpose or action.
+
+Text rendered in an extended FAB is automatically provided to accessibility services, so additional content labels are usually unnecessary.
+In this context you can set an empty `contentDescription`.
## Variants
@@ -46,16 +43,14 @@ Regular FABs are FABs that are not expanded and are a regular size.
![FAB light](images/fab_light.png) ![FAB dark](images/fab_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
To display a regular Floating Action Button in your composable screen, use `OdsFloatingActionButton`:
```kotlin
OdsFloatingActionButton(
- onClick = {
- // Do something
- },
- mini = false, // Set to `true` for Mini FAB variant
+ onClick = { doSomething() },
+ mini = false,
icon = OdsFloatingActionButtonIcon(
painterResource(id = R.drawable.ic_plus),
stringResource(id = R.string.add)
@@ -64,39 +59,15 @@ OdsFloatingActionButton(
)
```
-> **XML implementation**
-
-API and source code:
-
-* `FloatingActionButton`: [Class description](https://developer.android.com/reference/com/google/android/material/floatingactionbutton/FloatingActionButton), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/floatingactionbutton/FloatingActionButton.java)
-
-To have a regular FAB in your layout you must add `com.google.android.material.floatingactionbutton.FloatingActionButton` in your layout.
-
-In the layout:
-
-```xml
+##### OdsFloatingActionButton API
-
-
-
-
-
-
-
-```
-
-In code:
-
-```kotlin
-fab.setOnClickListener {
- // Respond to FAB click
-}
-```
+Parameter | Default value | Description
+-- | -- | --
+`icon: OdsFloatingActionButtonIcon` | | Icon used into the FAB
+`onClick: () -> Unit` | | Callback invoked on FAB click
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the FAB
+`mini: Boolean` | `false` | Controls the size of the FAB. If `true`, the size of the FAB will be 40dp, otherwise the default size will be used.
+{:.table}
### Mini FAB
@@ -106,15 +77,13 @@ Mini FABs can also be used to create visual continuity with other screen element
![FAB mini light](images/fab_mini_light.png) ![FAB mini dark](images/fab_mini_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
To display a mini FAB in your composable screen use `OdsFloatingActionButton`
```kotlin
OdsFloatingActionButton(
- onClick = {
- // Do something
- },
+ onClick = { doSomething() },
mini = true,
icon = OdsFloatingActionButtonIcon(
painterResource(id = R.drawable.ic_plus),
@@ -124,33 +93,7 @@ OdsFloatingActionButton(
)
```
-> **XML implementation**
-
-API and source code:
-
-* `FloatingActionButton`: [Class description](https://developer.android.com/reference/com/google/android/material/floatingactionbutton/FloatingActionButton), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/floatingactionbutton/FloatingActionButton.java)
-
-To have a mini FAB in your layout you must add `com.google.android.material.floatingactionbutton.FloatingActionButton` in your layout and set property `fabSize` to `mini`.
-
-In the layout:
-
-```xml
-
-
-
-
-
-
-
-```
-
-In code:
-
-```kotlin
-fab.setOnClickListener {
- // Respond to FAB click
-}
-```
+Use [OdsFloatingActionButton API](#odsfloatingactionbutton-api).
### Extended FAB
@@ -160,104 +103,25 @@ The extended FAB is wider, and it includes a text label.
![FAB extended full width light](images/fab_extended_full_width_light.png) ![FAB extended full width dark](images/fab_extended_full_width_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
To display an extended FAB, use `OdsExtendedFloatingActionButton`:
```kotlin
OdsExtendedFloatingActionButton(
- onClick = {
- // Do something
- },
+ onClick = { doSomething() },
text = stringResource(id = R.string.add),
icon = OdsFloatingActionButtonIcon(painterResource(id = R.drawable.ic_plus), ""),
modifier = modifier
)
```
-> **XML implementation**
-
-API and source code:
-
-* `ExtendedFloatingActionButton`: [Class description](https://developer.android.com/reference/com/google/android/material/floatingactionbutton/ExtendedFloatingActionButton), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/floatingactionbutton/ExtendedFloatingActionButton.java)
-
-To have an extended FAB in your layout you must add `com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton` in your layout.
-Icon should be set with property `icon`.
-
-In the layout:
-
-```xml
-
-
-
-
-
-
-
-
-```
-
-In code:
-
-```kotlin
-extendedFab.setOnClickListener {
- // Respond to Extended FAB click
-}
-```
-
-## More implementation information
-
-### Visibility
-
-Use the `show` and `hide` methods to animate the visibility of a
-`FloatingActionButton` or an `ExtendedFloatingActionButton`. The show animation
-grows the widget and fades it in, while the hide animation shrinks the widget
-and fades it out.
-
-```kotlin
-// To show:
-fab.show()
-// To hide:
-fab.hide()
-```
-
-### Extending and Shrinking
-
-Use the `extend` and `shrink` methods to animate showing and hiding the text of
-an `ExtendedFloatingActionButton`. The extend animation extends the FAB to show
-the text and the icon. The shrink animation shrinks the FAB to show just the
-icon.
-
-```kotlin
-// To extend:
-extendedFab.extend()
-// To shrink:
-extendedFab.shrink()
-```
-
-### Sizing FABs
-
-The `FloatingActionButton` can be sized either by using the discrete sizing
-modes or a custom size.
-
-There are three `app:fabSize` modes:
-
-* `normal` - the normal sized button, 56dp.
-* `mini` - the mini sized button, 40dp.
-* `auto` (default) - the button size will change based on the window size. For
- small sized windows (largest screen dimension < 470dp) this will select a
- mini sized button, and for larger sized windows it will select a normal
- sized button.
-
-Or, you can set a custom size via the `app:fabCustomSize` attribute. If set,
-`app:fabSize` will be ignored, unless the custom size is cleared via the
-`clearCustomSize` method.
-
-## Component specific tokens
+##### OdsExtendedFloatingActionButton API
-_Soon available_
+Parameter | Default value | Description
+-- | -- | --
+`icon: OdsFloatingActionButtonIcon` | | Icon used into the FAB
+`onClick: () -> Unit` | | Callback invoked on FAB click
+`text: String` | | Text displayed into the FAB
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the FAB
+{:.table}
diff --git a/docs/components/ImageTile.md b/docs/components/ImageTile.md
index 45fc433cb..4e53837bd 100644
--- a/docs/components/ImageTile.md
+++ b/docs/components/ImageTile.md
@@ -4,14 +4,13 @@ title: Image Tile
description:
---
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Implementation](#implementation)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose)
+ * [OdsImageTile API](#odsimagetile-api)
---
@@ -19,15 +18,16 @@ description:
- [Design System Manager - Image Tile](https://system.design.orange.com/0c1af118d/p/49434d-image-item)
- [Material Design - Image lists](https://m2.material.io/components/image-lists)
-- Technical documentation soon available
## Accessibility
Please follow [accessibility criteria for development](https://a11y-guidelines.orange.com/en/mobile/android/development/)
+An image in an `OdsImageTile` should always be associated to a content description. This is the reason why the `OdsImageTileImage` forces the developer to fill a content description parameter.
+
## Implementation
-> **Jetpack Compose implementation**
+#### Jetpack Compose
You can use the `OdsImageTile` composable like this:
@@ -39,7 +39,7 @@ OdsImageTile(
),
modifier = modifier,
captionDisplayType = OdsImageTileCaptionDisplayType.Overlay,
- title = "Component Image Tile", // Optional
+ title = "Component Image Tile",
icon = OdsImageTileIconToggleButton(
uncheckedIcon = OdsIconButtonIcon(
painterResource(id = R.drawable.ic_heart_outlined),
@@ -50,12 +50,20 @@ OdsImageTile(
"Remove from favourites"
),
checked = false,
- onCheckedChange = { },
- ), // Optional
- onClick = { } // Optional
+ onCheckedChange = { doSomething() },
+ ),
+ onClick = { doSomething() }
)
```
-## Component specific tokens
+##### OdsImageTile API
-_Soon available_
\ No newline at end of file
+Parameter | Default value | Description
+-- | -- | --
+`image: OdsImageTileImage` | | Image displayed into the tile
+`legendAreaDisplayType: OdsImageTileLegendAreaDisplayType` | | Controls how the title and the icon are displayed relatively to the image. If set to `OdsImageTileLegendAreaDisplayType.None`, no legend area will be displayed.
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the image tile
+`title: String?` | `null` | Title displayed into the tile. It is linked to the image and displayed according to the `legendAreaDisplayType` value.
+`icon: OdsImageTileIconToggleButton` | `null` | Clickable icon displayed next to the `title`
+`onClick: (() -> Unit)?` | `null` | Callback invoked on tile click
+{:.table}
diff --git a/docs/components/Lists.md b/docs/components/Lists.md
index cecb6565c..b169a915a 100644
--- a/docs/components/Lists.md
+++ b/docs/components/Lists.md
@@ -4,17 +4,17 @@ title: Lists
description: Lists are continuous, vertical indexes of text or images.
---
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Variants](#variants)
- * [Single-line list](#single-line-list)
- * [Two-line list](#two-line-list)
- * [Three-line list](#three-line-list)
-* [Component specific tokens](#component-specific-tokens)
+ * [Single-line list](#single-line-list)
+ * [Jetpack Compose](#jetpack-compose)
+ * [Two-line list](#two-line-list)
+ * [Jetpack Compose](#jetpack-compose-1)
+ * [Three-line list](#three-line-list)
+ * [Jetpack Compose](#jetpack-compose-2)
---
@@ -22,7 +22,6 @@ description: Lists are continuous, vertical indexes of text or images.
- [Design System Manager - Lists](https://system.design.orange.com/0c1af118d/p/09a804-lists/b/669743)
- [Material Design - Lists](https://material.io/components/lists/)
-- Technical documentation soon available
## Accessibility
@@ -38,15 +37,15 @@ Here are two examples:
- with a wide image and a checkbox
- ![Lists single-line wide image](images/lists_single_line_wide_image_light.png) ![Lists single-line wide image dark](images/lists_single_line_wide_image_dark.png)
+ ![Lists single-line wide image](images/lists_single_line_wide_image_light.png) ![Lists single-line wide image dark](images/lists_single_line_wide_image_dark.png)
- with a standard icon and a checkbox
- ![Lists single-line](images/lists_single_line_light.png) ![Lists single-line dark](images/lists_single_line_dark.png)
+ ![Lists single-line](images/lists_single_line_light.png) ![Lists single-line dark](images/lists_single_line_dark.png)
Please note that there is no start padding with wide images.
-> **Jetpack Compose implementation**
+#### Jetpack Compose
The library offers the `OdsListItem` composable to display lists items.
@@ -65,7 +64,6 @@ Note: The first signature (with `OdsListItemTrailing`) automatically manages acc
A divider can also be displayed at the bottom of the list item using the `Modifier.divider` method on the `OdsListItem` modifier.
-
```kotlin
OdsListItem(
modifier = Modifier
@@ -73,15 +71,16 @@ OdsListItem(
.iconType(OdsListItemIconType.Icon)
.divider(),
text = "Primary text",
- icon = { OdsListItemIcon(painter = painterResource(id = R.drawable.ic_heart), contentDescription = "Heart") },
+ icon = {
+ OdsListItemIcon(
+ painter = painterResource(id = R.drawable.ic_heart),
+ contentDescription = "Heart"
+ )
+ },
trailing = OdsCheckboxTrailing(checked = itemChecked)
)
```
-> **XML implementation**
-
-*Not available yet*
-
### Two-line list
Like single-line list, two-line list leading can optionally be an icon, a circular, a square or a wide image.
@@ -90,13 +89,13 @@ Here are two examples:
- with a wide image and a checkbox
- ![Lists two-line wide image](images/lists_two_line_wide_image_light.png) ![Lists two-line wide image dark](images/lists_two_line_wide_image_dark.png)
+ ![Lists two-line wide image](images/lists_two_line_wide_image_light.png) ![Lists two-line wide image dark](images/lists_two_line_wide_image_dark.png)
- with a standard icon and a checkbox
- ![Lists two-line](images/lists_two_line_light.png) ![Lists two-line dark](images/lists_two_line_dark.png)
+ ![Lists two-line](images/lists_two_line_light.png) ![Lists two-line dark](images/lists_two_line_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
The only difference with the single-line implementation is that the `secondaryText` property of `OdsListItem` is not null.
@@ -109,14 +108,13 @@ OdsListItem(
text = "Primary text",
secondaryText = "Secondary text",
icon = { OdsListItemIcon(painter = painterResource(id = R.drawable.placeholder)) },
- trailing = OdsIconTrailing(painter = painterResource(id = R.drawable.ic_drag_handle), contentDescription = "Drag item")
+ trailing = OdsIconTrailing(
+ painter = painterResource(id = R.drawable.ic_drag_handle),
+ contentDescription = "Drag item"
+ )
)
```
-> **XML implementation**
-
-*Not available yet*
-
### Three-line list
Like single-line list, three-line list leading can optionally be an icon, a circular, a square or a wide image.
@@ -125,13 +123,13 @@ Here are two examples:
- with a wide image and a checkbox
- ![Lists three-line wide image](images/lists_three_line_wide_image_light.png) ![Lists three-line wide image dark](images/lists_three_line_wide_image_dark.png)
+ ![Lists three-line wide image](images/lists_three_line_wide_image_light.png) ![Lists three-line wide image dark](images/lists_three_line_wide_image_dark.png)
- with a standard icon and a checkbox
- ![Lists three-line](images/lists_three_line_light.png) ![Lists three-line dark](images/lists_three_line_dark.png)
+ ![Lists three-line](images/lists_three_line_light.png) ![Lists three-line dark](images/lists_three_line_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
The only difference with the two-line implementation is that the `singleLineSecondaryText` property of `OdsListItem` is `false`.
@@ -148,11 +146,3 @@ OdsListItem(
trailing = OdsCaptionTrailing(text = "Caption")
)
```
-
-> **XML implementation**
-
-*Not available yet*
-
-## Component specific tokens
-
-_Soon available_
diff --git a/docs/components/Menus.md b/docs/components/Menus.md
index 40b633717..acd7c58cc 100644
--- a/docs/components/Menus.md
+++ b/docs/components/Menus.md
@@ -4,16 +4,17 @@ title: Menus
description: Menus appear from a button, action, or other control. It contains at least 2 items that can affect the app, the view or elements within the view.
---
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Variants](#variants)
* [Dropdown menu](#dropdown-menu)
+ * [Jetpack Compose](#jetpack-compose)
+ * [OdsDropdownMenu API](#odsdropdownmenu-api)
* [Exposed dropdown menu](#exposed-dropdown-menu)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose-1)
+ * [OdsExposedDropdownMenu API](#odsexposeddropdownmenu-api)
---
@@ -21,12 +22,13 @@ description: Menus appear from a button, action, or other control. It contains a
- [Design System Manager - Menus](https://system.design.orange.com/0c1af118d/p/07a69b-menus/b/862cbb)
- [Material Design - Menus](https://m2.material.io/components/menus)
-- Technical documentation soon available
## Accessibility
Please follow [accessibility criteria for development](https://a11y-guidelines.orange.com/en/mobile/android/development/)
+The icons which can be displayed in a dropdown menu are always associated to a text so they don't need a content description.
+
## Variants
### Dropdown menu
@@ -35,7 +37,7 @@ A dropdown menu is a compact way of displaying multiple choices. It appears upon
![Dropdown menu light](images/menu_dropdown_light.png) ![Dropdown menu dark](images/menu_dropdown_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
The library offers an `OdsDropdownMenu` container composable in which you can add `OdsDropdownMenuItem` or `OdsDivider` as shown in the following example:
@@ -51,24 +53,28 @@ OdsDropdownMenu(
text = "Summer salad",
icon = painterResource(id = R.drawable.ic_salad),
divider = true, // Allow to add a divider between the 2 items
- onClick = {
- // Do something
- }
+ onClick = { doSomething() }
),
OdsDropdownMenuItem(
text = "Brocoli soup",
icon = painterResource(id = R.drawable.ic_soup),
- onClick = {
- // Do something
- }
+ onClick = { doSomething() }
)
)
)
```
-> **XML implementation**
+##### OdsDropdownMenu API
-*Not available yet*
+Parameter | Default value | Description
+-- | -- | --
+`items: List` | | Items displayed into the dropdown menu
+`expanded: Boolean` | | Controls whether the menu is currently open and visible to the user
+`onDismissRequest: () -> Unit` | | Callback invoked when the user requests to dismiss the menu, such as by tapping outside the menu's bounds
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the dropdown menu
+`offset: DpOffset` | `DpOffset(0.dp, 0.dp)` | Offset added to the menu position
+`properties: PopupProperties` | `PopupProperties(focusable = true)` | Properties for further customization of the popup's behavior
+{:.table}
### Exposed dropdown menu
@@ -76,7 +82,7 @@ Exposed dropdown menus display the currently selected menu item above the menu.
![Exposed dropdown menu light](images/menu_exposed_dropdown_light.png) ![Exposed dropdown menu dark](images/menu_exposed_dropdown_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
To display an exposed dropdown menu, you can use the `OdsExposedDropdownMenu` composable. As shown below, you should provide a list of `OdsExposedDropdownMenuItem` corresponding to the items displayed in the menu (with or without icons).
@@ -93,16 +99,20 @@ OdsExposedDropdownMenu(
items = items,
selectedItem = selectedItem,
onItemSelectionChange = { item ->
- // Do something like retrieving the selected item
+ doSomething() // Do something like retrieving the selected item
},
enabled = true
)
```
-> **XML implementation**
-
-*Not available yet*
-
-## Component specific tokens
-
-_Soon available_
+##### OdsExposedDropdownMenu API
+
+Parameter | Default value | Description
+-- | -- | --
+`label: String` | | Label of the exposed menu text field
+`items: List` | | Items displayed into the dropdown menu
+`selectedItem: MutableState` | | Selected item displayed into the text field
+`onItemSelectionChange: (OdsExposedDropdownMenuItem) -> Unit` | | Callback invoked when a dropdown menu item is selected. It can be used to get the menu value.
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the dropdown menu
+`enabled: Boolean` | `true` | Controls the enabled state of the dropdown menu. When `false`, the dropdown menu text field will be neither clickable nor focusable, visually it will appear in the disabled state.
+{:.table}
diff --git a/docs/components/NavigationBottom.md b/docs/components/NavigationBottom.md
index 86e891b20..6eb962d4e 100644
--- a/docs/components/NavigationBottom.md
+++ b/docs/components/NavigationBottom.md
@@ -4,14 +4,13 @@ title: "Navigation: bottom"
description: Bottom navigation bars allow movement between primary destinations in an app.
---
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Implementation](#implementation)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose)
+ * [OdsBottomNavigation API](#odsbottomnavigation-api)
---
@@ -19,131 +18,63 @@ description: Bottom navigation bars allow movement between primary destinations
- [Design System Manager - Navigation: bottom](https://system.design.orange.com/0c1af118d/p/042eb8-navigation-bottom/b/30078d)
- [Material Design - Bottom navigation](https://material.io/components/bottom-navigation)
-- Technical documentation soon available
## Accessibility
Please follow [accessibility criteria for development](https://a11y-guidelines.orange.com/en/mobile/android/development/)
-You should set an `android:title` for each of your `menu` items so that screen
-readers like TalkBack can properly announce what each navigation item
-represents:
-
-```xml
-
-```
-
-The `labelVisibilityMode` attribute can be used to adjust the behavior of the
-text labels for each navigation item. There are four visibility modes:
-
-* `LABEL_VISIBILITY_AUTO` (default): The label behaves as “labeled” when there
- are 3 items or less, or “selected” when there are 4 items or more
-* `LABEL_VISIBILITY_SELECTED`: The label is only shown on the selected
- navigation item
-* `LABEL_VISIBILITY_LABELED`: The label is shown on all navigation items
-* `LABEL_VISIBILITY_UNLABELED`: The label is hidden for all navigation items
+Note that TalkBack already reads the bottom navigation items labels so the content descriptions of the `OdsBottomNavigationItemIcon`s can be empty.
## Implementation
- ![BottomNavigation light](images/bottom_navigation_light.png)
+![BottomNavigation light](images/bottom_navigation_light.png)
- ![BottomNavigation dark](images/bottom_navigation_dark.png)
+![BottomNavigation dark](images/bottom_navigation_dark.png)
-> **Jetpack Compose implementation**
+### Jetpack Compose
In your composable screen, use the `OdsBottomNavigation` composable. It should contain multiple `OdsBottomNavigationItem`s.
-Here is an example:
-
-```kotlin
- private data class NavigationItem(@StringRes val titleResId: Int, @DrawableRes val iconResId: Int)
-
- val items = listOf(
- R.string.component_bottom_navigation_coffee to R.drawable.ic_coffee,
- R.string.component_bottom_navigation_cooking_pot to R.drawable.ic_cooking_pot,
- R.string.component_bottom_navigation_ice_cream to R.drawable.ic_ice_cream,
- R.string.component_bottom_navigation_restaurant to R.drawable.ic_restaurant,
- R.string.component_bottom_navigation_favorites to R.drawable.ic_heart
- )
-
- var selectedItemIndex by remember { mutableStateOf(0) }
-
- OdsBottomNavigation(
- items = items.mapIndexed { index, item ->
- OdsBottomNavigationItem(
- icon = OdsBottomNavigationItemIcon(painter = painterResource(id = item.first), contentDescription = ""), // contentDescription is empty cause TalkBack already read the item's title
- label = stringResource(id = item.second),
- selected = selectedItemIndex == index,
- onClick = {
- selectedItemIndex = index
- // Do what you want with a piece of code
- }
- )
- }
- )
- )
-```
-
-> **XML implementation**
-
-API and source code:
-
-* `BottomNavigationView`: [Class description](https://developer.android.com/reference/com/google/android/material/bottomnavigation/BottomNavigationView), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/bottomnavigation/BottomNavigationView.java)
-
-In `layout.xml`:
-
-```xml
-
-
-
-
-
-```
-
-In `bottom_navigation_menu.xml` inside a `menu` resource directory:
-
-```xml
-
-```
-
-In code:
+Here is an example of use:
```kotlin
-bottomNavigation.selectedItemId = R.id.page_2
+ private data class NavigationItem(
+ @StringRes val titleResId: Int,
+ @DrawableRes val iconResId: Int
+)
+
+val items = listOf(
+ R.string.component_bottom_navigation_coffee to R.drawable.ic_coffee,
+ R.string.component_bottom_navigation_cooking_pot to R.drawable.ic_cooking_pot,
+ R.string.component_bottom_navigation_ice_cream to R.drawable.ic_ice_cream,
+ R.string.component_bottom_navigation_restaurant to R.drawable.ic_restaurant,
+ R.string.component_bottom_navigation_favorites to R.drawable.ic_heart
+)
+
+var selectedItemIndex by remember { mutableStateOf(0) }
+
+OdsBottomNavigation(
+ items = items.mapIndexed { index, item ->
+ OdsBottomNavigationItem(
+ icon = OdsBottomNavigationItemIcon(
+ painter = painterResource(id = item.first),
+ contentDescription = ""
+ ), // contentDescription is empty cause TalkBack already read the item's label
+ label = stringResource(id = item.second),
+ selected = selectedItemIndex == index,
+ onClick = {
+ selectedItemIndex = index
+ doSomething()
+ }
+ )
+ }
+)
```
-## Component specific tokens
+#### OdsBottomNavigation API
-_Soon available_
+Parameter | Default value | Description
+-- | -- | --
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the bottom navigation
+`items: List` | | Items displayed into the bottom navigation
+{:.table}
diff --git a/docs/components/NavigationDrawers.md b/docs/components/NavigationDrawers.md
index 6a0b81f24..d9095bf5f 100644
--- a/docs/components/NavigationDrawers.md
+++ b/docs/components/NavigationDrawers.md
@@ -4,14 +4,12 @@ title: Navigation drawers
description: The navigation drawer slides in from the left when the nav icon is tapped. The content should be concerned with identity and/or navigation..
---
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Implementation](#implementation)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose)
---
@@ -19,7 +17,6 @@ description: The navigation drawer slides in from the left when the nav icon is
- [Design System Manager - Navigation drawers](https://system.design.orange.com/0c1af118d/p/92bc26-navigation-drawers/b/146f55)
- [Material Design - Navigation drawer](https://m2.material.io/components/navigation-drawer)
-- Technical documentation soon available
## Accessibility
@@ -27,20 +24,19 @@ Please follow [accessibility criteria for development](https://a11y-guidelines.o
## Implementation
-> **Jetpack Compose implementation**
+### Jetpack Compose
You can use the `OdsModalDrawer` composable like this:
```kotlin
OdsModalDrawer(
drawerHeader = {
- title = "Side navigation drawer" // title is mandatory in an `OdsModalDrawer`
- imageContentDescription = "" // optional
+ title = "Side navigation drawer"
+ imageContentDescription = ""
imageDisplayType =
OdsModalDrawerHeaderImageDisplayType.None // or OdsModalDrawerHeaderImageDisplayType.Avatar or OdsModalDrawerHeaderImageDisplayType.Background
- subtitle = "Example" // optional
- image =
- painterResource(id = R.drawable.placeholder)
+ subtitle = "Example"
+ image = painterResource(id = R.drawable.placeholder)
},
drawerContentList = listOf(
OdsModalDrawerListItem( // `OdsModalDrawerListItem` is used to specified an item of the list
@@ -60,12 +56,8 @@ OdsModalDrawer(
text = "label3"
)
),
- drawerState = rememberDrawerState(DrawerValue.Closed),// or rememberDrawerState(DrawerValue.Open)
+ drawerState = rememberDrawerState(DrawerValue.Closed), // or rememberDrawerState(DrawerValue.Open)
) {
- // The content of the rest of the UI
+ // Put here the rest of the UI content
}
```
-
-## Component specific tokens
-
-_Soon available_
\ No newline at end of file
diff --git a/docs/components/ProgressIndicators.md b/docs/components/ProgressIndicators.md
index 2732d7d92..6c0c460e1 100644
--- a/docs/components/ProgressIndicators.md
+++ b/docs/components/ProgressIndicators.md
@@ -4,16 +4,17 @@ title: Progress indicators
description: Progress indicators express an unspecified wait time or display the length of a process.
---
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Variants](#variants)
* [Progress bar](#progress-bar)
+ * [Jetpack Compose](#jetpack-compose)
+ * [OdsLinearProgressIndicator API](#odslinearprogressindicator-api)
* [Activity indicator](#activity-indicator)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose-1)
+ * [OdsCircularProgressIndicator API](#odscircularprogressindicator-api)
---
@@ -21,21 +22,11 @@ description: Progress indicators express an unspecified wait time or display the
- [Design System Manager - Progress indicators](https://system.design.orange.com/0c1af118d/p/92aec5-progress-indicators------/b/33faf7)
- [Material Design - Progress indicators](https://material.io/components/progress-indicators/)
-- Technical documentation soon available
## Accessibility
Please follow [accessibility criteria for development](https://a11y-guidelines.orange.com/en/mobile/android/development/)
-Progress indicators inherit accessibility support from the `LinearProgressIndicator` class in the framework.
-Please consider setting the content descriptor for use with screen readers.
-
-That can be done in XML via the `android:contentDescription` attribute or programmatically like so:
-
-```kotlin
-progressIndicator.contentDescription = contentDescription
-```
-
## Variants
### Progress bar
@@ -55,7 +46,7 @@ Linear progress indicators support both determinate and indeterminate operations
![Progress bar dark](images/progress_linear_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
You can use the composable `OdsLinearProgressIndicator` like this:
@@ -64,12 +55,12 @@ For a **determinate** linear progress indicator, provide the progress value:
```kotlin
OdsLinearProgressIndicator(
progress = 0.9f,
- label = "Downloading ...", // Optional
+ label = "Downloading ...",
icon = OdsLinearProgressIndicator(
painterResource(id = R.drawable.ic_arrow_down),
""
- ), // Optional
- showCurrentValue = true // Display the value in percent below the progress bar if set to true
+ ),
+ showCurrentValue = true
)
```
@@ -77,43 +68,24 @@ For an **indeterminate** linear progress indicator, no need to provide a progres
```kotlin
OdsLinearProgressIndicator(
- label = "Downloading ...", // Optional
+ label = "Downloading ...",
icon = OdsLinearProgressIndicator(
painterResource(id = R.drawable.ic_arrow_down),
""
- ) // Optional
+ )
)
```
-> **XML implementation**
-
-To create a linear progress indicator you will need to
-add `com.google.android.material.progressindicator.LinearProgressIndicator` in your layout
-
-API and source code:
-
-* `LinearProgressIndicator`: [Class description](https://developer.android.com/reference/com/google/android/material/progressindicator/LinearProgressIndicator), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/progressindicator/LinearProgressIndicator.java)
-
-The following example shows a **determinate** linear progress indicator.
-
-In the layout:
-
-```xml
-
-
-```
-
-The following example shows an **indeterminate** linear progress indicator.
-
-In the layout:
+##### OdsLinearProgressIndicator API
-```xml
-
-
-```
+Parameter | Default value | Description
+-- | -- | --
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the progress indicator
+`progress: Float?` | `null` | Progress indicator value where 0.0 represents no progress and 1.0 represents full progress. Values outside of this range are coerced into the range. If set to `null`, the progress indicator is indeterminate.
+`label: String?` | `null` | Label displayed above the linear progress
+`icon: OdsLinearProgressIndicatorIcon?` | `null` | Icon displayed above the progress indicator
+`showCurrentValue: Boolean` | `false` | Controls the progress indicator current value visibility which is displayed in percent below the progress bar
+{:.table}
### Activity indicator
@@ -131,7 +103,7 @@ processes.
![Activity indicator light](images/progress_circular_light.png) ![Activity indicator dark](images/progress_circular_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
You can use the `OdsCircularProgressIndicator` composable like this:
@@ -140,7 +112,7 @@ You can use the `OdsCircularProgressIndicator` composable like this:
```kotlin
OdsCircularProgressIndicator(
progress = 0.9f,
- label = "Downloading ..." // Optional
+ label = "Downloading ..."
)
```
@@ -148,40 +120,15 @@ OdsCircularProgressIndicator(
```kotlin
OdsCircularProgressIndicator(
- label = "Downloading ..." // Optional
+ label = "Downloading ..."
)
```
-> **XML implementation**
-
-To create a circular progress indicator you will need to
-add `com.google.android.material.progressindicator.CircularProgressIndicator` in your layout
-
-API and source code:
-
-* `CircularProgressIndicator`: [Class description](https://developer.android.com/reference/com/google/android/material/progressindicator/CircularProgressIndicator), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/progressindicator/CircularProgressIndicator.java)
-
-The following example shows a **determinate** circular progress indicator.
-
-In the layout:
-
-```xml
-
-
-```
-
-The following example shows an **indeterminate** circular progress indicator.
-
-In the layout:
-
-```xml
-
-
-```
-
-## Component specific tokens
+##### OdsCircularProgressIndicator API
-_Soon available_
+Parameter | Default value | Description
+-- | -- | --
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the progress indicator
+`progress: Float?` | `null` | Progress indicator value where 0.0 represents no progress and 1.0 represents full progress. Values outside of this range are coerced into the range. If set to `null`, the progress indicator is indeterminate.
+`label: String?` | `null` | Label displayed below the circular progress
+{:.table}
diff --git a/docs/components/RadioButtons.md b/docs/components/RadioButtons.md
index 28f85566d..e3a2e3d68 100644
--- a/docs/components/RadioButtons.md
+++ b/docs/components/RadioButtons.md
@@ -5,19 +5,19 @@ description: Radio button selection control allows the user to select options.
---
Use radio buttons to:
-* Select a single option from a list
-* Expose all available options
-* If available options can be collapsed, consider using a dropdown menu
- instead, as it uses less space.
----
+* Select a single option from a list
+* Expose all available options
+* If available options can be collapsed, consider using a dropdown menu
+ instead, as it uses less space.
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Implementation](#implementation)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose)
+ * [OdsRadioButton API](#odsradiobutton-api)
---
@@ -25,7 +25,6 @@ Use radio buttons to:
- [Design System Manager - Selection controls](https://system.design.orange.com/0c1af118d/p/14638a-selection-controls/b/352c00)
- [Material Design - Radio buttons](https://material.io/components/radio-buttons/)
-- Technical documentation soon available
## Accessibility
@@ -40,76 +39,24 @@ usually unnecessary.
![RadioButton](images/radio_button_light.png) ![RadioButton dark](images/radio_button_dark.png)
-> **Jetpack Compose implementation**
+### Jetpack Compose
In your composable screen you can use:
```kotlin
OdsRadioButton(
selected = true,
- onClick = { },
+ onClick = { doSomething() },
enabled = true
)
```
-> **XML implementation**
-
-To create a Radio Button you just have to add a `RadioButton` in your layout. Orange theme will be
-automatically applied.
-
-In the layout:
-
-```xml
-
-```
-
-Changes in the states of one radio button can affect other buttons in the group.
-Specifically, selecting a `RadioButton` in a `RadioGroup` will de-select all
-other buttons in that group.
-
-Example showing a **radio button group** with five radio buttons.
-
-In the layout:
-
-```xml
-
-
-
-
-
-
-
-```
-
-## Component specific tokens
+#### OdsRadioButton API
-_Soon available_
+Parameter | Default value | Description
+-- | -- | --
+`selected: Boolean` | | Controls the selected state of the radio button
+`onClick: (() -> Unit)?` | | Callback invoked on radio button click. If `null`, then the radio button will not handle input events, and only act as a visual indicator of `selected` state.
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the radio button
+`enabled: Boolean` | `true` | Controls the enabled state of the radio button. When `false`, the button will not be selectable and appears disabled.
+{:.table}
diff --git a/docs/components/SheetsBottom.md b/docs/components/SheetsBottom.md
index 45757e424..9fe68d932 100644
--- a/docs/components/SheetsBottom.md
+++ b/docs/components/SheetsBottom.md
@@ -9,14 +9,12 @@ Use Sheets bottom to:
* Display content that complements the screen’s primary content
* Expose all complements options
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Implementation](#implementation)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose)
---
@@ -24,7 +22,6 @@ Use Sheets bottom to:
- [Design System Manager - Sheets](https://system.design.orange.com/0c1af118d/p/81f927-sheets-bottom/b/47b99b)
- [Material Design - Sheets: bottom](https://material.io/components/sheets-bottom)
-- Technical documentation soon available
## Accessibility
@@ -34,23 +31,25 @@ Please follow [accessibility criteria for development](https://a11y-guidelines.o
![BottomSheet light](images/sheetbottom_light.png) ![BottomSheet dark](images/sheetbottom_dark.png)
-> **Jetpack Compose implementation**
+The contents within a bottom sheet should follow their own accessibility guidelines, such as images having content descriptions set on them.
+
+### Jetpack Compose
```kotlin
OdsBottomSheetScaffold(
- sheetContent = {},
+ sheetContent = {
+ // Put here the content of the sheet
+ },
modifier = Modifier,
scaffoldState = rememberBottomSheetScaffoldState(),
topBar = null,
- snackbarHost = { },
+ snackbarHost = {},
floatingActionButton = {},
floatingActionButtonPosition = FabPosition.End,
sheetGesturesEnabled = true,
sheetPeekHeight = 56.dp,
- content = {}
+ content = {
+ // Put here the screen content
+ }
)
```
-
-## Component specific tokens
-
-_Soon available_
\ No newline at end of file
diff --git a/docs/components/Sliders.md b/docs/components/Sliders.md
index d1c6342a6..7ce6d871d 100644
--- a/docs/components/Sliders.md
+++ b/docs/components/Sliders.md
@@ -4,18 +4,21 @@ title: Sliders
description: Sliders allow users to make selections from a range of values.
---
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Variants](#variants)
- * [Continuous slider](#continuous-slider)
- * [Continuous lockups slider](#continuous-lockups-slider)
- * [Discrete slider](#discrete-slider)
- * [Discrete lockups slider](#discrete-lockups-slider)
-* [Component specific tokens](#component-specific-tokens)
+ * [Continuous slider](#continuous-slider)
+ * [Jetpack Compose](#jetpack-compose)
+ * [OdsSlider API](#odsslider-api)
+ * [Continuous lockups slider](#continuous-lockups-slider)
+ * [Jetpack Compose](#jetpack-compose-1)
+ * [OdsSliderLockups API](#odssliderlockups-api)
+ * [Discrete slider](#discrete-slider)
+ * [Jetpack Compose](#jetpack-compose-2)
+ * [Discrete lockups slider](#discrete-lockups-slider)
+ * [Jetpack Compose](#jetpack-compose-3)
---
@@ -23,29 +26,14 @@ description: Sliders allow users to make selections from a range of values.
- [Design System Manager - Sliders](https://system.design.orange.com/0c1af118d/p/8077fc-sliders/b/673558)
- [Material Design - Sliders](https://material.io/components/sliders/)
-- Technical documentation soon available
## Accessibility
Please follow [accessibility criteria for development](https://a11y-guidelines.orange.com/en/mobile/android/development/)
-Sliders support setting content descriptors for use with screen readers. While
-optional, we strongly encourage their use.
-
-That can be done in XML via the `android:contentDescription` attribute or
-programmatically like so:
-
-```kotlin
-slider.contentDescription = contentDescription
-```
-
-Additionally, if using a `TextView` to display the value of the slider, you
-should set `android:labelFor` on it, so that screen readers announce that
-`TextView` refers to the slider.
-
## Variants
-## Continuous slider
+### Continuous slider
Continuous sliders allow users to make meaningful selections that don’t require
a specific value.
@@ -56,15 +44,15 @@ With icons:
![Continuous slider with icons](images/slider_continuous_with_icon_light.png) ![Continuous slider with icons dark](images/slider_continuous_with_icon_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
In your composable screen you can use:
```kotlin
OdsSlider(
value = 20f,
- valueRange = 0f..100f,
- onValueChange = { }
+ steps = 9,
+ onValueChange = { doSomething() }
)
```
@@ -73,46 +61,35 @@ You can add icons to the continuous slider like this:
```kotlin
OdsSlider(
value = 20f,
- valueRange = 0f..100f,
- onValueChange = { },
- leftIcon = painterResource(id = R.drawable.ic_volume_status_1),
- leftIconContentDescription = stringResource(id = R.string.component_slider_low_volume),
- rightIcon = painterResource(id = R.drawable.ic_volume_status_4),
- rightIconContentDescription = stringResource(id = R.string.component_slider_high_volume)
+ steps = 9,
+ onValueChange = { doSomething() },
+ leftIcon = OdsSliderIcon(
+ painterResource(id = R.drawable.ic_volume_status_1),
+ stringResource(id = R.string.component_slider_low_volume)
+ ),
+ rightIcon = OdsSliderIcon(
+ painterResource(id = R.drawable.ic_volume_status_4),
+ stringResource(id = R.string.component_slider_high_volume)
+ )
)
```
-> **XML implementation**
-
-API and source code:
-
-* `Slider`: [Class definition](https://developer.android.com/reference/com/google/android/material/slider/Slider), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/slider/Slider.java)
+##### OdsSlider API
-Note: By default, the slider will show a value label above the thumb when it's
-selected. You can change how it's drawn via the `app:labelBehavior` attribute or
-`setLabelBehavior` method.
+Parameter | Default value | Description
+-- | -- | --
+`value: Float` | | Current value of the slider. If outside of `valueRange` provided, value will be coerced to this range.
+`onValueChange: (Float) -> Unit` | | Callback invoked on slider value change. `value` should be updated here.
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the slider
+`enabled: Boolean` | `true` | Controls the enabled state of the slider. If `false`, the user cannot interact with it.
+`valueRange: ClosedFloatingPointRange` | `0f..1f` | Range of values that the slider can take. Given `value` will be coerced to this range.
+`steps: Int` | `0` | If greater than `0`, specifies the amounts of discrete values, evenly distributed between across the whole value range. If `0`, slider will behave as a continuous slider and allow to choose any value from the range specified. Must not be negative.
+`onValueChangeFinished: (() -> Unit)?` | `null` | Callback invoked when value change has ended. This callback shouldn't be used to update the slider value (use `onValueChange` for that), but rather to know when the user has completed selecting a new value by ending a drag or a click.
+`leftIcon: OdsSliderIcon?` | `null` | Icon displayed on the left of the slider
+`rightIcon: OdsSliderIcon?` | `null` | Icon displayed on the right of the slider
+{:.table}
-The modes of `app:labelBehavior` are:
-
-* `floating` (default) - draws the label floating above the bounds of this
- view
-* `withinBounds` - draws the label floating within the bounds of this view
-* `gone` - prevents the label from being drawn
-
-**Adding a continuous slider in the layout**
-
-```xml
-
-```
-
-## Continuous lockups slider
+### Continuous lockups slider
![Continuous lockups slider](images/slider_continuous_lockups_light.png) ![Continuous lockups slider dark](images/slider_continuous_lockups_light.png)
@@ -120,7 +97,7 @@ With icons:
![Continuous lockups slider with icons](images/slider_continuous_lockups_with_icon_light.png) ![Continuous lockups slider with icons dark](images/slider_continuous_lockups_with_icon_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
In your composable screen you can use:
@@ -128,7 +105,7 @@ In your composable screen you can use:
OdsSliderLockups(
value = 20f,
valueRange = 0f..100f,
- onValueChange = { }
+ onValueChange = { doSomething() }
)
```
@@ -138,14 +115,33 @@ You can add icons to the continuous lockups slider like this:
OdsSliderLockups(
value = 20f,
valueRange = 0f..100f,
- onValueChange = { },
- leftIcon = painterResource(id = R.drawable.ic_volume_status_1),
- leftIconContentDescription = stringResource(id = R.string.component_slider_low_volume),
- rightIcon = painterResource(id = R.drawable.ic_volume_status_4),
- rightIconContentDescription = stringResource(id = R.string.component_slider_high_volume)
+ onValueChange = { doSomething() },
+ leftIcon = OdsSliderIcon(
+ painterResource(id = R.drawable.ic_volume_status_1),
+ stringResource(id = R.string.component_slider_low_volume)
+ ),
+ rightIcon = OdsSliderIcon(
+ painterResource(id = R.drawable.ic_volume_status_4),
+ stringResource(id = R.string.component_slider_high_volume)
+ )
)
```
+##### OdsSliderLockups API
+
+Parameter | Default value | Description
+-- | -- | --
+`value: Float` | | Current value of the slider. If outside of `valueRange` provided, value will be coerced to this range.
+`onValueChange: (Float) -> Unit` | | Callback invoked on slider value change. `value` should be updated here.
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the slider
+`enabled: Boolean` | `true` | Controls the enabled state of the slider. If `false`, the user cannot interact with it.
+`valueRange: ClosedFloatingPointRange` | `0f..1f` | Range of values that the slider can take. Given `value` will be coerced to this range.
+`steps: Int` | `0` | If greater than `0`, specifies the amounts of discrete values, evenly distributed between across the whole value range. If `0`, slider will behave as a continuous slider and allow to choose any value from the range specified. Must not be negative.
+`onValueChangeFinished: (() -> Unit)?` | `null` | Callback invoked when value change has ended. This callback shouldn't be used to update the slider value (use `onValueChange` for that), but rather to know when the user has completed selecting a new value by ending a drag or a click.
+`leftIcon: OdsSliderIcon?` | `null` | Icon displayed on the left of the slider
+`rightIcon: OdsSliderIcon?` | `null` | Icon displayed on the right of the slider
+{:.table}
+
### Discrete slider
Discrete sliders display a numeric value label upon pressing the thumb, which
@@ -157,7 +153,7 @@ With icons:
![Discrete slider with icon](images/slider_discrete_with_icon_light.png) ![Discrete slider with icon dark](images/slider_discrete_with_icon_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
In your composable screen you can use:
@@ -166,7 +162,7 @@ OdsSlider(
value = 20f,
valueRange = 0f..100f,
steps = 10,
- onValueChange = { }
+ onValueChange = { doSomething() }
)
```
@@ -177,33 +173,19 @@ OdsSlider(
value = 20f,
valueRange = 0f..100f,
steps = 10,
- onValueChange = { },
- leftIcon = painterResource(id = R.drawable.ic_volume_status_1),
- leftIconContentDescription = stringResource(id = R.string.component_slider_low_volume),
- rightIcon = painterResource(id = R.drawable.ic_volume_status_4),
- rightIconContentDescription = stringResource(id = R.string.component_slider_high_volume)
+ onValueChange = { doSomething() },
+ leftIcon = OdsSliderIcon(
+ painterResource(id = R.drawable.ic_volume_status_1),
+ stringResource(id = R.string.component_slider_low_volume)
+ ),
+ rightIcon = OdsSliderIcon(
+ painterResource(id = R.drawable.ic_volume_status_4),
+ stringResource(id = R.string.component_slider_high_volume)
+ )
)
```
-> **XML implementation**
-
-API and source code:
-
-* `Slider`: [Class definition](https://developer.android.com/reference/com/google/android/material/slider/Slider), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/slider/Slider.java)
-
-In the layout:
-
-```xml
-
-```
+Use [OdsSlider API](#odsslider-api).
### Discrete lockups slider
@@ -213,7 +195,7 @@ With icons:
![Discrete lockups slider with icons](images/slider_discrete_lockups_with_icon_light.png) ![Discrete lockups slider with icons dark](images/slider_discrete_lockups_with_icon_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
In your composable screen you can use:
@@ -222,7 +204,7 @@ OdsSliderLockups(
value = 20f,
valueRange = 0f..100f,
steps = 10,
- onValueChange = { }
+ onValueChange = { doSomething() }
)
```
@@ -233,14 +215,16 @@ OdsSliderLockups(
value = 20f,
valueRange = 0f..100f,
steps = 10,
- onValueChange = { },
- leftIcon = painterResource(id = R.drawable.ic_volume_status_1),
- leftIconContentDescription = stringResource(id = R.string.component_slider_low_volume),
- rightIcon = painterResource(id = R.drawable.ic_volume_status_4),
- rightIconContentDescription = stringResource(id = R.string.component_slider_high_volume)
+ onValueChange = { doSomething() },
+ leftIcon = OdsSliderIcon(
+ painterResource(id = R.drawable.ic_volume_status_1),
+ stringResource(id = R.string.component_slider_low_volume)
+ ),
+ rightIcon = OdsSliderIcon(
+ painterResource(id = R.drawable.ic_volume_status_4),
+ stringResource(id = R.string.component_slider_high_volume)
+ )
)
```
-## Component specific tokens
-
-_Soon available_
+Use [OdsSliderLockups API](#odssliderlockups-api).
diff --git a/docs/components/Snackbars.md b/docs/components/Snackbars.md
index 3cc7679e4..b702fafde 100644
--- a/docs/components/Snackbars.md
+++ b/docs/components/Snackbars.md
@@ -13,14 +13,12 @@ the screen, but can also be swiped off the screen.
Snackbars can also offer the ability to perform an action, such as undoing an
action that was just taken, or retrying an action that had failed.
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Implementation](#implementation)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose)
---
@@ -28,7 +26,6 @@ action that was just taken, or retrying an action that had failed.
- [Design System Manager - Toasts & Snackbars](https://system.design.orange.com/0c1af118d/p/887440-toast--snackbars/b/043ece)
- [Material Design - Snackbars](https://material.io/components/snackbars)
-- Technical documentation soon available
## Accessibility
@@ -39,19 +36,19 @@ screen readers, such as TalkBack. Text rendered in snackbars is automatically
provided to accessibility services. Additional content labels are usually
unnecessary.
-### Implementation
+## Implementation
- ![Snackbar light](images/snackbar_light.png)
+![Snackbar light](images/snackbar_light.png)
- ![Snackbar dark](images/snackbar_dark.png)
+![Snackbar dark](images/snackbar_dark.png)
With action button:
- ![Snackbar with action light](images/snackbar_with_action_light.png)
+![Snackbar with action light](images/snackbar_with_action_light.png)
- ![Snackbar with action dark](images/snackbar_with_action_dark.png)
+![Snackbar with action dark](images/snackbar_with_action_dark.png)
-> **Jetpack Compose implementation**
+### Jetpack Compose
We advise you to use a `Scaffold` to add an `OdsSnackbar` in order to make sure everything is displayed together in the right place according to Material Design.
Then use `OdsSnackbarHost` which provides the good margins to display the snackbar and `OdsSnackbar` as follow:
@@ -83,58 +80,3 @@ Scaffold(
)
}
```
-
-> **XML implementation**
-
-Calling `make` creates the snackbar, but doesn't cause it to be visible on the
-screen. To show it, use the `show` method on the returned `Snackbar` instance.
-Note that only one snackbar will be shown at a time. Showing a new snackbar will
-dismiss any previous ones first.
-
-To show a snackbar with a message and no action:
-
-```kotlin
-// The view used to make the snackbar.
-// This should be contained within the view hierarchy you want to display the
-// snackbar. Generally it can be the view that was interacted with to trigger
-// the snackbar, such as a button that was clicked, or a card that was swiped.
-val contextView = findViewById(R.id.context_view)
-
-Snackbar.make(contextView, R.string.text_label, Snackbar.LENGTH_SHORT)
- .show()
-```
-
-**Adding an action**
-
-To add an action, use the `setAction` method on the object returned from `make`.
-Snackbars are automatically dismissed when the action is clicked.
-
-To show a snackbar with a message and an action:
-
-```kotlin
-Snackbar.make(contextView, R.string.text_label, Snackbar.LENGTH_LONG)
- .setAction(R.string.action_text) {
- // Responds to click on the action
- }
- .show()
-```
-
-**Anchoring a snackbar**
-
-By default, `Snackbar`s will be anchored to the bottom edge of their parent
-view. However, you can use the `setAnchorView` method to make a `Snackbar`
-appear above a specific view within your layout, e.g. a `FloatingActionButton`.
-
-```kotlin
-Snackbar.make(...)
- .setAnchorView(fab)
- ...
-```
-
-This is especially helpful if you would like to place a `Snackbar` above
-navigational elements at the bottom of the screen, such as a `BottomAppBar` or
-`BottomNavigationView`.
-
-## Component specific tokens
-
-_Soon available_
diff --git a/docs/components/Switches.md b/docs/components/Switches.md
index d30ba6730..357673ca6 100644
--- a/docs/components/Switches.md
+++ b/docs/components/Switches.md
@@ -7,14 +7,13 @@ description: Switch selection control allows the user to select options.
Switches toggle the state of a single setting on or off. They are the preferred
way to adjust settings on mobile.
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Implementation](#implementation)
-* [Component specific tokens](#component-specific-tokens)
+ * [Jetpack Compose](#jetpack-compose)
+ * [OdsSwitch API](#odsswitch-api)
---
@@ -22,7 +21,6 @@ way to adjust settings on mobile.
- [Design System Manager - Selection controls](https://system.design.orange.com/0c1af118d/p/14638a-selection-controls/b/352c00)
- [Material Design - Switches](https://material.io/components/switches)
-- Technical documentation soon available
## Accessibility
@@ -33,76 +31,29 @@ screen readers, such as TalkBack. Text rendered in switches is automatically
provided to accessibility services. Additional content labels are usually
unnecessary.
-### Implementation
+## Implementation
![Switch](images/switch_light.png) ![Switch dark](images/switch_dark.png)
-> **Jetpack Compose implementation**
+### Jetpack Compose
In your composable screen you can use:
```kotlin
OdsSwitch(
checked = true,
- onCheckedChange = {
- // Do something
- },
+ onCheckedChange = { doSomething() },
enabled = true
)
```
-> **XML implementation**
-
-To create a Switch using Orange theme you will have to add `com.google.android.material.switchmaterial.SwitchMaterial` into your layout.
-
-API and source code:
-
-* `SwitchMaterial`: [Class definition](https://developer.android.com/reference/com/google/android/material/switchmaterial/SwitchMaterial), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/switchmaterial/SwitchMaterial.java)
-
-In the layout:
-
-```xml
-
-
-
-
-
-```
-
-In code:
-
-```kotlin
-// To check a switch
-switchMaterial.isChecked = true
-
-// To listen for a switch's checked/unchecked state changes
-switchMaterial.setOnCheckedChangeListener { buttonView, isChecked
- // Responds to switch being checked/unchecked
-}
-```
+#### OdsSwitch API
-## Component specific tokens
+Parameter | Default value | Description
+-- | -- | --
+`checked: Boolean` | | Controls the checked state of the switch
+`onCheckedChange: ((Boolean) -> Unit)?` | | Callback invoked on switch check. If `null`, then this is passive and relies entirely on a higher-level component to control the "checked" state.
+`modifier: Modifier` | `Modifier` | `Modifier` applied to the switch
+`enabled: Boolean` | `true` | Controls the enabled state of the switch. When `false`, the switch will not be checkable and appears disabled.
+{:.table}
-_Soon available_
diff --git a/docs/components/Tabs.md b/docs/components/Tabs.md
index b705914e2..2465d0bb8 100644
--- a/docs/components/Tabs.md
+++ b/docs/components/Tabs.md
@@ -4,16 +4,15 @@ title: Tabs
description: Tabs organize content across different screens, data sets, and other interactions.
---
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Variants](#variants)
- * [Fixed tabs](#fixed-tabs)
- * [Scrollable tabs](#scrollable-tabs)
-* [Component specific tokens](#component-specific-tokens)
+ * [Fixed tabs](#fixed-tabs)
+ * [Jetpack Compose](#jetpack-compose)
+ * [Scrollable tabs](#scrollable-tabs)
+ * [Jetpack Compose](#jetpack-compose-1)
---
@@ -21,7 +20,6 @@ description: Tabs organize content across different screens, data sets, and othe
- [Design System Manager - Tabs](https://system.design.orange.com/0c1af118d/p/513d27-tabs/b/50cb71)
- [Material Design - Tabs](https://material.io/components/tabs/)
-- Technical documentation soon available
## Accessibility
@@ -30,15 +28,6 @@ Please follow [accessibility criteria for development](https://a11y-guidelines.o
The Android tab components support screen reader descriptions for tabs and
badges. While optional, we strongly encourage their use.
-**Content description**
-
-Adding a content description to the entire `TabLayout` can be done in XML with
-the `android:contentDescription` attribute or programmatically like so:
-
-```kotlin
-tabLayout.contentDescription = contentDescription
-```
-
## Variants
### Fixed tabs
@@ -48,18 +37,19 @@ width of each tab is determined by dividing the number of tabs by the screen
width. They don’t scroll to reveal more tabs; the visible tab set represents the
only tabs available.
- > **Jetpack Compose implementation**
+#### Jetpack Compose
In Compose, the fixed tabs should be added inside of an `OdsTabRow`.
The used composable for tab depends on the type of tabs to display: classic `OdsTab` or `OdsLeadingIconTab`.
- ![Fixed tabs light](images/tabs_fixed_light.png)
+![Fixed tabs light](images/tabs_fixed_light.png)
- ![Fixed tabs dark](images/tabs_fixed_dark.png)
+![Fixed tabs dark](images/tabs_fixed_dark.png)
**`OdsTab` composable:**
This composable allows to display:
+
- an icon only tab
- a text label only tab
- a tab with an icon on top of text label
@@ -116,45 +106,6 @@ OdsTabRow(selectedTabIndex = pagerState.currentPage) {
}
)
}
-```
-
- > **XML implementation**
-
-API and source code:
-
-* `TabLayout`: [Class definition](https://developer.android.com/reference/com/google/android/material/tabs/TabLayout), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/tabs/TabLayout.java)
-* `TabItem`: [Class definition](https://developer.android.com/reference/com/google/android/material/tabs/TabItem), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/tabs/TabItem.java)
-
-In the layout:
-
-```xml
-
-
-
-
-
-
-
-
-
```
### Scrollable tabs
@@ -162,11 +113,11 @@ In the layout:
Scrollable tabs are displayed without fixed widths. They are scrollable, such
that some tabs will remain off-screen until scrolled.
- ![Scrollable tabs light](images/tabs_scrollable_light.png)
+![Scrollable tabs light](images/tabs_scrollable_light.png)
- ![Scrollable tabs dark](images/tabs_scrollable_dark.png)
+![Scrollable tabs dark](images/tabs_scrollable_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
For scrollable tabs, the tabs should be added inside of an `OdsScrollableTabRow`. This is the only difference with fixed tabs implementation.
As for fixed tabs, you can use an `OdsTab` composable or an `OdsLeadingIconTab` inside.
@@ -195,56 +146,3 @@ OdsScrollableTabRow(selectedTabIndex = pagerState.currentPage) {
)
}
```
-
-> **XML implementation**
-
-API and source code:
-
-* `TabLayout`: [Class definition](https://developer.android.com/reference/com/google/android/material/tabs/TabLayout), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/tabs/TabLayout.java)
-* `TabItem`: [Class definition](https://developer.android.com/reference/com/google/android/material/tabs/TabItem), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/tabs/TabItem.java)
-
-In the layout:
-
-```xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-```
-
-## Component specific tokens
-
-_Soon available_
diff --git a/docs/components/TextFields.md b/docs/components/TextFields.md
index c69381bb4..43035335d 100644
--- a/docs/components/TextFields.md
+++ b/docs/components/TextFields.md
@@ -4,18 +4,18 @@ title: Text fields
description: Text fields let users enter and edit text.
---
----
-
-**Page Summary**
+ **On this page**
* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Variants](#variants)
- * [Text field](#text-field)
- * [Password text field](#password-text-field)
+ * [Text field](#text-field)
+ * [Jetpack Compose](#jetpack-compose)
+ * [Password text field](#password-text-field)
+ * [Jetpack Compose](#jetpack-compose-1)
* [Extras](#extras)
- * [Character counter](#character-counter)
-* [Component specific tokens](#component-specific-tokens)
+ * [Character counter](#character-counter)
+ * [Jetpack Compose](#jetpack-compose-2)
---
@@ -23,40 +23,13 @@ description: Text fields let users enter and edit text.
- [Design System Manager - Text fields](https://system.design.orange.com/0c1af118d/p/483f94-text-fields/b/720e3b)
- [Material Design - Text fields](https://material.io/components/text-fields/)
-- Technical documentation soon available
## Accessibility
Please follow [accessibility criteria for development](https://a11y-guidelines.orange.com/en/mobile/android/development/)
Android's text field component APIs support both label text and helper text for informing the user
-as to what information is requested for a text field. While optional, their use is strongly
-encouraged.
-
-**Content description**
-
-When using **custom icons**, you should set a content description on them so that screen readers
-like TalkBack are able to announce their purpose or action, if any.
-
-For the leading icon, that can be achieved via the
-`app:startIconContentDescription` attribute or `setStartIconContentDescription`
-method. For the trailing icon, that can be achieved via the
-`app:endIconContentDescription` attribute or `setEndIconContentDescription`
-method.
-
-When setting an **error message** that contains special characters that screen readers or other
-accessibility systems are not able to read, you should set a content description via
-the `app:errorContentDescription` attribute or
-`setErrorContentDescription` method. That way, when the error needs to be announced, it will
-announce the content description instead.
-
-**Custom `EditText`**
-
-If you are using a custom `EditText` as `TextInputLayout`'s child and your text field requires
-different accessibility support than the one offered by
-`TextInputLayout`, you can set a `TextInputLayout.AccessibilityDelegate` via the
-`setTextInputAccessibilityDelegate` method. This method should be used in place of providing
-an `AccessibilityDelegate` directly on the `EditText`.
+as to what information is requested for a text field.
## Variants
@@ -65,47 +38,48 @@ an `AccessibilityDelegate` directly on the `EditText`.
A text field can be filled or outlined.
The outlined version is more accessible in term of contrast. This is the reason why Orange text fields are outlined.
- ![TextField outlined light](images/textfield_outlined_light.png)
- ![TextField outlined dark](images/textfield_outlined_dark.png)
+![TextField outlined light](images/textfield_outlined_light.png)
+![TextField outlined dark](images/textfield_outlined_dark.png)
- ![TextField filled light](images/textfield_filled_light.png)
- ![TextField filled dark](images/textfield_filled_dark.png)
+![TextField filled light](images/textfield_filled_light.png)
+![TextField filled dark](images/textfield_filled_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
To add a text field in your composable screen you can use the `OdsTextField` composable as follow:
```kotlin
var text by rememberSaveable { mutableStateOf("") }
OdsTextField(
- leadingIcon = painterResource(id = R.drawable.ic_heart), // Optional
- leadingIconContentDescription = "Like", // Optional
- onLeadingIconClick = { doSomething() }, // Optional
- trailing = OdsTextTrailing(text = "units"), // Optional, it can be one of the provided `OdsTextFieldTrailing`. See more information below.
- enabled = true, // true if not set
- readOnly = false, // false if not set
- isError = false, // false if not set
- errorMessage = "Error message", // Optional
+ leadingIcon = painterResource(id = R.drawable.ic_heart),
+ leadingIconContentDescription = "Like",
+ onLeadingIconClick = { doSomething() },
+ trailing = OdsTextTrailing(text = "units"), // It can be one of the provided `OdsTextFieldTrailing`. See more information below.
+ enabled = true,
+ readOnly = false,
+ isError = false,
+ errorMessage = "Error message",
value = text,
onValueChange = { text = it },
- label = "Label", // Optional
- placeholder = "Placeholder", // Optional
- visualTransformation = VisualTransformation.None, // `VisualTransformation.None` if not set
- keyboardOptions = KeyboardOptions.Default, // `KeyboardOptions.Default` if not set
- keyboardActions = KeyboardActions(), // `KeyboardActions()` if not set
- singleLine = false, // false if not set
- maxLines = Int.MAX_VALUE, // `Int.MAX_VALUE` if not set
+ label = "Label",
+ placeholder = "Placeholder",
+ visualTransformation = VisualTransformation.None,
+ keyboardOptions = KeyboardOptions.Default,
+ keyboardActions = KeyboardActions(),
+ singleLine = false,
+ maxLines = Int.MAX_VALUE,
characterCounter = {
OdsTextFieldCharacterCounter(
valueLength = valueLength,
maxChars = TextFieldMaxChars,
enabled = enabled
- )
- } // Optional
+ )
+ }
)
```
The library provides several `OdsTextFieldTrailing` that you can use as a trailing element for text field:
+
- `OdsIconTrailing`: Displays an icon as trailing element
- `OdsTextTrailing`: Displays a text as trailing element
@@ -113,7 +87,8 @@ If you want a more complex trailing element, you can use the other `OdsTextField
**Note:** You will find more information about the character counter in [Extras](#extras)
-**Custom theme configuration:** You can override the default display of text fields in your custom theme by overriding the `textFieldStyle` attribute as below:
+**Custom theme configuration:
+** You can override the default display of text fields in your custom theme by overriding the `textFieldStyle` attribute as below:
```kotlin
override val components: OdsComponentsConfiguration
@@ -123,95 +98,41 @@ override val components: OdsComponentsConfiguration
}
```
-> **XML implementation**
-
-_**Note:** The filled text field is the default style if the style is not set._
-
-API and source code:
-
-* `TextInputLayout`: [Class definition](https://developer.android.com/reference/com/google/android/material/textfield/TextInputLayout), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/textfield/TextInputLayout.java)
-* `TextInputEditText`: [Class definition](https://developer.android.com/reference/com/google/android/material/textfield/TextInputEditText), [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/textfield/TextInputEditText.java)
-
-In the layout:
-
-```xml
-
-
-
-
-
-
-```
-
-For outlined version:
-
-```xml
-
-
-
-
-
-```
-
-In code:
-
-```kotlin
-// Get input text
-val inputText = textField.editText?.text.toString()
-
-textField.editText?.doOnTextChanged { inputText, _, _, _ ->
- // Respond to input text change
-}
-```
-
### Password text field
Password text field is a text field implementation that includes password visual transformation and optional visualisation icon.
- ![TextField outlined password light](images/textfield_outlined_password_light.png)
- ![TextField outlined password dark](images/textfield_outlined_password_dark.png)
+![TextField outlined password light](images/textfield_outlined_password_light.png)
+![TextField outlined password dark](images/textfield_outlined_password_dark.png)
- ![TextField filled password light](images/textfield_filled_password_light.png)
- ![TextField filled password dark](images/textfield_filled_password_dark.png)
+![TextField filled password light](images/textfield_filled_password_light.png)
+![TextField filled password dark](images/textfield_filled_password_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
To add a password text field in your composable screen you can use the `OdsPasswordTextField` composable as follow:
```kotlin
var text by rememberSaveable { mutableStateOf("") }
OdsPasswordTextField(
- enabled = true, // true if not set
- readOnly = false, // false if not set
- isError = false, // false if not set
- errorMessage = "Error message", // Optional
+ enabled = true,
+ readOnly = false,
+ isError = false,
+ errorMessage = "Error message",
value = text,
onValueChange = { text = it },
- label = "Label", // Optional
- placeholder = "Placeholder", // Optional
- visualisationIcon = true, // `true` if not set
- keyboardOptions = KeyboardOptions.Default, // `KeyboardOptions.Default` if not set
- keyboardActions = KeyboardActions(), // `KeyboardActions()` if not set
+ label = "Label",
+ placeholder = "Placeholder",
+ visualisationIcon = true,
+ keyboardOptions = KeyboardOptions.Default,
+ keyboardActions = KeyboardActions(),
characterCounter = {
OdsTextFieldCharacterCounter(
valueLength = valueLength,
maxChars = TextFieldMaxChars,
enabled = enabled
- )
- } // Optional
+ )
+ }
)
```
@@ -219,19 +140,14 @@ OdsPasswordTextField(
Its appearance (outlined or filled) is inherited from text fields style configuration.
See [text field section](#text-field) if you want to change it in your custom theme.
-> **XML implementation**
-
-_Not available_
-
-
## Extras
### Character counter
- ![TextField character counter light](images/textfield_character_counter_light.png)
- ![TextField character counter dark](images/textfield_character_counter_dark.png)
+![TextField character counter light](images/textfield_character_counter_light.png)
+![TextField character counter dark](images/textfield_character_counter_dark.png)
-> **Jetpack Compose implementation**
+#### Jetpack Compose
In each TextField component, you can use the `characterCounter` parameter to add a character counter if there is a restriction on the number of characters in a field.
It will be placed properly below the text field, end aligned.
@@ -241,9 +157,9 @@ Please use the provided `OdsTextFieldCharacterCounter` composable for this behav
```kotlin
OdsTextFieldCharacterCounter(
modifier = Modifier.align(Alignment.End),
- valueLength = valueLength,
+ valueLength = valueLength,
maxChars = 20,
- enabled = true // `true` if not set. If `false` the counter is displayed with a disabled color
+ enabled = true // If `false` the counter is displayed with a disabled color
)
```
@@ -253,8 +169,4 @@ Be careful, the limitation behavior should be managed by yourself in the `onValu
if (text.length <= TextFieldMaxChars) {
value = text
}
-```
-
-## Component specific tokens
-
-_Soon available_
+```
\ No newline at end of file
diff --git a/lib/src/main/java/com/orange/ods/compose/component/appbar/top/OdsLargeTopAppBar.kt b/lib/src/main/java/com/orange/ods/compose/component/appbar/top/OdsLargeTopAppBar.kt
index bde309f00..29ca6bec1 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/appbar/top/OdsLargeTopAppBar.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/appbar/top/OdsLargeTopAppBar.kt
@@ -37,6 +37,18 @@ import com.orange.ods.compose.component.utilities.Preview
import com.orange.ods.compose.component.utilities.UiModePreviews
import com.orange.ods.compose.theme.OdsTheme
+/**
+ * Material ODS Top App Bar.
+ *
+ * The top app bar displays information and actions relating to the current screen.
+ *
+ * @param title Title displayed in the center of the top app bar.
+ * @param modifier [Modifier] applied to the top app bar.
+ * @param navigationIcon Icon displayed at the start of the top app bar.
+ * @param actions Actions displayed at the end of the top app bar. The default layout here is a [androidx.compose.foundation.layout.Row], so icons inside will be placed horizontally.
+ * @param overflowMenuActions Actions displayed in the overflow menu.
+ * @param scrollBehavior [TopAppBarScrollBehavior] attached to the top app bar.
+ */
@OptIn(ExperimentalMaterial3Api::class)
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/appbar/top/OdsTopAppBar.kt b/lib/src/main/java/com/orange/ods/compose/component/appbar/top/OdsTopAppBar.kt
index 81904ab5d..2a51b545d 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/appbar/top/OdsTopAppBar.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/appbar/top/OdsTopAppBar.kt
@@ -10,7 +10,6 @@
package com.orange.ods.compose.component.appbar.top
-import androidx.compose.foundation.layout.Row
import androidx.compose.material.AppBarDefaults
import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
@@ -36,13 +35,12 @@ import com.orange.ods.compose.theme.OdsTheme
* centering the title, use the other TopAppBar overload for a generic TopAppBar with no
* restriction on content.
*
- * @param title The title to be displayed in the center of the TopAppBar
- * @param modifier The [Modifier] to be applied to this TopAppBar
- * @param navigationIcon Optional navigation icon displayed at the start of the TopAppBar.
- * @param actions The actions displayed at the end of the TopAppBar.
- * The default layout here is a [Row], so icons inside will be placed horizontally.
- * @param overflowMenuActions The actions displayed in the overflow menu.
- * @param elevated True to set an elevation to the top app bar (shadow displayed), false otherwise.
+ * @param title Title displayed in the center of the top app bar.
+ * @param modifier [Modifier] applied to the top app bar.
+ * @param navigationIcon Icon displayed at the start of the top app bar.
+ * @param actions Actions displayed at the end of the top app bar. The default layout here is a [androidx.compose.foundation.layout.Row], so icons inside will be placed horizontally.
+ * @param overflowMenuActions Actions displayed in the overflow menu.
+ * @param elevated Controls the elevation of the top app bar: `true` to set an elevation to the top app bar (a shadow is displayed below), `false` otherwise.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/banner/OdsBanner.kt b/lib/src/main/java/com/orange/ods/compose/component/banner/OdsBanner.kt
index 6886f5ea4..9247f321b 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/banner/OdsBanner.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/banner/OdsBanner.kt
@@ -41,12 +41,11 @@ import com.orange.ods.compose.theme.OdsTheme
/**
* ODS banners.
*
- *
- * @param message text displayed in the banner.
- * @param firstButton principal button in the banner.
- * @param modifier modifiers for the Banner layout.
- * @param image image display in the banner.
- * @param secondButton Optional second button in the banner.
+ * @param message Text displayed into the banner.
+ * @param firstButton Primary button displayed in the banner.
+ * @param modifier [Modifier] applied to the banner layout.
+ * @param image Image displayed in the banner in a circle shape.
+ * @param secondButton Secondary button displayed into the banner next to the primary one.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/bottomnavigation/OdsBottomNavigation.kt b/lib/src/main/java/com/orange/ods/compose/component/bottomnavigation/OdsBottomNavigation.kt
index b41858b81..4883d5f04 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/bottomnavigation/OdsBottomNavigation.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/bottomnavigation/OdsBottomNavigation.kt
@@ -43,9 +43,8 @@ import com.orange.ods.compose.theme.OdsTheme
* See [OdsBottomNavigationItem] for configuration specific to each item, and not the overall
* OdsBottomNavigation component.
*
- * @param modifier optional [Modifier] for this OdsBottomNavigation
- * @param items destinations inside this OdsBottomNavigation, this contain multiple
- * [OdsBottomNavigationItem]s
+ * @param modifier [Modifier] applied to the bottom navigation.
+ * @param items List of [OdsBottomNavigationItem] displayed into the bottom navigation.
*/
@Composable
@OdsComposable
@@ -77,12 +76,12 @@ fun OdsBottomNavigation(
* An OdsBottomNavigationItem always shows text labels (if it exists) when selected. Showing text
* labels if not selected is controlled by [alwaysShowLabel].
*
- * @param selected whether this item is selected
- * @param onClick the callback to be invoked when this item is selected
- * @param icon icon for this item
+ * @param selected whether this item is selected.
+ * @param onClick the callback to be invoked when this item is selected.
+ * @param icon icon for this item.
* @param enabled controls the enabled state of this item. When `false`, this item will not
* be clickable and will appear disabled to accessibility services.
- * @param label optional text label for this item
+ * @param label optional text label for this item.
* @param alwaysShowLabel whether to always show the label for this item. If false, the label will
* only be shown when this item is selected.
*/
diff --git a/lib/src/main/java/com/orange/ods/compose/component/bottomsheet/OdsBottomSheetScaffold.kt b/lib/src/main/java/com/orange/ods/compose/component/bottomsheet/OdsBottomSheetScaffold.kt
index f3c261251..9c73f620f 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/bottomsheet/OdsBottomSheetScaffold.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/bottomsheet/OdsBottomSheetScaffold.kt
@@ -32,16 +32,16 @@ import com.orange.ods.compose.theme.OdsTheme
*
* Bottom Sheets are surfaces anchored to the bottom of the screen that present users supplement content.
*
- * @param sheetContent The content of the bottom sheet
- * @param modifier optional [Modifier] for this OdsBottomSheetScaffold
- * @param scaffoldState The state of the scaffold
- * @param topBar An optional top app bar
- * @param snackbarHost The composable hosting the snackbars shown inside the scaffold
- * @param floatingActionButton An optional floating action button
- * @param floatingActionButtonPosition The position of the floating action button
- * @param sheetGesturesEnabled Whether the bottom sheet can be interacted with by gestures
- * @param sheetPeekHeight The height of the bottom sheet when it is collapsed
- * @param content destinations inside this OdsBottomSheetScaffold
+ * @param sheetContent The content of the bottom sheet.
+ * @param modifier optional [Modifier] for this OdsBottomSheetScaffold.
+ * @param scaffoldState The state of the scaffold.
+ * @param topBar An optional top app bar.
+ * @param snackbarHost The composable hosting the snackbars shown inside the scaffold.
+ * @param floatingActionButton An optional floating action button.
+ * @param floatingActionButtonPosition The position of the floating action button.
+ * @param sheetGesturesEnabled Whether the bottom sheet can be interacted with by gestures.
+ * @param sheetPeekHeight The height of the bottom sheet when it is collapsed.
+ * @param content destinations inside this OdsBottomSheetScaffold.
*/
@Composable
@ExperimentalMaterialApi
diff --git a/lib/src/main/java/com/orange/ods/compose/component/button/OdsButton.kt b/lib/src/main/java/com/orange/ods/compose/component/button/OdsButton.kt
index b45b15ce2..6b250960e 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/button/OdsButton.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/button/OdsButton.kt
@@ -56,18 +56,16 @@ enum class OdsButtonStyle {
* Contained buttons are high-emphasis, distinguished by their use of elevation and fill. They
* contain actions that are primary to your app.
*
- * @param text Text displayed in the button
- * @param onClick Will be called when the user clicks the button
- * @param modifier Modifier to be applied to the button
- * @param icon Icon displayed in the button before the text. If `null`, no icon will be displayed.
- * @param enabled Controls the enabled state of the button. When `false`, this button will not
- * be clickable
- * @param style Controls the style of the button. Use `OdsButtonStyle.Primary` for an highlighted button style. To get a green/red button
- * style on contained buttons, you can use `OdsButtonStyle.FunctionalPositive` or `OdsButtonStyle.FunctionalNegative` values.
- * @param displaySurface optional allow to force the button display on a dark or light
- * surface. By default the appearance applied is based on the system night mode value.
+ * @param text Text displayed into the button.
+ * @param onClick Callback invoked when the button is clicked.
+ * @param modifier [Modifier] applied to the button.
+ * @param icon Icon displayed in the button before the text.
+ * @param enabled Controls the enabled state of the button. When `false`, this button will not be clickable.
+ * @param style Style applied to the button. Set it to [OdsButtonStyle.Primary] for an highlighted button style or use.
+ * [OdsButtonStyle.FunctionalPositive]/[OdsButtonStyle.FunctionalNegative] for a functional green/red button style.
+ * @param displaySurface [OdsDisplaySurface] applied to the button. It allows to force the button display on light or dark surface.
+ * By default the appearance applied is based on the system night mode value.
*/
-
@Composable
@OdsComposable
fun OdsButton(
diff --git a/lib/src/main/java/com/orange/ods/compose/component/button/OdsFloatingActionButton.kt b/lib/src/main/java/com/orange/ods/compose/component/button/OdsFloatingActionButton.kt
index c13d14431..2ced7ff86 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/button/OdsFloatingActionButton.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/button/OdsFloatingActionButton.kt
@@ -48,10 +48,10 @@ private val FabIconSize = 24.dp
*
* @see androidx.compose.material.FloatingActionButton for further information.
*
- * @param icon The FAB icon.
- * @param onClick callback invoked when this FAB is clicked
- * @param modifier [Modifier] to be applied to this FAB.
- * @param mini If `true`, the size of the FAB will be 40dp, otherwise the default size will be used.
+ * @param icon Icon used into the FAB.
+ * @param onClick Callback invoked on FAB click.
+ * @param modifier [Modifier] applied to the FAB.
+ * @param mini Controls the size of the FAB. If `true`, the size of the FAB will be 40dp, otherwise the default size will be used.
*/
@Composable
@OdsComposable
@@ -81,10 +81,10 @@ fun OdsFloatingActionButton(
*
* @see androidx.compose.material.ExtendedFloatingActionButton for further information.
*
- * @param icon The FAB icon.
- * @param onClick callback invoked when this FAB is clicked
- * @param text The text displayed in the [OdsExtendedFloatingActionButton]
- * @param modifier [Modifier] to be applied to this FAB.
+ * @param icon Icon used into the FAB.
+ * @param onClick Callback invoked on FAB click.
+ * @param text Text displayed into the FAB.
+ * @param modifier [Modifier] applied to the FAB.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/button/OdsIconButton.kt b/lib/src/main/java/com/orange/ods/compose/component/button/OdsIconButton.kt
index e9797b168..a088e8c2d 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/button/OdsIconButton.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/button/OdsIconButton.kt
@@ -32,13 +32,11 @@ import com.orange.ods.compose.theme.OdsDisplaySurface
*
* This component is typically used inside an App Bar for the navigation icon / actions.
*
- * @param icon The icon to be drawn inside the OdsIconButton
- * @param onClick The lambda to be invoked when this icon is pressed
- * @param modifier The [Modifier] for this OdsIconButton
- * @param enabled Whether or not this [OdsIconButton] will handle input events and appear enabled for
- * semantics purposes, true by default
- * @param displaySurface Force the button display on a dark or light surface. By default the appearance applied
- * is based on the system night mode value.
+ * @param icon Icon to be drawn into the button.
+ * @param onClick Callback to be invoked when the button is clicked.
+ * @param modifier [Modifier] to be applied to the button.
+ * @param enabled Controls the enabled state of the button. When `false`, this button will not be clickable.
+ * @param displaySurface [OdsDisplaySurface] to be applied to the button. It allows to force the button display on light or dark surface. By default, the appearance applied is based on the system night mode value.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/button/OdsIconToggleButton.kt b/lib/src/main/java/com/orange/ods/compose/component/button/OdsIconToggleButton.kt
index 49d7bc66f..41fd13e71 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/button/OdsIconToggleButton.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/button/OdsIconToggleButton.kt
@@ -32,15 +32,13 @@ import com.orange.ods.compose.theme.OdsDisplaySurface
* An [IconButton] with two states, for icons that can be toggled 'on' and 'off', such as a
* bookmark icon, or a navigation icon that opens a drawer.
*
- * @param checked Whether this OdsIconToggleButton is currently checked
- * @param onCheckedChange Callback to be invoked when this icon is selected
- * @param uncheckedIcon The icon displayed when unchecked
- * @param checkedIcon The icon displayed when checked
- * @param modifier [Modifier] for this OdsIconToggleButton
- * @param enabled Whether or not this OdsIconToggleButton will handle input events and appear
- * enabled for semantics purposes
- * @param displaySurface Allow to force the button display on a dark or light
- * surface. By default the appearance applied is based on the system night mode value.
+ * @param checked Controls the checked state of the button.
+ * @param onCheckedChange Callback invoked when the button is checked.
+ * @param uncheckedIcon Icon displayed when the button is unchecked.
+ * @param checkedIcon Icon displayed when the button is checked.
+ * @param modifier [Modifier] applied to the button.
+ * @param enabled Controls the enabled state of the button. When `false`, this button will not be clickable.
+ * @param displaySurface [OdsDisplaySurface] applied to the button. It allows to force the button display on light or dark surface. By default, the appearance applied is based on the system night mode value.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/button/OdsIconToggleButtonsRow.kt b/lib/src/main/java/com/orange/ods/compose/component/button/OdsIconToggleButtonsRow.kt
index d4a3c2806..04e72472b 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/button/OdsIconToggleButtonsRow.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/button/OdsIconToggleButtonsRow.kt
@@ -51,12 +51,12 @@ import com.orange.ods.compose.utilities.extension.enable
* A group of toggle buttons. Only one option in a group of toggle buttons can be selected and active at a time.
* Selecting one option deselects any other.
*
- * @param icons Contains the [OdsIconToggleButtonsRowIcon] to display in the toggle group
- * @param selectedIndex The [icons] list index of the selected button.
- * @param onSelectedIndexChange Callback to be invoked when the selection change.
- * @param modifier optional [Modifier] for this OdsIconToggleButtonsRow
- * @param displaySurface optional allow to force the group display on a dark or light
- * surface. By default the appearance applied is based on the system night mode value.
+ * @param icons List of [OdsIconToggleButtonsRowIcon] displayed into the toggle group.
+ * @param selectedIndex [icons] list index of the selected button.
+ * @param onSelectedIndexChange Callback invoked on selection change.
+ * @param modifier [Modifier] applied to the toggle buttons group.
+ * @param displaySurface [OdsDisplaySurface] applied to the button. It allows to force the button display on light or dark surface. By default, the
+ * appearance applied is based on the system night mode value.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/button/OdsOutlinedButton.kt b/lib/src/main/java/com/orange/ods/compose/component/button/OdsOutlinedButton.kt
index 67c8860ec..b1360916e 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/button/OdsOutlinedButton.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/button/OdsOutlinedButton.kt
@@ -35,14 +35,13 @@ import com.orange.ods.theme.colors.OdsColors
* Outlined buttons are medium-emphasis buttons. They contain actions that are important, but aren't
* the primary action in an app.
*
- * @param text Text displayed in the button
- * @param onClick Will be called when the user clicks the button
- * @param modifier Modifier to be applied to the button
- * @param icon Icon displayed in the button before the text. If `null`, no icon will be displayed.
- * @param enabled Controls the enabled state of the button. When `false`, this button will not
- * be clickable
- * @param displaySurface optional allow to force the button display on a dark or light
- * surface. By default the appearance applied is based on the system night mode value.
+ * @param text Text displayed into the button.
+ * @param onClick Callback invoked on button click.
+ * @param modifier [Modifier] applied to the button.
+ * @param icon Icon displayed in the button before the text.
+ * @param enabled Controls the enabled state of the button. When `false`, the button is not clickable.
+ * @param displaySurface [OdsDisplaySurface] applied to the button. It allows to force the button display on light or dark surface. By default, the
+ * appearance applied is based on the system night mode value.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/button/OdsTextButton.kt b/lib/src/main/java/com/orange/ods/compose/component/button/OdsTextButton.kt
index fdae998c5..755a82b8b 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/button/OdsTextButton.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/button/OdsTextButton.kt
@@ -46,15 +46,15 @@ enum class OdsTextButtonStyle {
* Text buttons are typically used for less-pronounced actions, including those located in dialogs
* and cards. In cards, text buttons help maintain an emphasis on card content.
*
- * @param text Text displayed in the button
- * @param onClick Will be called when the user clicks the button
- * @param modifier Modifier to be applied to the button
- * @param icon Icon displayed before the text. If `null`, no icon will be displayed.
- * @param enabled Controls the enabled state of the button. When `false`, this button will not
- * be clickable.
- * @param style Controls the style of the button. By default the `onSurface` color is used.
- * @param displaySurface optional allow to force the button display on a dark or light
- * surface. By default the appearance applied is based on the system night mode value.
+ * @param text Text displayed into the button.
+ * @param onClick Callback invoked on button click.
+ * @param modifier [Modifier] applied to the button.
+ * @param icon Icon displayed in the button before the text.
+ * @param enabled Controls the enabled state of the button. When `false`, this button will not be clickable.
+ * @param style Style applied to the button. By default `onSurface` color is used for text color. Use [OdsTextButtonStyle.Primary] for an highlighted
+ * text color.
+ * @param displaySurface [OdsDisplaySurface] applied to the button. It allows to force the button display on light or dark surface. By default,
+ * the appearance applied is based on the system night mode value.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/button/OdsTextToggleButtonsRow.kt b/lib/src/main/java/com/orange/ods/compose/component/button/OdsTextToggleButtonsRow.kt
index 848f81c4f..b72f312c9 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/button/OdsTextToggleButtonsRow.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/button/OdsTextToggleButtonsRow.kt
@@ -41,13 +41,14 @@ import com.orange.ods.compose.theme.OdsDisplaySurface
* A group of toggle buttons. Only one option in a group of toggle buttons can be selected and active at a time.
* Selecting one option deselects any other.
*
- * @param textToggleButtons Contains the [OdsTextToggleButtonsRowItem] to display in the toggle group
- * @param selectedIndex The [textToggleButtons] list index of the selected button.
- * @param onSelectedIndexChange Callback to be invoked when the selection change.
- * @param modifier [Modifier] for this OdsTextToggleButtonsRow
- * @param sameItemsWeight if true, same weight of importance will be applied to each item, they will occupy the same width.
- * @param displaySurface allow to force the group display on a dark or light
- * surface. By default the appearance applied is based on the system night mode value.
+ * @param textToggleButtons List of [OdsTextToggleButtonsRowItem] displayed into the toggle group.
+ * @param selectedIndex [textToggleButtons] list index of the selected button.
+ * @param onSelectedIndexChange Callback invoked on selection change.
+ * @param modifier [Modifier] applied to the toggle buttons row.
+ * @param sameItemsWeight Controls the place occupied by each item. When `true`, same weight of importance will be applied to each item, they will occupy
+ * the same width.
+ * @param displaySurface [OdsDisplaySurface] applied to the button. It allows to force the button display on light or dark surface. By default,
+ * the appearance applied is based on the system night mode value.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/card/OdsHorizontalCard.kt b/lib/src/main/java/com/orange/ods/compose/component/card/OdsHorizontalCard.kt
index 0969119fb..49de54fd3 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/card/OdsHorizontalCard.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/card/OdsHorizontalCard.kt
@@ -41,16 +41,16 @@ import com.orange.ods.compose.theme.OdsTheme
*
* Cards contain content and actions about a single subject.
*
- * @param title The title to be displayed in the card.
- * @param image The card image.
- * @param modifier Modifier to be applied to the layout of the card.
- * @param subtitle Optional subtitle to be displayed in the card.
- * @param text Optional text description to be displayed in the card. It is truncated to fit on 2 lines.
- * @param firstButton Optional first button in the card.
- * @param secondButton Optional second button in the card.
- * @param imagePosition Position of the image, it can be [OdsHorizontalCardImagePosition.Start] or [OdsHorizontalCardImagePosition.End] in the card. [OdsHorizontalCardImagePosition.Start] by default.
- * @param divider If true, a divider is displayed between card content and the action buttons. True by default.
- * @param onClick Optional click on the card itself.
+ * @param title Title displayed into the card.
+ * @param image [OdsCardImage] displayed into the card.
+ * @param modifier [Modifier] applied to the layout of the card.
+ * @param subtitle Subtitle displayed into the card.
+ * @param text Text displayed into the card.
+ * @param firstButton First [OdsCardButton] displayed into the card.
+ * @param secondButton Second [OdsCardButton] displayed into the card.
+ * @param imagePosition Position of the image within the card, it can be set to [OdsHorizontalCardImagePosition.Start] or [OdsHorizontalCardImagePosition.End]. [OdsHorizontalCardImagePosition.Start] by default.
+ * @param divider Controls the divider display. If `true`, it will be displayed between the card content and the action buttons.
+ * @param onClick Callback invoked on card click.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/card/OdsSmallCard.kt b/lib/src/main/java/com/orange/ods/compose/component/card/OdsSmallCard.kt
index 257ec6ed5..d13481253 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/card/OdsSmallCard.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/card/OdsSmallCard.kt
@@ -31,12 +31,11 @@ import com.orange.ods.compose.theme.OdsTheme
*
* Cards contain content and actions about a single subject.
*
- * @param title The title to be displayed in the card.
- * @param image The card image.
- * @param modifier Modifier to be applied to the layout of the card.
- * @param subtitle Optional subtitle to be displayed in the card.
- * @param onClick Optional click on the card itself.
- *
+ * @param title Title displayed into the card.
+ * @param image [OdsCardImage] displayed into the card.
+ * @param modifier [Modifier] applied to the layout of the card.
+ * @param subtitle Subtitle displayed into the card.
+ * @param onClick Callback invoked on card click.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/card/OdsVerticalHeaderFirstCard.kt b/lib/src/main/java/com/orange/ods/compose/component/card/OdsVerticalHeaderFirstCard.kt
index d39b616a1..c65c15bc2 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/card/OdsVerticalHeaderFirstCard.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/card/OdsVerticalHeaderFirstCard.kt
@@ -37,15 +37,15 @@ import com.orange.ods.extension.orElse
*
* Cards contain content and actions about a single subject.
*
- * @param title The title to be displayed in the card.
- * @param image The card image.
- * @param modifier Modifier to be applied to the layout of the card.
- * @param thumbnail Optional card thumbnail: avatar, logo or icon.
- * @param subtitle Optional subtitle to be displayed in the card.
- * @param text Optional text description to be displayed in the card.
- * @param firstButton Optional first button in the card.
- * @param secondButton Optional second button in the card.
- * @param onClick Optional click on the card itself.
+ * @param title Title displayed into the card.
+ * @param image [OdsCardImage] displayed into the card.
+ * @param modifier [Modifier] applied to the layout of the card.
+ * @param thumbnail [OdsCardThumbnail] displayed into the card next to the title: avatar, logo or icon.
+ * @param subtitle Subtitle displayed into the card.
+ * @param text Text displayed into the card.
+ * @param firstButton First [OdsCardButton] displayed into the card.
+ * @param secondButton Second [OdsCardButton] displayed into the card.
+ * @param onClick Callback invoked on card click.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/card/OdsVerticalImageFirstCard.kt b/lib/src/main/java/com/orange/ods/compose/component/card/OdsVerticalImageFirstCard.kt
index db0a271c7..7c81a0362 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/card/OdsVerticalImageFirstCard.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/card/OdsVerticalImageFirstCard.kt
@@ -33,14 +33,14 @@ import com.orange.ods.compose.text.OdsTextSubtitle2
*
* Cards contain content and actions about a single subject.
*
- * @param title The title to be displayed in the card.
- * @param image The card image.
- * @param modifier Modifier to be applied to the layout of the card.
- * @param subtitle Optional subtitle to be displayed in the card.
- * @param text Optional text description to be displayed in the card.
- * @param firstButton Optional first button in the card.
- * @param secondButton Optional second button in the card.
- * @param onClick Optional click on the card itself.
+ * @param title Title displayed into the card.
+ * @param image [OdsCardImage] displayed into the card.
+ * @param modifier [Modifier] applied to the layout of the card.
+ * @param subtitle Subtitle displayed into the card.
+ * @param text Text displayed into the card.
+ * @param firstButton First [OdsCardButton] displayed into the card.
+ * @param secondButton Second [OdsCardButton] displayed into the card.
+ * @param onClick Callback invoked on card click.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/chip/OdsChip.kt b/lib/src/main/java/com/orange/ods/compose/component/chip/OdsChip.kt
index 9086a149d..0a13cc0d0 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/chip/OdsChip.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/chip/OdsChip.kt
@@ -49,15 +49,14 @@ import com.orange.ods.theme.OdsComponentsConfiguration
*
* Use Accompanist's [Flow Layouts](https://google.github.io/accompanist/flowlayout/) to wrap chips to a new line.
*
- * @param text Text to display in the chip.
- * @param onClick Called when the chip is clicked.
- * @param modifier Modifier to be applied to the chip
- * @param enabled When disabled, chip will not respond to user input. It will also appear visually
- * disabled and disabled to accessibility services.
- * @param selected When selected the chip is highlighted (useful for choice chips).
- * @param leadingIcon Icon at the start of the chip, preceding the content text.
- * @param leadingAvatar Avatar at the start of the chip displayed in a circle shape, preceding the content text.
- * @param onCancel Called when the cancel cross of the chip is clicked. Pass `null` here for no cancel cross.
+ * @param text Text displayed into the chip.
+ * @param onClick Callback invoked on chip click.
+ * @param modifier [Modifier] applied to the chip.
+ * @param enabled Controls the enabled state of the chip. When `false`, this chip will not respond to user input.
+ * @param selected Controls the selected state of the chip. When `true`, the chip is highlighted (useful for choice chips).
+ * @param leadingIcon [OdsChipLeadingIcon] displayed at the start of the chip, preceding the text.
+ * @param leadingAvatar [OdsChipLeadingAvatar] displayed in a circle shape at the start of the chip, preceding the content text.
+ * @param onCancel Callback called on chip cancel cross click. Pass `null` for no cancel cross.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/chip/OdsChoiceChipsFlowRow.kt b/lib/src/main/java/com/orange/ods/compose/component/chip/OdsChoiceChipsFlowRow.kt
index f3ffd42bb..7815e570b 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/chip/OdsChoiceChipsFlowRow.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/chip/OdsChoiceChipsFlowRow.kt
@@ -39,10 +39,10 @@ import com.orange.ods.compose.theme.OdsTheme
*
* Note that [OdsChoiceChip] are displayed outlined or filled according to your [OdsTheme] component configuration, outlined by default.
*
- * @param value The initial value of this OdsChoiceChipsFlowRow.
- * @param onValueChange The callback that is triggered when the value change.
- * @param modifier Modifier to be applied to the flow row.
- * @param chips The list of [OdsChoiceChip]s displayed inside this OdsChoiceChipsFlowRow.
+ * @param value The initial value of the choice chips flow row.
+ * @param onValueChange Callback invoked when the value changes. The new value is provided as parameter.
+ * @param modifier [Modifier] applied to the chips flow row.
+ * @param chips The list of [OdsChoiceChip] displayed into the chips flow row.
*/
@OptIn(ExperimentalLayoutApi::class)
@Composable
@@ -76,10 +76,10 @@ fun OdsChoiceChipsFlowRow(
/**
* OdsChoiceChip used in a [OdsChoiceChipsFlowRow]
*
- * @param text Text displayed in the chip
- * @param value The chip value
+ * @param text Text displayed in the chip.
+ * @param value The chip value.
* @param enabled If set to false, the chip is no more clickable and appears as disabled. True by default.
- * @param semantics The semantics applied on this choice chip
+ * @param semantics The semantics applied on this choice chip.
*/
class OdsChoiceChip(
val text: String,
diff --git a/lib/src/main/java/com/orange/ods/compose/component/chip/OdsFilterChip.kt b/lib/src/main/java/com/orange/ods/compose/component/chip/OdsFilterChip.kt
index 8bff263c0..268ca5ae1 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/chip/OdsFilterChip.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/chip/OdsFilterChip.kt
@@ -51,14 +51,13 @@ import com.orange.ods.theme.OdsComponentsConfiguration
*
* Use Accompanist's [Flow Layouts](https://google.github.io/accompanist/flowlayout/) to wrap chips to a new line.
*
- * @param text Text to display in the chip.
- * @param onClick called when the chip is clicked.
- * @param modifier Modifier to be applied to the chip
- * @param enabled When disabled, chip will not respond to user input. It will also appear visually
- * disabled and disabled to accessibility services.
- * @param selected Highlight the chip and display a selected icon if set to true.
- * @param leadingAvatar Optional avatar at the start of the chip, preceding the content text.
- * @param leadingContentDescription Content description associated to the leading element.
+ * @param text Text to be displayed into the chip.
+ * @param onClick Callback called on chip click.
+ * @param modifier [Modifier] to be applied to the chip.
+ * @param enabled Controls the enabled state of the chip. When `false`, this chip will not respond to user input. It also appears visually
+ * disabled and is disabled to accessibility services.
+ * @param selected Controls the selected state of the chip. When `true`, the chip is highlighted.
+ * @param leadingAvatar [OdsChipLeadingAvatar] to be displayed in a circle shape at the start of the chip, preceding the content text.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/control/OdsCheckbox.kt b/lib/src/main/java/com/orange/ods/compose/component/control/OdsCheckbox.kt
index 9d108d351..225022227 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/control/OdsCheckbox.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/control/OdsCheckbox.kt
@@ -34,12 +34,11 @@ import com.orange.ods.compose.utilities.extension.enable
* or off.
*
*
- * @param checked whether Checkbox is checked or unchecked
- * @param onCheckedChange callback to be invoked when checkbox is being clicked,
- * therefore the change of checked state in requested. If null, then this is passive
- * and relies entirely on a higher-level component to control the "checked" state.
- * @param modifier Modifier to be applied to the layout of the checkbox
- * @param enabled whether the component is enabled or grayed out
+ * @param checked Controls checked state of the checkbox.
+ * @param onCheckedChange Callback invoked on checkbox click. If `null`, then this is passive and relies entirely on a higher-level component to control
+ * the checked state.
+ * @param modifier [Modifier] applied to the layout of the checkbox.
+ * @param enabled Controls enabled state of the checkbox. When `false`, this checkbox will not be clickable.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/control/OdsRadioButton.kt b/lib/src/main/java/com/orange/ods/compose/component/control/OdsRadioButton.kt
index 5ce8e4ab8..3670bf552 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/control/OdsRadioButton.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/control/OdsRadioButton.kt
@@ -38,12 +38,11 @@ import com.orange.ods.compose.utilities.extension.enable
* [RadioButton]s can be combined together with [Text] in the desired layout (e.g. [Column] or
* [Row]) to achieve radio group-like behaviour, where the entire layout is selectable.
*
- * @param selected whether this radio button is selected or not
- * @param onClick callback to be invoked when the RadioButton is clicked. If null, then this
- * RadioButton will not handle input events, and only act as a visual indicator of [selected] state
- * @param modifier Modifier to be applied to the radio button
- * @param enabled Controls the enabled state of the [RadioButton]. When `false`, this button will
- * not be selectable and appears disabled
+ * @param selected Controls the selected state of the radio button.
+ * @param onClick Callback invoked on radio button click. If `null`, then the radio button will not handle input events, and only act as
+ * a visual indicator of [selected] state.
+ * @param modifier [Modifier] applied to the radio button.
+ * @param enabled Controls the enabled state of the radio button. When `false`, the button will not be selectable and appears disabled.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/control/OdsSlider.kt b/lib/src/main/java/com/orange/ods/compose/component/control/OdsSlider.kt
index 265c6e567..90028d3a1 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/control/OdsSlider.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/control/OdsSlider.kt
@@ -62,21 +62,17 @@ private const val ActiveTickColorAlpha = 0.4f
* You can allow the user to choose only between predefined set of values by specifying the amount
* of steps between min and max values.
*
- * @param value current value of the Slider. If outside of [valueRange] provided, value will be
- * coerced to this range.
- * @param onValueChange lambda in which value should be updated
- * @param modifier modifiers for the OdsSlider layout
- * @param enabled whether or not component is enabled and can be interacted with or not
- * @param valueRange range of values that Slider value can take. Passed [value] will be coerced to
- * this range
- * @param steps if greater than 0, specifies the amounts of discrete values, evenly distributed
- * between across the whole value range. If 0, slider will behave as a continuous slider and allow
- * to choose any value from the range specified. Must not be negative.
- * @param onValueChangeFinished lambda to be invoked when value change has ended. This callback
- * shouldn't be used to update the slider value (use [onValueChange] for that), but rather to
- * know when the user has completed selecting a new value by ending a drag or a click.
- * @param leftIcon Icon displayed on the left of the slider
- * @param rightIcon Icon displayed on the right of the slider
+ * @param value Current value of the slider. If outside of `valueRange` provided, value will be coerced to this range.
+ * @param onValueChange Callback invoked on slider value change. `value` should be updated here.
+ * @param modifier [Modifier] applied to the slider.
+ * @param enabled Controls the enabled state of the slider. If `false`, the user cannot interact with it.
+ * @param valueRange Range of values that the slider can take. Given [value] will be coerced to this range.
+ * @param steps If greater than `0`, specifies the amounts of discrete values, evenly distributed between across the whole value range. If `0`, slider will
+ * behave as a continuous slider and allow to choose any value from the range specified. Must not be negative.
+ * @param onValueChangeFinished Callback invoked when value change has ended. This callback shouldn't be used to update
+ * the slider value (use [onValueChange] for that), but rather to know when the user has completed selecting a new value by ending a drag or a click.
+ * @param leftIcon [OdsSliderIcon] displayed on the left of the slider.
+ * @param rightIcon [OdsSliderIcon] displayed on the right of the slider.
*/
@Composable
@OdsComposable
@@ -129,21 +125,17 @@ fun OdsSlider(
* You can allow the user to choose only between predefined set of values by specifying the amount
* of steps between min and max values.
*
- * @param value current value of the Slider. If outside of [valueRange] provided, value will be
- * coerced to this range.
- * @param onValueChange lambda in which value should be updated
- * @param modifier modifiers for the OdsSlider layout
- * @param enabled whether or not component is enabled and can be interacted with or not
- * @param valueRange range of values that Slider value can take. Passed [value] will be coerced to
- * this range
- * @param steps if greater than 0, specifies the amounts of discrete values, evenly distributed
- * between across the whole value range. If 0, slider will behave as a continuous slider and allow
- * to choose any value from the range specified. Must not be negative.
- * @param onValueChangeFinished lambda to be invoked when value change has ended. This callback
- * shouldn't be used to update the slider value (use [onValueChange] for that), but rather to
- * know when the user has completed selecting a new value by ending a drag or a click.
- * @param leftIcon Icon displayed on the left of the slider
- * @param rightIcon Icon displayed on the right of the slider
+ * @param value Current value of the slider. If outside of `valueRange` provided, value will be coerced to this range.
+ * @param onValueChange Callback invoked on slider value change. `value` should be updated here.
+ * @param modifier [Modifier] applied to the slider.
+ * @param enabled Controls the enabled state of the slider. If `false`, the user cannot interact with it.
+ * @param valueRange Range of values that the slider can take. Given [value] will be coerced to this range.
+ * @param steps If greater than `0`, specifies the amounts of discrete values, evenly distributed between across the whole value range. If `0`, slider will
+ * behave as a continuous slider and allow to choose any value from the range specified. Must not be negative.
+ * @param onValueChangeFinished Callback invoked when value change has ended. This callback shouldn't be used to update
+ * the slider value (use [onValueChange] for that), but rather to know when the user has completed selecting a new value by ending a drag or a click.
+ * @param leftIcon [OdsSliderIcon] displayed on the left of the slider.
+ * @param rightIcon [OdsSliderIcon] displayed on the right of the slider.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/control/OdsSwitch.kt b/lib/src/main/java/com/orange/ods/compose/component/control/OdsSwitch.kt
index 953345449..b3e377e32 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/control/OdsSwitch.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/control/OdsSwitch.kt
@@ -31,12 +31,11 @@ import com.orange.ods.compose.theme.OdsTheme
*
* Switches toggle the state of a single item on or off.
*
- * @param checked whether or not this component is checked
- * @param onCheckedChange callback to be invoked when Switch is being clicked,
- * therefore the change of checked state is requested. If null, then this is passive
- * and relies entirely on a higher-level component to control the "checked" state.
- * @param modifier Modifier to be applied to the switch layout
- * @param enabled whether the component is enabled or grayed out
+ * @param checked Controls the checked state of the switch.
+ * @param onCheckedChange Callback invoked on switch check. If `null`, then this is passive and relies entirely on a higher-level component to control
+ * the "checked" state.
+ * @param modifier [Modifier] applied to the switch.
+ * @param enabled Controls the enabled state of the switch. When `false`, the switch will not be checkable and appears disabled.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/dialog/OdsAlertDialog.kt b/lib/src/main/java/com/orange/ods/compose/component/dialog/OdsAlertDialog.kt
index f3dbc920b..c526aacc2 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/dialog/OdsAlertDialog.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/dialog/OdsAlertDialog.kt
@@ -32,15 +32,15 @@ import com.orange.ods.compose.text.OdsTextSubtitle1
* place them horizontally next to each other and fallback to horizontal placement if not enough
* space is available.
*
- * @param text The text which presents the details regarding the Dialog's purpose.
- * @param confirmButton The button which is meant to confirm a proposed action, thus resolving
- * what triggered the dialog.
- * @param modifier Modifier to be applied to the layout of the dialog.
- * @param onDismissRequest Executes when the user tries to dismiss the Dialog by clicking outside
- * or pressing the back button. This is not called when the dismiss button is clicked.
- * @param dismissButton The button which is meant to dismiss the dialog.
- * @param title The title of the Dialog which should specify the purpose of the Dialog. The title
- * is not mandatory, because there may be sufficient information inside the [text].
+ * @param text Text displayed into the dialog which presents the details regarding the Dialog's purpose.
+ * @param confirmButton [OdsAlertDialogButton] displayed into the dialog which is meant to confirm a proposed action, thus resolving what triggered
+ * the dialog
+ * @param modifier [Modifier] applied to the layout of the dialog.
+ * @param onDismissRequest Callback invoked when the user tries to dismiss the dialog by clicking outside or pressing the back button. This is not called
+ * when the dismiss button is clicked.
+ * @param dismissButton Button displayed into the dialog which is meant to dismiss the dialog.
+ * @param title Title displayed into the dialog which should specify the purpose of the dialog. The title is not mandatory, because there may be
+ * sufficient information inside the `text`.
* @param properties Typically platform specific properties to further configure the dialog.
*/
@Composable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/divider/OdsDivider.kt b/lib/src/main/java/com/orange/ods/compose/component/divider/OdsDivider.kt
index 595db4df9..b4b79ef7e 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/divider/OdsDivider.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/divider/OdsDivider.kt
@@ -25,8 +25,8 @@ private const val OdsDividerAlpha = 0.12f
/**
* An [OdsDivider] is a thin line of 1dp thickness that groups content in lists and layouts.
*
- * @param modifier Modifier to be applied to the divider
- * @param startIndent start offset of this line, no offset by default
+ * @param modifier Modifier to be applied to the divider.
+ * @param startIndent start offset of this line, no offset by default.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/imagetile/OdsImageTile.kt b/lib/src/main/java/com/orange/ods/compose/component/imagetile/OdsImageTile.kt
index 059196f02..d7384a51a 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/imagetile/OdsImageTile.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/imagetile/OdsImageTile.kt
@@ -47,16 +47,16 @@ import com.orange.ods.extension.orElse
/**
- * A image tile contains primary information which is an image. It can also contain secondary information such as text or action. Tiles have no more than two
+ * An image tile contains primary information which is an image. It can also contain secondary information such as text or action. Tiles have no more than two
* actions. They are usually used in grids.
*
- * @param image Image display in the [OdsImageTile].
- * @param legendAreaDisplayType Specify how the title and the icon are displayed relatively to the image. If set to [OdsImageTileLegendAreaDisplayType.None],
+ * @param image [OdsImageTileImage] displayed into the tile.
+ * @param legendAreaDisplayType Controls how the title and the icon are displayed relatively to the image. If set to [OdsImageTileLegendAreaDisplayType.None],
* no legend area will be displayed.
- * @param modifier Modifier to be applied to this [OdsImageTile]
- * @param title Title linked to the image. It is displayed according the [legendAreaDisplayType] value.
- * @param icon The [OdsImageTileIconToggleButton] displayed next to the title
- * @param onClick Callback to be invoked on tile click.
+ * @param modifier [Modifier] applied to the image tile.
+ * @param title Title displayed into the tile. It is linked to the image and displayed according to the [legendAreaDisplayType] value.
+ * @param icon [OdsImageTileIconToggleButton] displayed next to the title.
+ * @param onClick Callback invoked on tile click.
*/
@Composable
@OdsComposable
@@ -175,10 +175,10 @@ class OdsImageTileImage : OdsComponentImage {
/**
* An icon toggle button in an [OdsImageTile].
*
- * @param checked Specify if icon is currently checked
- * @param onCheckedChange Callback to be invoked when this icon is selected
- * @param checkedIcon Icon displayed in front of the [OdsImageTile] when icon is checked
- * @param uncheckedIcon Icon displayed in front of the [OdsImageTile] when icon is unchecked
+ * @param checked Specify if icon is currently checked.
+ * @param onCheckedChange Callback to be invoked when this icon is selected.
+ * @param checkedIcon Icon displayed in front of the [OdsImageTile] when icon is checked.
+ * @param uncheckedIcon Icon displayed in front of the [OdsImageTile] when icon is unchecked.
*/
class OdsImageTileIconToggleButton(
val checked: Boolean,
diff --git a/lib/src/main/java/com/orange/ods/compose/component/list/OdsListItem.kt b/lib/src/main/java/com/orange/ods/compose/component/list/OdsListItem.kt
index b2826ad51..3477221e7 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/list/OdsListItem.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/list/OdsListItem.kt
@@ -76,13 +76,13 @@ import com.orange.ods.extension.orElse
*
* To specify an icon type, use [Modifier.iconType] on [modifier] and call [OdsListItemIconScope.OdsListItemIcon] in the [icon] lambda.
*
- * @param modifier Modifier to be applied to the list item
- * @param text The primary text of the list item
- * @param trailing The `OdsListItemTrailing` element to display at the end of the list item
- * @param icon The leading supporting visual of the list item
- * @param secondaryText The secondary text of the list item
- * @param singleLineSecondaryText Whether the secondary text is single line
- * @param overlineText The text displayed above the primary text
+ * @param modifier Modifier to be applied to the list item.
+ * @param text The primary text of the list item.
+ * @param trailing The `OdsListItemTrailing` element to display at the end of the list item.
+ * @param icon The leading supporting visual of the list item.
+ * @param secondaryText The secondary text of the list item.
+ * @param singleLineSecondaryText Whether the secondary text is single line.
+ * @param overlineText The text displayed above the primary text.
*/
@Composable
@OdsComposable
@@ -117,12 +117,12 @@ fun OdsListItem(
* To make this [OdsListItem] clickable, use [Modifier.clickable].
* To specify an icon type, use [Modifier.iconType] on [modifier] and call [OdsListItemIconScope.OdsListItemIcon] in the [icon] lambda.
*
- * @param modifier Modifier to be applied to the list item
- * @param text The primary text of the list item
- * @param icon The leading supporting visual of the list item
- * @param secondaryText The secondary text of the list item
- * @param singleLineSecondaryText Whether the secondary text is single line
- * @param overlineText The text displayed above the primary text
+ * @param modifier Modifier to be applied to the list item.
+ * @param text The primary text of the list item.
+ * @param icon The leading supporting visual of the list item.
+ * @param secondaryText The secondary text of the list item.
+ * @param singleLineSecondaryText Whether the secondary text is single line.
+ * @param overlineText The text displayed above the primary text.
* @param trailing The trailing composable. Prefer other [OdsListItem] signature with an [OdsListItemTrailing] parameter as trailing if the trailing is one of
* the following elements: Checkbox, Switch, RadioButton, Icon or Caption text
*/
@@ -296,9 +296,9 @@ private fun computeRequiredHeight(
*
* This method throws an exception if no icon type has been specified on the [OdsListItem] modifier using the [Modifier.iconType] method.
*
- * @param painter Painter of the icon
- * @param contentDescription Content description of the icon
- * @param tint Icon color. Has not effect if icon type is different from `OdsListItemIconType.Icon`
+ * @param painter Painter of the icon.
+ * @param contentDescription Content description of the icon.
+ * @param tint Icon color. Has not effect if icon type is different from `OdsListItemIconType.Icon`.
*/
@Composable
@OdsComposable
@@ -339,7 +339,7 @@ fun OdsListItemIconScope.OdsListItemIcon(painter: Painter, contentDescription: S
/**
* An [OdsListItemIconScope] provides a scope for the icon of [OdsListItem].
*
- * @param iconType The icon type
+ * @param iconType The icon type.
*/
data class OdsListItemIconScope(val iconType: OdsListItemIconType?)
@@ -364,7 +364,7 @@ enum class OdsListItemIconType {
/**
* Specifies the icon type to display in an [OdsListItem].
*
- * @param iconType The icon type
+ * @param iconType The icon type.
*/
fun Modifier.iconType(iconType: OdsListItemIconType): Modifier {
return then(object : OdsListItemIconTypeModifier {
@@ -471,7 +471,7 @@ private fun OdsListItemTrailing(trailing: OdsListItemTrailing) {
/**
* Displays a divider at the bottom of an [OdsListItem].
*
- * @param startIndent The start indent of the divider
+ * @param startIndent The start indent of the divider.
*/
fun Modifier.divider(startIndent: Dp? = null): Modifier {
return then(object : OdsListItemDividerModifier {
diff --git a/lib/src/main/java/com/orange/ods/compose/component/menu/OdsDropdownMenu.kt b/lib/src/main/java/com/orange/ods/compose/component/menu/OdsDropdownMenu.kt
index e5c033c56..6f63b2359 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/menu/OdsDropdownMenu.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/menu/OdsDropdownMenu.kt
@@ -40,13 +40,12 @@ import com.orange.ods.compose.utilities.extension.enable
*
* @see androidx.compose.material.DropdownMenu
*
- * @param items The items of the dropdown menu
- * @param expanded Whether the menu is currently open and visible to the user
- * @param onDismissRequest Called when the user requests to dismiss the menu, such as by
- * tapping outside the menu's bounds
- * @param modifier The modifier to be applied to the menu
- * @param offset [DpOffset] to be added to the position of the menu
- * @param properties [PopupProperties] for further customization of the popup's behavior
+ * @param items List of [OdsDropdownMenuItem] displayed into the dropdown menu.
+ * @param expanded Controls whether the menu is currently open and visible to the user.
+ * @param onDismissRequest Callback invoked when the user requests to dismiss the menu, such as by tapping outside the menu's bounds.
+ * @param modifier [Modifier] applied to the dropdown menu.
+ * @param offset [DpOffset] added to the menu position.
+ * @param properties [PopupProperties] for further customization of the popup's behavior.
*/
@OdsComposable
@Composable
@@ -92,10 +91,10 @@ class OdsDropdownMenuItem private constructor(
/**
* Creates an instance of [OdsDropdownMenuItem].
*
- * @param text The text of the menu item
- * @param enabled Controls the enabled state of the menu item - when `false`, the menu item
- * @param divider Whether or not a divider is displayed at the bottom of the menu item
- * @param onClick Called when the menu item was clicked
+ * @param text The text of the menu item.
+ * @param enabled Controls the enabled state of the menu item - when `false`, the menu item.
+ * @param divider Whether or not a divider is displayed at the bottom of the menu item.
+ * @param onClick Called when the menu item was clicked.
*/
constructor(
text: String,
@@ -107,11 +106,11 @@ class OdsDropdownMenuItem private constructor(
/**
* Creates an instance of [OdsDropdownMenuItem].
*
- * @param text The text of the menu item
- * @param icon Optional icon to display in the menu item
- * @param enabled Controls the enabled state of the menu item - when `false`, the menu item
- * @param divider Whether or not a divider is displayed at the bottom of the menu item
- * @param onClick Called when the menu item was clicked
+ * @param text The text of the menu item.
+ * @param icon Optional icon to display in the menu item.
+ * @param enabled Controls the enabled state of the menu item - when `false`, the menu item.
+ * @param divider Whether or not a divider is displayed at the bottom of the menu item.
+ * @param onClick Called when the menu item was clicked.
*/
constructor(
text: String,
@@ -124,11 +123,11 @@ class OdsDropdownMenuItem private constructor(
/**
* Creates an instance of [OdsDropdownMenuItem].
*
- * @param text The text of the menu item
- * @param icon Optional icon to display in the menu item
- * @param enabled Controls the enabled state of the menu item - when `false`, the menu item
- * @param divider Whether or not a divider is displayed at the bottom of the menu item
- * @param onClick Called when the menu item was clicked
+ * @param text The text of the menu item.
+ * @param icon Optional icon to display in the menu item.
+ * @param enabled Controls the enabled state of the menu item - when `false`, the menu item.
+ * @param divider Whether or not a divider is displayed at the bottom of the menu item.
+ * @param onClick Called when the menu item was clicked.
*/
constructor(
text: String,
@@ -141,11 +140,11 @@ class OdsDropdownMenuItem private constructor(
/**
* Creates an instance of [OdsDropdownMenuItem].
*
- * @param text The text of the menu item
- * @param icon Optional icon to display in the menu item
- * @param enabled Controls the enabled state of the menu item - when `false`, the menu item
- * @param divider Whether or not a divider is displayed at the bottom of the menu item
- * @param onClick Called when the menu item was clicked
+ * @param text The text of the menu item.
+ * @param icon Optional icon to display in the menu item.
+ * @param enabled Controls the enabled state of the menu item - when `false`, the menu item.
+ * @param divider Whether or not a divider is displayed at the bottom of the menu item.
+ * @param onClick Called when the menu item was clicked.
*/
constructor(
text: String,
diff --git a/lib/src/main/java/com/orange/ods/compose/component/menu/OdsExposedDropdownMenu.kt b/lib/src/main/java/com/orange/ods/compose/component/menu/OdsExposedDropdownMenu.kt
index 08708229c..3ca58fe2d 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/menu/OdsExposedDropdownMenu.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/menu/OdsExposedDropdownMenu.kt
@@ -35,13 +35,13 @@ import kotlinx.parcelize.Parcelize
/**
* ODS menus.
*
- * @param label The label of the text field
- * @param items The [OdsExposedDropdownMenuItem]s displayed in the dropdown menu
- * @param selectedItem The selected item displayed in the text field
- * @param onItemSelectionChange The action executed when a dropdown menu item is selected. Can be used to get the menu value.
- * @param modifier The modifier to be applied to the menu
- * @param enabled controls the enabled state of the [OdsExposedDropdownMenu]. When `false`, the dropdown menu text field will
- * be neither clickable nor focusable, visually it will appear in the disabled UI state
+ * @param label The label of the text field.
+ * @param items List of [OdsExposedDropdownMenuItem] displayed in the dropdown menu.
+ * @param selectedItem Selected item displayed into the text field.
+ * @param onItemSelectionChange Callback invoked when a dropdown menu item is selected. It can be used to get the menu value.
+ * @param modifier [Modifier] applied to the dropdown menu.
+ * @param enabled Controls the enabled state of the dropdown menu. When `false`, the dropdown menu text field will be neither clickable nor focusable,
+ * visually it will appear in the disabled state.
*/
@OdsComposable
@OptIn(ExperimentalMaterialApi::class)
diff --git a/lib/src/main/java/com/orange/ods/compose/component/navigationdrawer/OdsModalDrawer.kt b/lib/src/main/java/com/orange/ods/compose/component/navigationdrawer/OdsModalDrawer.kt
index d592e8887..ed9c79468 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/navigationdrawer/OdsModalDrawer.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/navigationdrawer/OdsModalDrawer.kt
@@ -66,11 +66,11 @@ private const val SelectedItemOpacity = 20f / 255f
/**
* Navigation drawers provide ergonomic access to destinations in an app.
*
- * @param drawerHeader content inside the header of the drawer
- * @param drawerContentList content inside the body of the drawer
- * @param modifier to be applied to this drawer
- * @param drawerState state of the drawer
- * @param content content of the rest of the UI
+ * @param drawerHeader content inside the header of the drawer.
+ * @param drawerContentList content inside the body of the drawer.
+ * @param modifier to be applied to this drawer.
+ * @param drawerState state of the drawer.
+ * @param content content of the rest of the UI.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/progressindicator/OdsCircularProgressIndicator.kt b/lib/src/main/java/com/orange/ods/compose/component/progressindicator/OdsCircularProgressIndicator.kt
index 1701f8c8a..1743ba0f7 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/progressindicator/OdsCircularProgressIndicator.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/progressindicator/OdsCircularProgressIndicator.kt
@@ -32,11 +32,10 @@ import com.orange.ods.extension.orElse
*
* @see androidx.compose.material.CircularProgressIndicator
*
- * @param modifier The modifier applied to this progress indicator
- * @param progress The progress of this progress indicator, where 0.0 represents no progress and 1.0
- * represents full progress. Values outside of this range are coerced into the range. If set to `null`,
- * the progress indicator is indeterminate.
- * @param label The label displayed below the circular progress
+ * @param modifier [Modifier] applied to the progress indicator.
+ * @param progress Progress indicator value where 0.0 represents no progress and 1.0 represents full progress. Values outside of this range are coerced
+ * into the range. If set to `null`, the progress indicator is indeterminate.
+ * @param label Label displayed below the circular progress.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/progressindicator/OdsLinearProgressIndicator.kt b/lib/src/main/java/com/orange/ods/compose/component/progressindicator/OdsLinearProgressIndicator.kt
index d7e058320..7fc90f2fb 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/progressindicator/OdsLinearProgressIndicator.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/progressindicator/OdsLinearProgressIndicator.kt
@@ -50,13 +50,12 @@ import com.orange.ods.extension.orElse
*
* @see androidx.compose.material.LinearProgressIndicator
*
- * @param modifier The modifier applied to this progress indicator
- * @param progress The value of this progress indicator, where 0.0 represents no progress and 1.0
- * represents full progress. Values outside of this range are coerced into the range. If set to `null`,
- * the progress indicator is indeterminate.
- * @param label The label displayed above the linear progress
- * @param icon The icon displayed above the linear progress
- * @param showCurrentValue Indicates whether the current value is displayed
+ * @param modifier [Modifier] applied to the progress indicator.
+ * @param progress Progress indicator value where 0.0 represents no progress and 1.0 represents full progress. Values outside of this range are coerced
+ * into the range. If set to `null`, the progress indicator is indeterminate.
+ * @param label Label displayed above the linear progress.
+ * @param icon Icon displayed above the progress indicator.
+ * @param showCurrentValue Controls the progress indicator current value visibility.
*/
@OptIn(ExperimentalComposeUiApi::class)
@Composable
@@ -80,7 +79,7 @@ fun OdsLinearProgressIndicator(
) {
icon?.Content()
Spacer(Modifier.width(ButtonDefaults.IconSpacing))
-
+
if (label != null) {
Text(
text = label,
diff --git a/lib/src/main/java/com/orange/ods/compose/component/snackbar/OdsSnackbar.kt b/lib/src/main/java/com/orange/ods/compose/component/snackbar/OdsSnackbar.kt
index 693baf628..7e51f6474 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/snackbar/OdsSnackbar.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/snackbar/OdsSnackbar.kt
@@ -36,8 +36,8 @@ import com.orange.ods.compose.theme.OdsDisplaySurface
*
* @see androidx.compose.material.Snackbar
*
- * @param message text displayed in the snackbar
- * @param modifier modifiers for the Snackbar layout
+ * @param message text displayed in the snackbar.
+ * @param modifier modifiers for the Snackbar layout.
* @param actionLabel if set, it displays an [OdsTextButton] with the given [actionLabel] as an action of the snackbar.
* @param actionOnNewLine whether or not action should be put on the separate line. Recommended
* for action with long action text
@@ -73,8 +73,8 @@ fun OdsSnackbar(
*
* @see androidx.compose.material.Snackbar
*
- * @param snackbarData data about the current snackbar showing via [SnackbarHostState]
- * @param modifier modifiers for the Snackbar layout
+ * @param snackbarData data about the current snackbar showing via [SnackbarHostState].
+ * @param modifier modifiers for the Snackbar layout.
* @param actionOnNewLine whether or not action should be put on the separate line. Recommended
* for action with long action text
* @param onActionClick executed on action button click.
@@ -102,9 +102,9 @@ fun OdsSnackbar(
*
* @see androidx.compose.material.SnackbarHost
*
- * @param hostState state of this component to read and show [OdsSnackbar]s accordingly
- * @param modifier optional modifier for this component
- * @param snackbar the instance of the [OdsSnackbar] to be shown at the appropriate time with
+ * @param hostState state of this component to read and show [OdsSnackbar]s accordingly.
+ * @param modifier optional modifier for this component.
+ * @param snackbar the instance of the [OdsSnackbar] to be shown at the appropriate time with.
* appearance based on the [SnackbarData] provided as a param
*/
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/tab/OdsLeadingIconTab.kt b/lib/src/main/java/com/orange/ods/compose/component/tab/OdsLeadingIconTab.kt
index d61ddbcb3..d51fe444d 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/tab/OdsLeadingIconTab.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/tab/OdsLeadingIconTab.kt
@@ -35,11 +35,11 @@ import com.orange.ods.compose.theme.OdsTheme
*
* This should typically be used inside of an [OdsTabRow].
*
- * @param selected whether this tab is selected or not
- * @param onClick the callback to be invoked when this tab is selected
- * @param text the text label displayed in this tab
- * @param icon the icon displayed in this tab
- * @param modifier optional [Modifier] for this tab
+ * @param selected whether this tab is selected or not.
+ * @param onClick the callback to be invoked when this tab is selected.
+ * @param text the text label displayed in this tab.
+ * @param icon the icon displayed in this tab.
+ * @param modifier optional [Modifier] for this tab.
* @param enabled controls the enabled state of this tab. When `false`, this tab will not
* be clickable and will appear disabled to accessibility services.
*
diff --git a/lib/src/main/java/com/orange/ods/compose/component/tab/OdsScrollableTabRow.kt b/lib/src/main/java/com/orange/ods/compose/component/tab/OdsScrollableTabRow.kt
index cd59df52e..e78640c40 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/tab/OdsScrollableTabRow.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/tab/OdsScrollableTabRow.kt
@@ -33,8 +33,8 @@ import com.orange.ods.compose.theme.OdsTheme
* An OdsScrollableTabRow is a Jetpack Compose [ScrollableTabRow] with the Orange design and theme.
* @see ScrollableTabRow documentation
*
- * @param selectedTabIndex the index of the currently selected tab
- * @param modifier optional [Modifier] for this TabRow
+ * @param selectedTabIndex the index of the currently selected tab.
+ * @param modifier optional [Modifier] for this TabRow.
* @param tabs the tabs inside this TabRow. Typically this will be multiple [Tab]s. Each element
* inside this lambda will be measured and placed evenly across the TabRow, each taking up equal
* space. Use [OdsTab] to display Orange styled tabs.
diff --git a/lib/src/main/java/com/orange/ods/compose/component/tab/OdsTab.kt b/lib/src/main/java/com/orange/ods/compose/component/tab/OdsTab.kt
index 5b39ca7a7..9781b30a4 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/tab/OdsTab.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/tab/OdsTab.kt
@@ -35,13 +35,13 @@ import com.orange.ods.compose.theme.OdsTheme
*
* This should typically be used inside of an [OdsTabRow].
*
- * @param selected whether this tab is selected or not
- * @param onClick the callback to be invoked when this tab is selected
- * @param modifier optional [Modifier] for this tab
+ * @param selected whether this tab is selected or not.
+ * @param onClick the callback to be invoked when this tab is selected.
+ * @param modifier optional [Modifier] for this tab.
* @param enabled controls the enabled state of this tab. When `false`, this tab will not
* be clickable and will appear disabled to accessibility services.
* @param text the text label displayed in this tab. Always displayed in uppercase.
- * @param icon the optional icon displayed in this tab
+ * @param icon the optional icon displayed in this tab.
*
* @see OdsLeadingIconTab
*/
diff --git a/lib/src/main/java/com/orange/ods/compose/component/tab/OdsTabRow.kt b/lib/src/main/java/com/orange/ods/compose/component/tab/OdsTabRow.kt
index acf38b17b..33dd878b2 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/tab/OdsTabRow.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/tab/OdsTabRow.kt
@@ -33,8 +33,8 @@ import com.orange.ods.compose.theme.OdsTheme
* An OdsTabRow is a Jetpack Compose [TabRow] to which we applied the Orange design and theme.
* @see TabRow documentation
*
- * @param selectedTabIndex the index of the currently selected tab
- * @param modifier optional [Modifier] for this OdsTabRow
+ * @param selectedTabIndex the index of the currently selected tab.
+ * @param modifier optional [Modifier] for this OdsTabRow.
* @param tabs the tabs inside this TabRow. Typically this will be multiple [Tab]s. Each element
* inside this lambda will be measured and placed evenly across the TabRow, each taking up equal
* space. Use [OdsTab] to display Orange styled tabs.
diff --git a/lib/src/main/java/com/orange/ods/compose/component/textfield/OdsTextField.kt b/lib/src/main/java/com/orange/ods/compose/component/textfield/OdsTextField.kt
index 750afc82b..5837998cd 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/textfield/OdsTextField.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/textfield/OdsTextField.kt
@@ -43,11 +43,11 @@ import com.orange.ods.theme.OdsComponentsConfiguration
* @see [OdsOutlinedTextField]
* @see [OdsFilledTextField]
*
- * @param value the input text to be shown in the text field
+ * @param value the input text to be shown in the text field.
* @param onValueChange the callback that is triggered when the input service updates the text. An
* updated text comes as a parameter of the callback
- * @param trailing The `OdsTextFieldTrailing` element to display at the end of the text field
- * @param modifier a [Modifier] for this text field
+ * @param trailing The `OdsTextFieldTrailing` element to display at the end of the text field.
+ * @param modifier a [Modifier] for this text field.
* @param enabled controls the enabled state of the [TextField]. When `false`, the text field will
* be neither editable nor focusable, the input of the text field will not be selectable,
* visually text field will appear in the disabled UI state
@@ -61,11 +61,11 @@ import com.orange.ods.theme.OdsComponentsConfiguration
* the input text is empty. The default text style for internal [Text] is [Typography.subtitle1]
* @param leadingIcon the optional leading icon painter to be displayed at the beginning of the text field
* container
- * @param leadingIconContentDescription the optional content description for the leading icon
- * @param onLeadingIconClick the optional action executed on leading icon click
+ * @param leadingIconContentDescription the optional content description for the leading icon.
+ * @param onLeadingIconClick the optional action executed on leading icon click.
* @param isError indicates if the text field's current value is in error state. If set to
* true, the label, bottom indicator and trailing icon by default will be displayed in error color
- * @param errorMessage displayed when the [OdsTextField] is in error
+ * @param errorMessage displayed when the [OdsTextField] is in error.
* @param visualTransformation transforms the visual representation of the input [value].
* For example, you can use [androidx.compose.ui.text.input.PasswordVisualTransformation] to create a password
* text field. By default no visual transformation is applied
@@ -137,10 +137,10 @@ fun OdsTextField(
*
* If you are looking for an outlined version, see [OdsOutlinedTextField].
*
- * @param value the input text to be shown in the text field
+ * @param value the input text to be shown in the text field.
* @param onValueChange the callback that is triggered when the input service updates the text. An
* updated text comes as a parameter of the callback
- * @param modifier a [Modifier] for this text field
+ * @param modifier a [Modifier] for this text field.
* @param enabled controls the enabled state of the [TextField]. When `false`, the text field will
* be neither editable nor focusable, the input of the text field will not be selectable,
* visually text field will appear in the disabled UI state
@@ -154,13 +154,13 @@ fun OdsTextField(
* the input text is empty. The default text style for internal [Text] is [Typography.subtitle1]
* @param leadingIcon the optional leading icon painter to be displayed at the beginning of the text field
* container
- * @param leadingIconContentDescription the optional content description for the leading icon
- * @param onLeadingIconClick the optional action executed on leading icon click
+ * @param leadingIconContentDescription the optional content description for the leading icon.
+ * @param onLeadingIconClick the optional action executed on leading icon click.
* @param trailing The trailing composable. Prefer other [OdsTextField] signature with an [OdsTextFieldTrailing] parameter as trailing if the trailing is one of
* the following elements: Text, Icon or Dropdown menu arrow
* @param isError indicates if the text field's current value is in error state. If set to
* true, the label, bottom indicator and trailing icon by default will be displayed in error color
- * @param errorMessage displayed when the [OdsTextField] is in error
+ * @param errorMessage displayed when the [OdsTextField] is in error.
* @param visualTransformation transforms the visual representation of the input [value].
* For example, you can use [androidx.compose.ui.text.input.PasswordVisualTransformation] to create a password
* text field. By default no visual transformation is applied
diff --git a/lib/src/main/java/com/orange/ods/compose/component/textfield/OdsTextFieldsCommon.kt b/lib/src/main/java/com/orange/ods/compose/component/textfield/OdsTextFieldsCommon.kt
index 86b61fe67..a1fbad12a 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/textfield/OdsTextFieldsCommon.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/textfield/OdsTextFieldsCommon.kt
@@ -37,10 +37,10 @@ import com.orange.ods.compose.theme.OdsTheme
/**
* A character counter to display below the text field
*
- * @param valueLength the text field current value length
+ * @param valueLength the text field current value length.
* @param maxChars the maximum of characters to display in the counter. Note: the limitation behavior should be managed by yourself
* in the `onValueChange` method of the text field.
- * @param enabled set to false to display the text with a disabled color
+ * @param enabled set to false to display the text with a disabled color.
*/
@Composable
@OdsComposable
diff --git a/lib/src/main/java/com/orange/ods/compose/component/textfield/password/OdsPasswordTextField.kt b/lib/src/main/java/com/orange/ods/compose/component/textfield/password/OdsPasswordTextField.kt
index 97afe0200..cd583bab6 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/textfield/password/OdsPasswordTextField.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/textfield/password/OdsPasswordTextField.kt
@@ -43,10 +43,10 @@ import com.orange.ods.compose.component.utilities.UiModePreviews
*
* @see [OdsTextField]
*
- * @param value the input text to be shown in the text field
+ * @param value the input text to be shown in the text field.
* @param onValueChange the callback that is triggered when the input service updates the text. An
* updated text comes as a parameter of the callback
- * @param modifier a [Modifier] for this text field
+ * @param modifier a [Modifier] for this text field.
* @param enabled controls the enabled state of the [TextField]. When `false`, the text field will
* be neither editable nor focusable, the input of the text field will not be selectable,
* visually text field will appear in the disabled UI state
@@ -61,7 +61,7 @@ import com.orange.ods.compose.component.utilities.UiModePreviews
* @param visualisationIcon If `true`, an eye icon will be display to allow showing/hiding password.
* @param isError indicates if the text field's current value is in error state. If set to
* true, the label, bottom indicator and trailing icon by default will be displayed in error color
- * @param errorMessage displayed when the [OdsTextField] is in error
+ * @param errorMessage displayed when the [OdsTextField] is in error.
* @param keyboardOptions software keyboard options that contains configuration such as
* [KeyboardType] and [ImeAction].
* @param keyboardActions when the input service emits an IME action, the corresponding callback
diff --git a/lib/src/main/java/com/orange/ods/compose/component/textfield/search/OdsSearchTextField.kt b/lib/src/main/java/com/orange/ods/compose/component/textfield/search/OdsSearchTextField.kt
index f45a36e68..499d0d167 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/textfield/search/OdsSearchTextField.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/textfield/search/OdsSearchTextField.kt
@@ -40,10 +40,10 @@ import com.orange.ods.compose.theme.OdsTheme
* OdsSearchTextField component allows to display a text field in the top app bar of a search screen.
* @see androidx.compose.material.TextField
*
- * @param value the input text to be shown in the text field
+ * @param value the input text to be shown in the text field.
* @param onValueChange the callback that is triggered when the input service updates the text. An
* updated text comes as a parameter of the callback
- * @param modifier a [Modifier] for this text field
+ * @param modifier a [Modifier] for this text field.
* @param placeholder the placeholder to be displayed in the text field when the input text is empty.
*
*/
diff --git a/lib/src/main/java/com/orange/ods/compose/component/utilities/Image.kt b/lib/src/main/java/com/orange/ods/compose/component/utilities/Image.kt
index fc59d6ffe..f600146d3 100644
--- a/lib/src/main/java/com/orange/ods/compose/component/utilities/Image.kt
+++ b/lib/src/main/java/com/orange/ods/compose/component/utilities/Image.kt
@@ -26,11 +26,11 @@ import com.orange.ods.R
/**
* Displays an image in a disc
*
- * @param painter to draw
- * @param modifier Modifier applied to the image
- * @param contentDescription Content description of the image
- * @param circleSize The size of the final image, 40x40 by default
- * @param alpha Optional opacity to be applied to the Painter when it is rendered onscreen the default renders the Painter completely opaque
+ * @param painter to draw.
+ * @param modifier Modifier applied to the image.
+ * @param contentDescription Content description of the image.
+ * @param circleSize The size of the final image, 40x40 by default.
+ * @param alpha Optional opacity to be applied to the Painter when it is rendered onscreen the default renders the Painter completely opaque.
*/
@Composable
fun OdsImageCircleShape(
diff --git a/lib/src/main/java/com/orange/ods/compose/theme/OdsTheme.kt b/lib/src/main/java/com/orange/ods/compose/theme/OdsTheme.kt
index 069cfb26d..f73ebfcde 100644
--- a/lib/src/main/java/com/orange/ods/compose/theme/OdsTheme.kt
+++ b/lib/src/main/java/com/orange/ods/compose/theme/OdsTheme.kt
@@ -73,8 +73,8 @@ object OdsTheme {
* ODS theme is the theme to apply to your screens in an Orange Jetpack Compose application.
*
* @param themeConfiguration The configuration of the OdsTheme: colors, typography...
- * @param darkThemeEnabled Indicates whether the dark theme is enabled or not
- * @param content The content of the theme
+ * @param darkThemeEnabled Indicates whether the dark theme is enabled or not.
+ * @param content The content of the theme.
*/
@Composable
fun OdsTheme(