Skip to content

Commit

Permalink
Merge pull request #453 from Orange-OpenSource/develop
Browse files Browse the repository at this point in the history
Release 0.11.0
  • Loading branch information
florentmaitre authored Mar 3, 2023
2 parents 5e0634c + 549b3da commit e039118
Show file tree
Hide file tree
Showing 241 changed files with 5,866 additions and 242 deletions.
54 changes: 37 additions & 17 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- develop
tags:
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:
Expand All @@ -18,12 +19,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up our JDK environment
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
Expand All @@ -47,16 +48,35 @@ jobs:
COMMIT_SHA=${BRANCH_SHA:-$GITHUB_SHA}
./gradlew assemble -PversionNameSuffix="-${COMMIT_SHA::7}" -PversionCode=$GITHUB_RUN_NUMBER --stacktrace
- name: Store artifacts
uses: actions/upload-artifact@v2
- name: Store demo artifacts
uses: actions/upload-artifact@v3
with:
name: library
path:
demo/build/outputs/apk/*/*.apk
lib/build/outputs/aar/*.aar
theme-contract/build/outputs/aar/*.aar
theme-innovation-cup/build/outputs/aar/*.aar
theme-orange/build/outputs/aar/*.aar
name: demo
path: demo/build/outputs/apk/*/*.apk

- name: Store lib artifacts
uses: actions/upload-artifact@v3
with:
name: lib
path: lib/build/outputs/aar/*.aar

- name: Store theme-contract artifacts
uses: actions/upload-artifact@v3
with:
name: theme-contract
path: theme-contract/build/outputs/aar/*.aar

- name: Store theme-innovation-cup artifacts
uses: actions/upload-artifact@v3
with:
name: theme-innovation-cup
path: theme-innovation-cup/build/outputs/aar/*.aar

- name: Store theme-orange artifacts
uses: actions/upload-artifact@v3
with:
name: theme-orange
path: theme-orange/build/outputs/aar/*.aar

maven-central-release:
runs-on: ubuntu-latest
Expand All @@ -67,12 +87,12 @@ jobs:
url: https://mvnrepository.com/artifact/com.orange.ods.android
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up our JDK environment
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
Expand Down Expand Up @@ -103,12 +123,12 @@ jobs:
url: https://github.com/Orange-OpenSource/ods-android/releases
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up our JDK environment
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
Expand All @@ -135,12 +155,12 @@ jobs:
url: https://appdistribution.firebase.google.com/testerapps
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up our JDK environment
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/app-distribution-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
if: github.repository == 'Orange-OpenSource/ods-android'
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up our JDK environment
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
Expand Down
5 changes: 4 additions & 1 deletion .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ repositories {

```groovy
dependencies {
implementation 'com.orange.ods.android:ods-lib:0.10.0'
implementation 'com.orange.ods.android:ods-lib:0.11.0'
}
```
24 changes: 24 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@ 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.11.0](https://github.com/Orange-OpenSource/ods-android/compare/0.10.0...0.11.0) - 2023-03-03

### Added

- \[Demo\] Add banner component ([#115](https://github.com/Orange-OpenSource/ods-android/issues/115))
- \[Demo\] Add label for FAB size customization ([#413](https://github.com/Orange-OpenSource/ods-android/issues/413))
- \[Demo\] Add bottom sheet component ([#360](https://github.com/Orange-OpenSource/ods-android/issues/360))
- \[Lib\] Add `OdsBottomSheetScaffold` component ([#360](https://github.com/Orange-OpenSource/ods-android/issues/360))
- \[Lib\] Add `OdsHorizontalCard` component ([#35](https://github.com/Orange-OpenSource/ods-android/issues/35))
- \[Lib\] Add `OdsBanner` component ([#115](https://github.com/Orange-OpenSource/ods-android/issues/115))

### Changed

- \[Lib\] Add label, current value and icon parameters to `OdsLinearProgressIndicator` component to display text and/or icon above the indicator, and the current value below if necessary ([#362](https://github.com/Orange-OpenSource/ods-android/issues/362))
- \[Lib\] Add label parameter to `OdsCircularProgressIndicator` component to display a text below the indicator ([#362](https://github.com/Orange-OpenSource/ods-android/issues/362))
- \[Lib\] Rename `OdsTitleFirstCard` and `OdsImageFirstCard` respectively into `OdsVerticalHeaderFirstCard` and `OdsVerticalImageFirstCard` ([#432](https://github.com/Orange-OpenSource/ods-android/issues/432))

### Fixed

- \[Demo\] Update application name and description in about page ([#419](https://github.com/Orange-OpenSource/ods-android/issues/419))
- \[Demo\] Fix accessibility bug by preventing Talkback to read the linear progress value twice ([#441](https://github.com/Orange-OpenSource/ods-android/issues/441))
- \[Demo\] Keep same bottom sheet height when content or not ([#447](https://github.com/Orange-OpenSource/ods-android/issues/447))

## [0.10.0](https://github.com/Orange-OpenSource/ods-android/compare/0.9.0...0.10.0) - 2023-02-07

### Added
Expand All @@ -30,6 +53,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- \[Demo\] Fix an accessibility bug where icon buttons were not focusable with Talkback ([#393](https://github.com/Orange-OpenSource/ods-android/issues/393))
- \[Demo\] Fix list item selection controls trailing vocalization: Checkboxes, Switches and Radio Buttons in lists ([#387](https://github.com/Orange-OpenSource/ods-android/issues/387))
- \[Demo\] Screens in about section now use current theme colors ([#390](https://github.com/Orange-OpenSource/ods-android/issues/390))
- \[Demo\] Fix crash when exiting the fixed tabs screen ([#418](https://github.com/Orange-OpenSource/ods-android/issues/418))
- \[Lib\] Fix cards vocalization when clickable ([#391](https://github.com/Orange-OpenSource/ods-android/issues/391))

### Removed
Expand Down
3 changes: 3 additions & 0 deletions demo/src/main/java/com/orange/ods/demo/ui/MainScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ private fun MainTabs(mainTabsState: MainTabsState) {
with(mainTabsState) {
pagerState?.let { pagerState ->
if (hasTabs) {
// Do not use tabs directly because this is a SnapshotStateList
// Thus its value can be modified and can lead to crashes if it becomes empty
val tabs = tabs.toList()
if (scrollableTabs.value) {
ScrollableTabRow(
tabs = tabs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ fun AboutScreen(onAboutItemClick: (Long) -> Unit) {
text = getVersion(context),
modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_xs))
)
OdsTextCaption(text = stringResource(id = R.string.about_copyright))
OdsTextCaption(
text = stringResource(id = R.string.about_description),
modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_xs))
)
OdsTextCaption(
text = stringResource(id = R.string.about_copyright),
modifier = Modifier.padding(top = dimensionResource(id = R.dimen.spacing_xs))
)
}

Spacer(modifier = Modifier.height(dimensionResource(id = R.dimen.spacing_m)))
Expand Down
31 changes: 24 additions & 7 deletions demo/src/main/java/com/orange/ods/demo/ui/components/Component.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sealed class Component(
AppBarsTop, BottomNavigation -> Alignment.TopCenter
Lists -> Alignment.BottomCenter
Sliders, TextFields -> Alignment.CenterEnd
Buttons, Cards, Checkboxes, Chips, Dialogs, FloatingActionButtons, Menus, Progress, RadioButtons, Snackbars, Switches, Tabs -> Alignment.Center
Banners, Buttons, Cards, SheetsBottom, Checkboxes, Chips, Dialogs, FloatingActionButtons, Menus, Progress, RadioButtons, Snackbars, Switches, Tabs -> Alignment.Center
}

object AppBarsTop : Component(
Expand Down Expand Up @@ -72,12 +72,20 @@ sealed class Component(
)
)

object Banners : Component(
R.string.component_banners,
R.drawable.il_banners,
null,
R.string.component_banners_description,
composableName = OdsComponent.OdsBanner.name
)

object Cards : Component(
R.string.component_cards,
R.drawable.il_cards,
null,
R.string.component_card_description,
listOf(Variant.CardImageFirst, Variant.CardTitleFirst, Variant.CardSmall)
listOf(Variant.CardVerticalImageFirst, Variant.CardVerticalHeaderFirst, Variant.CardSmall, Variant.CardHorizontal)
)

object Checkboxes : Component(
Expand Down Expand Up @@ -133,7 +141,7 @@ sealed class Component(
R.drawable.il_progress,
null,
R.string.component_progress_description,
listOf(Variant.ProgressBar, Variant.ProgressActivityIndicator)
listOf(Variant.ProgressLinear, Variant.ProgressCircular)
)

object RadioButtons : Component(
Expand All @@ -144,6 +152,14 @@ sealed class Component(
composableName = OdsComponent.OdsRadioButton.name
)

object SheetsBottom : Component(
R.string.component_sheets_bottom,
R.drawable.il_bottom_sheet,
null,
R.string.component_sheet_bottom_description,
composableName = ""
)

object Sliders : Component(
R.string.component_sliders,
R.drawable.il_sliders,
Expand Down Expand Up @@ -204,18 +220,19 @@ sealed class Variant(
object ButtonsToggle : Variant(R.string.component_buttons_toggle, OdsComponent.OdsIconToggleButton.name)
object ButtonsIcon : Variant(R.string.component_buttons_icon, OdsComponent.OdsIconButton.name)

object CardImageFirst : Variant(R.string.component_card_image_first, OdsComponent.OdsImageFirstCard.name)
object CardTitleFirst : Variant(R.string.component_card_title_first, OdsComponent.OdsTitleFirstCard.name)
object CardVerticalImageFirst : Variant(R.string.component_card_vertical_image_first, OdsComponent.OdsVerticalImageFirstCard.name)
object CardVerticalHeaderFirst : Variant(R.string.component_card_vertical_header_first, OdsComponent.OdsVerticalHeaderFirstCard.name)
object CardSmall : Variant(R.string.component_card_small, OdsComponent.OdsSmallCard.name)
object CardHorizontal : Variant(R.string.component_card_horizontal, OdsComponent.OdsHorizontalCard.name)

object Chip : Variant(R.string.component_chip, OdsComponent.OdsChip.name)
object ChipFilter : Variant(R.string.component_chip_type_filter, OdsComponent.OdsFilterChip.name)

object DropdownMenu : Variant(R.string.component_menu_dropdown, OdsComponent.OdsDropdownMenu.name)
object ExposedDropdownMenu : Variant(R.string.component_menu_exposed_dropdown, OdsComponent.OdsExposedDropdownMenu.name)

object ProgressBar : Variant(R.string.component_progress_bar, OdsComponent.OdsLinearProgressIndicator.name)
object ProgressActivityIndicator : Variant(R.string.component_progress_activity_indicator, OdsComponent.OdsCircularProgressIndicator.name)
object ProgressLinear : Variant(R.string.component_progress_linear, OdsComponent.OdsLinearProgressIndicator.name)
object ProgressCircular : Variant(R.string.component_progress_circular, OdsComponent.OdsCircularProgressIndicator.name)

object TextField : Variant(R.string.component_text_field_text, OdsComponent.OdsTextField.name)
object TextFieldPassword : Variant(R.string.component_text_field_password, OdsComponent.OdsPasswordTextField.name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ package com.orange.ods.demo.ui.components
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import com.orange.ods.demo.ui.LocalMainTopAppBarManager
import com.orange.ods.demo.ui.components.banners.ComponentBanners
import com.orange.ods.demo.ui.components.bottomnavigation.ComponentBottomNavigation
import com.orange.ods.demo.ui.components.checkboxes.ComponentCheckboxes
import com.orange.ods.demo.ui.components.dialogs.ComponentDialog
import com.orange.ods.demo.ui.components.floatingactionbuttons.ComponentFloatingActionButton
import com.orange.ods.demo.ui.components.lists.ComponentLists
import com.orange.ods.demo.ui.components.radiobuttons.ComponentRadioButtons
import com.orange.ods.demo.ui.components.sheets.ComponentSheetsBottom
import com.orange.ods.demo.ui.components.sliders.ComponentSliders
import com.orange.ods.demo.ui.components.snackbars.ComponentSnackbars
import com.orange.ods.demo.ui.components.switches.ComponentSwitches
Expand All @@ -30,12 +32,14 @@ fun ComponentDemoScreen(componentId: Long) {
component?.let {
LocalMainTopAppBarManager.current.updateTopAppBarTitle(component.titleRes)
when (component) {
Component.Banners -> ComponentBanners()
Component.BottomNavigation -> ComponentBottomNavigation()
Component.Checkboxes -> ComponentCheckboxes()
Component.Dialogs -> ComponentDialog()
Component.FloatingActionButtons -> ComponentFloatingActionButton()
Component.Lists -> ComponentLists()
Component.RadioButtons -> ComponentRadioButtons()
Component.SheetsBottom -> ComponentSheetsBottom()
Component.Sliders -> ComponentSliders()
Component.Snackbars -> ComponentSnackbars()
Component.Switches -> ComponentSwitches()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
*
* Copyright 2021 Orange
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* /
*/

package com.orange.ods.demo.ui.components.banners

import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable

@Composable
fun rememberBannerCustomizationState(
buttonsCount: MutableState<Int> = rememberSaveable { mutableStateOf(BannerCustomizationState.MinActionButtonCount) },
textLinesCount: MutableState<Int> = rememberSaveable { mutableStateOf(BannerCustomizationState.MaxTextCount) },
iconChecked: MutableState<Boolean> = rememberSaveable { mutableStateOf(false) }
) =
remember(buttonsCount, textLinesCount, iconChecked) {
BannerCustomizationState(buttonsCount, textLinesCount, iconChecked)
}

class BannerCustomizationState(
val buttonsCount: MutableState<Int>,
val textLinesCount: MutableState<Int>,
val iconChecked: MutableState<Boolean>,
) {

companion object {
const val MinActionButtonCount = 1
const val MaxActionButtonCount = 2
const val MinTextCount = 1
const val MaxTextCount = 2
}

val hasIcon
get() = iconChecked.value

val hasButton2
get() = buttonsCount.value > 1

val hasTwoTextLines
get() = textLinesCount.value > 1
}
Loading

0 comments on commit e039118

Please sign in to comment.