Skip to content

Commit

Permalink
Merge pull request #660 from Orange-OpenSource/develop
Browse files Browse the repository at this point in the history
Release 0.16.0
  • Loading branch information
florentmaitre authored Oct 10, 2023
2 parents 9ed3317 + f544c24 commit 4cbe0f3
Show file tree
Hide file tree
Showing 213 changed files with 4,420 additions and 164 deletions.
2 changes: 1 addition & 1 deletion DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repositories {

```groovy
dependencies {
implementation 'com.orange.ods.android:ods-lib:0.15.1'
implementation 'com.orange.ods.android:ods-lib:0.16.0'
}
```

Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
minSdk = Versions.minSdk
targetSdk = Versions.targetSdk
val versionCodeProperty = project.findTypedProperty<String>("versionCode")
versionCode = versionCodeProperty?.toInt() ?: 7
versionCode = versionCodeProperty?.toInt() ?: 8
versionName = version.toString()
val versionNameSuffixProperty = project.findTypedProperty<String>("versionNameSuffix")
versionNameSuffix = versionNameSuffixProperty
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/orange/ods/app/ui/MainTopAppBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ fun MainTopAppBar(
}

@Composable
private fun getTopAppBarSearchTextFieldAction(searchedText: MutableState<TextFieldValue>): OdsComponentContent {
return object : OdsComponentContent() {
private fun getTopAppBarSearchTextFieldAction(searchedText: MutableState<TextFieldValue>): OdsComponentContent<Nothing> {
return object : OdsComponentContent<Nothing>() {

@Composable
override fun Content(modifier: Modifier) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ sealed class Variant(
object AppBarsTopRegular : Variant(R.string.component_app_bars_top_regular, OdsComposable.OdsTopAppBar.name)
object AppBarsTopLarge : Variant(R.string.component_app_bars_top_large, OdsComposable.OdsLargeTopAppBar.name, true)

object ButtonsPrimary : Variant(R.string.component_buttons_highest_emphasis, "${OdsComposable.OdsButton.name} with ${OdsButtonStyle.Primary.name}")
object ButtonsDefault : Variant(R.string.component_buttons_high_emphasis, "${OdsComposable.OdsButton.name} with ${OdsButtonStyle.Default.name}")
object ButtonsOutlined : Variant(R.string.component_buttons_medium_emphasis, OdsComposable.OdsOutlinedButton.name)
object ButtonsText : Variant(R.string.component_buttons_low_emphasis, OdsComposable.OdsTextButton.name)
object ButtonsPrimary : Variant(R.string.component_buttons_high_emphasis, "${OdsComposable.OdsButton.name} with ${OdsButtonStyle.Primary.name}")
object ButtonsDefault : Variant(R.string.component_buttons_medium_emphasis, "${OdsComposable.OdsButton.name} with ${OdsButtonStyle.Default.name}")
object ButtonsOutlined : Variant(R.string.component_buttons_low_emphasis, OdsComposable.OdsOutlinedButton.name)
object ButtonsText : Variant(R.string.component_buttons_lowest_emphasis, OdsComposable.OdsTextButton.name)
object ButtonsTextToggleGroup : Variant(R.string.component_button_text_toggle_group, OdsComposable.OdsTextToggleButtonsRow.name)
object ButtonsFunctional : Variant(R.string.component_buttons_functional, "${OdsComposable.OdsButton.name} with a functional style")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import com.orange.ods.app.R
import com.orange.ods.app.ui.components.utilities.ComponentCustomizationBottomSheetScaffold
import com.orange.ods.app.ui.utilities.composable.CodeImplementationColumn
import com.orange.ods.app.ui.utilities.composable.FunctionCallCode
import com.orange.ods.app.ui.utilities.composable.IconPainterValue
import com.orange.ods.app.ui.utilities.composable.TechnicalText
import com.orange.ods.app.ui.utilities.composable.Title
import com.orange.ods.compose.OdsComposable
import com.orange.ods.compose.component.control.OdsSlider
import com.orange.ods.compose.component.control.OdsSliderIcon
import com.orange.ods.compose.component.control.OdsSliderLockups
import com.orange.ods.compose.component.list.OdsListItem
import com.orange.ods.compose.component.list.OdsSwitchTrailing
Expand Down Expand Up @@ -68,10 +68,10 @@ fun ComponentSliders() {
) {
val technicalText = if (shouldDisplayValue) OdsComposable.OdsSliderLockups.name else OdsComposable.OdsSlider.name
val steps = if (isStepped) 9 else 0
val leftIcon = if (hasSideIcons) painterResource(id = R.drawable.ic_volume_status_1) else null
val leftIconContentDescription = if (hasSideIcons) stringResource(id = R.string.component_slider_low_volume) else null
val rightIcon = if (hasSideIcons) painterResource(id = R.drawable.ic_volume_status_4) else null
val rightIconContentDescription = if (hasSideIcons) stringResource(id = R.string.component_slider_high_volume) else null
val leftIconContentDescription = stringResource(id = R.string.component_slider_low_volume)
val leftIcon = if (hasSideIcons) OdsSliderIcon(painterResource(id = R.drawable.ic_volume_status_1), leftIconContentDescription) else null
val rightIconContentDescription = stringResource(id = R.string.component_slider_high_volume)
val rightIcon = if (hasSideIcons) OdsSliderIcon(painterResource(id = R.drawable.ic_volume_status_4), rightIconContentDescription) else null

var sliderPosition by remember { mutableStateOf(0f) }
val valueRange = 0f..100f
Expand All @@ -90,9 +90,7 @@ fun ComponentSliders() {
valueRange = valueRange,
onValueChange = { sliderPosition = it },
leftIcon = leftIcon,
leftIconContentDescription = leftIconContentDescription,
rightIcon = rightIcon,
rightIconContentDescription = rightIconContentDescription
rightIcon = rightIcon
)
} else {
componentName = OdsComposable.OdsSlider.name
Expand All @@ -102,9 +100,7 @@ fun ComponentSliders() {
valueRange = valueRange,
onValueChange = { sliderPosition = it },
leftIcon = leftIcon,
leftIconContentDescription = leftIconContentDescription,
rightIcon = rightIcon,
rightIconContentDescription = rightIconContentDescription
rightIcon = rightIcon
)
}

Expand All @@ -118,10 +114,14 @@ fun ComponentSliders() {
lambda("onValueChange")
if (isStepped) stringRepresentation("steps", steps)
if (hasSideIcons) {
simple("leftIcon", IconPainterValue)
leftIconContentDescription?.let { string("leftIconContentDescription", it) }
simple("rightIcon", IconPainterValue)
rightIconContentDescription?.let { string("rightIconContentDescription", it) }
classInstance<OdsSliderIcon>("leftIcon") {
painter()
contentDescription(leftIconContentDescription)
}
classInstance<OdsSliderIcon>("rightIcon") {
painter()
contentDescription(rightIconContentDescription)
}
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@
<!-- Components Buttons -->
<string name="component_buttons">Buttons</string>
<string name="component_buttons_description">A button allows a user to perform an action or to navigate to another page. It contains a text label and a supporting icon can be displayed.</string>
<string name="component_buttons_highest_emphasis">Highest emphasis buttons</string>
<string name="component_buttons_high_emphasis">High emphasis buttons</string>
<string name="component_buttons_medium_emphasis">Medium emphasis buttons</string>
<string name="component_buttons_low_emphasis">Low emphasis buttons</string>
<string name="component_buttons_lowest_emphasis">Lowest emphasis buttons</string>
<string name="component_buttons_functional">Functional buttons</string>
<string name="component_buttons_text_toggle_group_same_weight">Same items weight</string>

Expand Down
11 changes: 11 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes done in ODS library will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.16.0](https://github.com/Orange-OpenSource/ods-android/compare/0.15.1...0.16.0) - 2023-10-10

### Added

- \[Lib\] Add `OdsModalDrawer` component documentation ([#652](https://github.com/Orange-OpenSource/ods-android/issues/652))

### Changed

- \[App\] Change buttons name ([#647](https://github.com/Orange-OpenSource/ods-android/issues/647))
- \[Lib\] Update `OdsSlider` and `OdsSliderLockups` APIs ([#648](https://github.com/Orange-OpenSource/ods-android/issues/648))

## [0.15.1](https://github.com/Orange-OpenSource/ods-android/compare/0.15.0...0.15.1) - 2023-09-28

### Changed
Expand Down
26 changes: 26 additions & 0 deletions docs/0.16.0/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
permalink: /404.html
layout: default
---

<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}

</style>

<div class="container">
<h1>404</h1>

<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>
167 changes: 167 additions & 0 deletions docs/0.16.0/components/AppBarsBottom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
---
layout: detail
title: "App bars: bottom"
description: A bottom app bar displays navigation and key actions at the bottom of mobile screens.
---

---

**Page Summary**

* [Specifications references](#specifications-references)
* [Accessibility](#accessibility)
* [Implementation](#implementation)
* [Component specific tokens](#component-specific-tokens)

---

## Specifications references

- [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

Please follow [accessibility criteria for development](https://a11y-guidelines.orange.com/en/mobile/android/development/)

Android's bottom app bar component APIs provide 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 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
<menu>
<item
android:contentDescription="@string/content_description_one" />
<item
android:contentDescription="@string/content_description_two" />
</menu>
```

## 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
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<!-- Note: A RecyclerView can also be used -->
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="100dp"
android:clipToPadding="false">

<!-- Scrollable content -->

</androidx.core.widget.NestedScrollView>

<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/bottomAppBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:navigationIcon="@drawable/ic_menu_24dp"
app:menu="@menu/bottom_app_bar"
/>

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_add_24dp"
app:layout_anchor="@id/bottomAppBar"
/>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
```

In `menu/bottom_app_bar.xml`:

```xml
<menu>

<item
android:id="@+id/search"
android:icon="@drawable/ic_search_24dp"
android:title="@string/search"
android:contentDescription="@string/content_description_search"
app:showAsAction="ifRoom"
/>

<item
android:id="@+id/more"
android:title="@string/more"
android:contentDescription="@string/content_description_more"
app:showAsAction="never"
/>

</menu>
```

In menu/navigation icon drawables:

```xml
<vector
android:tint="?attr/colorControlNormal">
</vector>
```

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_
4 changes: 4 additions & 0 deletions docs/0.16.0/components/AppBarsBottom_docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
layout: main
content_page: AppBarsBottom.md
---
Loading

0 comments on commit 4cbe0f3

Please sign in to comment.