Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.15.1 #646

Merged
merged 27 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5f1b1c7
[#597] Update OdsHorizontalCard, OdsSmallCard, OdsVerticalHeaderFirst…
florentmaitre Sep 7, 2023
3d1b2b2
[#597] Fix build errors after rebase
florentmaitre Sep 20, 2023
10fb233
[#597] OdsComponentIcon and OdsComponentImage generic constructors ar…
florentmaitre Sep 20, 2023
329ee24
[#597] Review: Circle size of OdsComponentCircleImage is now hardcoded
florentmaitre Sep 20, 2023
361ef97
[#597] Review: Fix a padding bug in cards
florentmaitre Sep 20, 2023
0e8cb9d
Merge pull request #600 from Orange-OpenSource/597-update-odscard-api
paulinea Sep 21, 2023
2328150
[#624] Add new convenience methods for code implementation
florentmaitre Sep 8, 2023
e30c1a3
[#624] Update code implementation after rebase
florentmaitre Sep 20, 2023
2ef4256
[#624] Minor fixes
florentmaitre Sep 20, 2023
e2b5fd4
Merge pull request #626 from Orange-OpenSource/624-technical-enhance-…
paulinea Sep 21, 2023
4533acb
Update release process
paulinea Sep 13, 2023
be9e458
Add last OMA click to publish in the process
paulinea Sep 15, 2023
16991d8
Review: Update RELEASE.md
paulinea Sep 21, 2023
1ccc1a8
Merge pull request #633 from Orange-OpenSource/update-release-process
florentmaitre Sep 21, 2023
3817fe6
[#617] Fix a bug where OdsDropdownMenu was not dismissed on user click
florentmaitre Sep 21, 2023
bcff3df
[#617] Fix disabled color of text and icon in OdsDropdownMenu
florentmaitre Sep 21, 2023
b7941d2
Merge pull request #639 from Orange-OpenSource/617-update-the-drop-do…
paulinea Sep 22, 2023
7d4e3d9
[#634] Fix background color of components in dark mode
florentmaitre Sep 22, 2023
cc23e4a
Merge pull request #640 from Orange-OpenSource/634-bug-exposed-dropdo…
paulinea Sep 22, 2023
ee9b626
[#635] Fix a bug where the modifier was not taken into account in Ods…
florentmaitre Sep 21, 2023
94ae6a4
Merge pull request #637 from Orange-OpenSource/635-bug-odstextfield-p…
paulinea Sep 22, 2023
273340b
[#623] Remove Kotlin reflect dependency
florentmaitre Sep 25, 2023
b695f1c
[#623] Use FlowRow from Androidx and remove Accompanist Flow Layout d…
florentmaitre Sep 27, 2023
a024d98
[#623] Review: Update changelog
florentmaitre Sep 27, 2023
a98f1b3
Merge pull request #644 from Orange-OpenSource/623-reduce-library-size
paulinea Sep 28, 2023
b52b0dc
Prepare 0.15.1 release
paulinea Sep 28, 2023
87c6d06
Merge pull request #645 from Orange-OpenSource/prepare-release
florentmaitre Sep 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.0'
implementation 'com.orange.ods.android:ods-lib:0.15.1'
}
```

Expand Down
3 changes: 1 addition & 2 deletions 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() ?: 6
versionCode = versionCodeProperty?.toInt() ?: 7
versionName = version.toString()
val versionNameSuffixProperty = project.findTypedProperty<String>("versionNameSuffix")
versionNameSuffix = versionNameSuffixProperty
Expand Down Expand Up @@ -128,7 +128,6 @@ dependencies {
implementation(project(":lib-xml"))
implementation(project(":theme-innovation-cup"))

implementation(Dependencies.accompanistFlowLayout)
implementation(Dependencies.accompanistSystemUiController)
implementation(Dependencies.activityCompose)
implementation(Dependencies.appCompat)
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/orange/ods/app/ui/MainScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ fun MainScreen(themeConfigurations: Set<OdsThemeConfigurationContract>, mainView

Scaffold(
modifier = modifier,
backgroundColor = OdsTheme.colors.background,
topBar = {
Surface(elevation = if (isSystemInDarkTheme()) 0.dp else AppBarDefaults.TopAppBarElevation) {
Column {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import androidx.compose.ui.res.stringResource
import com.orange.ods.app.R
import com.orange.ods.app.ui.LocalMainTopAppBarManager
import com.orange.ods.app.ui.utilities.DrawableManager
import com.orange.ods.compose.component.card.OdsCardImage
import com.orange.ods.compose.component.card.OdsSmallCard
import com.orange.ods.extension.orElse

Expand Down Expand Up @@ -67,12 +68,13 @@ private fun RowScope.ComponentCard(component: Component, onComponentClick: (Long
OdsSmallCard(
modifier = Modifier.weight(0.5f),
title = stringResource(id = component.titleRes),
image = painterResource(id = smallImageResId.orElse { imageResId }),
imageBackgroundColor = Color(Component.ImageBackgroundColor),
imageContentScale = ContentScale.Fit,
imageAlignment = component.imageAlignment,
onCardClick = {
onComponentClick(component.id)
},
image = OdsCardImage(
painterResource(id = smallImageResId.orElse { imageResId }),
"",
component.imageAlignment,
ContentScale.Fit,
Color(Component.ImageBackgroundColor)
),
onClick = { onComponentClick(component.id) },
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ fun ComponentTopAppBar(variant: Variant) {
title(context.getString(R.string.component_app_bars_top_regular))

if (isNavigationIconEnabled) {
classInstance("navigationIcon", OdsTopAppBarNavigationIcon::class.java) {
simple("imageVector", "<image vector>")
classInstance<OdsTopAppBarNavigationIcon>("navigationIcon") {
imageVector()
contentDescription(context.getString(R.string.top_app_bar_back_icon_desc))
}
}

list("actions") {
repeat(actionCount.value) {
classInstance(OdsTopAppBarActionButton::class.java) {
classInstance<OdsTopAppBarActionButton> {
onClick()
painter()
contentDescription("icon description")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,18 @@ fun ComponentBanners() {
exhaustiveParameters = false,
parameters = {
string("message", if (hasTwoTextLines) recipe.description else recipe.title)
classInstance("firstButton", OdsBannerButton::class.java) {
classInstance<OdsBannerButton>("firstButton") {
text(context.getString(R.string.component_banner_dismiss))
onClick()
}
if (hasImage) {
classInstance("image", OdsBannerImage::class.java) {
classInstance<OdsBannerImage>("image") {
painter()
contentDescription("")
}
}
if (hasSecondButton) {
classInstance("secondButton", OdsBannerButton::class.java) {
classInstance<OdsBannerButton>("secondButton") {
text(context.getString(R.string.component_banner_detail))
onClick()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ fun ComponentBottomNavigation() {
parameters = {
list("items") {
navigationItems.take(selectedNavigationItemCount.value).forEach { item ->
classInstance(OdsBottomNavigationItem::class.java) {
classInstance("icon", OdsBottomNavigationItemIcon::class.java) {
classInstance<OdsBottomNavigationItem> {
classInstance<OdsBottomNavigationItemIcon>("icon") {
painter()
contentDescription("")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import com.orange.ods.compose.component.button.OdsButton
import com.orange.ods.compose.component.button.OdsButtonIcon
import com.orange.ods.compose.component.button.OdsButtonStyle
import com.orange.ods.compose.theme.OdsDisplaySurface
import com.orange.ods.extension.fullName

@Composable
fun ButtonsContained(customizationState: ButtonCustomizationState) {
Expand Down Expand Up @@ -84,10 +83,10 @@ fun ButtonsContained(customizationState: ButtonCustomizationState) {
name = OdsComposable.OdsButton.name,
exhaustiveParameters = false,
parameters = {
simple("style", buttonStyle.value.fullName)
enum("style", buttonStyle.value)
if (hasFullScreenWidth) fillMaxWidth()
if (hasLeadingIcon) {
classInstance("icon", OdsButtonIcon::class.java) {
classInstance<OdsButtonIcon>("icon") {
painter()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fun ButtonsOutlined(customizationState: ButtonCustomizationState) {
parameters = {
if (hasFullScreenWidth) fillMaxWidth()
if (hasLeadingIcon) {
classInstance("icon", OdsButtonIcon::class.java) {
classInstance<OdsButtonIcon>("icon") {
painter()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import com.orange.ods.compose.component.button.OdsButtonIcon
import com.orange.ods.compose.component.button.OdsTextButton
import com.orange.ods.compose.component.button.OdsTextButtonStyle
import com.orange.ods.compose.theme.OdsDisplaySurface
import com.orange.ods.extension.fullName

@Composable
fun ButtonsText(customizationState: ButtonCustomizationState) {
Expand Down Expand Up @@ -79,10 +78,10 @@ fun ButtonsText(customizationState: ButtonCustomizationState) {
name = OdsComposable.OdsTextButton.name,
exhaustiveParameters = false,
parameters = {
simple("style", textButtonStyle.value.fullName)
enum("style", textButtonStyle.value)
if (hasFullScreenWidth) fillMaxWidth()
if (hasLeadingIcon) {
classInstance("icon", OdsButtonIcon::class.java) {
classInstance<OdsButtonIcon>("icon") {
painter()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fun ButtonsTextToggleButtonsRow(customizationState: ButtonCustomizationState) {
parameters = {
list("textToggleButtons") {
textToggleButtons.take(toggleCount.value).forEach { item ->
classInstance(OdsTextToggleButtonsRowItem::class.java) {
classInstance<OdsTextToggleButtonsRowItem> {
text(item.text)
enabled(customizationState.isEnabled)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fun ButtonsIcon(customizationState: ButtonIconCustomizationState) {
name = OdsComposable.OdsIconButton.name,
exhaustiveParameters = false,
parameters = {
classInstance("icon", OdsIconButtonIcon::class.java) {
classInstance<OdsIconButtonIcon>("icon") {
painter()
contentDescription("")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ fun ButtonsIconToggle(customizationState: ButtonIconCustomizationState) {
name = OdsComposable.OdsIconToggleButton.name,
exhaustiveParameters = false,
parameters = {
classInstance("uncheckedIcon", OdsIconButtonIcon::class.java) {
classInstance<OdsIconButtonIcon>("uncheckedIcon") {
painter()
contentDescription("")
}
classInstance("checkedIcon", OdsIconButtonIcon::class.java) {
classInstance<OdsIconButtonIcon>("checkedIcon") {
painter()
contentDescription("")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fun ButtonsIconToggleGroup(customizationState: ButtonIconCustomizationState) {
parameters = {
list("icons") {
repeat(toggleCount.value) {
classInstance(OdsIconToggleButtonsRowIcon::class.java) {
classInstance<OdsIconToggleButtonsRowIcon> {
painter()
contentDescription("")
if (!isEnabled) enabled(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,27 @@ fun rememberCardCustomizationState(
thumbnailChecked: MutableState<Boolean> = rememberSaveable { mutableStateOf(true) },
textChecked: MutableState<Boolean> = rememberSaveable { mutableStateOf(true) },
subtitleChecked: MutableState<Boolean> = rememberSaveable { mutableStateOf(true) },
actionButtonCount: MutableState<Int> = rememberSaveable { mutableStateOf(CardCustomizationState.MinActionButtonCount) },
buttonCount: MutableState<Int> = rememberSaveable { mutableStateOf(CardCustomizationState.MinButtonCount) },
dividerChecked: MutableState<Boolean> = rememberSaveable { mutableStateOf(true) },
imagePosition: MutableState<OdsHorizontalCardImagePosition> = rememberSaveable { mutableStateOf(OdsHorizontalCardImagePosition.Start) }
) =
remember(clickable, thumbnailChecked, textChecked, subtitleChecked, actionButtonCount, dividerChecked, imagePosition) {
CardCustomizationState(clickable, thumbnailChecked, textChecked, subtitleChecked, actionButtonCount, dividerChecked, imagePosition)
remember(clickable, thumbnailChecked, textChecked, subtitleChecked, buttonCount, dividerChecked, imagePosition) {
CardCustomizationState(clickable, thumbnailChecked, textChecked, subtitleChecked, buttonCount, dividerChecked, imagePosition)
}

class CardCustomizationState(
val clickable: MutableState<Boolean>,
val thumbnailChecked: MutableState<Boolean>,
val textChecked: MutableState<Boolean>,
val subtitleChecked: MutableState<Boolean>,
val actionButtonCount: MutableState<Int>,
val buttonCount: MutableState<Int>,
val dividerChecked: MutableState<Boolean>,
val imagePosition: MutableState<OdsHorizontalCardImagePosition>
) {

companion object {
const val MinActionButtonCount = 0
const val MaxActionButtonCount = 2
const val MinButtonCount = 0
const val MaxButtonCount = 2
}

val isClickable
Expand All @@ -58,12 +58,12 @@ class CardCustomizationState(
val hasSubtitle
get() = subtitleChecked.value

val hasButton1
get() = actionButtonCount.value > 0
val hasFirstButton
get() = buttonCount.value > 0

val hasButton2
get() = actionButtonCount.value > 1
val hasSecondButton
get() = buttonCount.value > 1

val hasDivider
get() = if (!hasButton1) false else dividerChecked.value
get() = if (!hasFirstButton) false else dividerChecked.value
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
package com.orange.ods.app.ui.components.cards

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
Expand All @@ -31,67 +30,78 @@ import com.orange.ods.app.ui.utilities.DrawableManager
import com.orange.ods.app.ui.utilities.composable.CodeImplementationColumn
import com.orange.ods.app.ui.utilities.composable.FunctionCallCode
import com.orange.ods.compose.OdsComposable
import com.orange.ods.compose.component.card.OdsCardButton
import com.orange.ods.compose.component.card.OdsCardImage
import com.orange.ods.compose.component.card.OdsHorizontalCard

@Composable
fun CardHorizontal(customizationState: CardCustomizationState) {
val context = LocalContext.current
val recipes = LocalRecipes.current
val recipe = rememberSaveable { recipes.filter { it.description.isNotBlank() }.random() }

with(customizationState) {
Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(state = rememberScrollState())
.padding(dimensionResource(id = com.orange.ods.R.dimen.spacing_m))
.verticalScroll(state = rememberScrollState()),
) {
val button1Text = stringResource(id = R.string.component_element_first_button)
val button2Text = stringResource(id = R.string.component_element_second_button)
val firstButtonText = stringResource(id = R.string.component_element_first_button)
val secondButtonText = stringResource(id = R.string.component_element_second_button)
val cardText = stringResource(id = R.string.component_card_element_card)

OdsHorizontalCard(
title = recipe.title,
image = rememberAsyncImagePainter(
model = recipe.imageUrl,
placeholder = painterResource(id = DrawableManager.getPlaceholderResId()),
error = painterResource(id = DrawableManager.getPlaceholderResId(error = true))
image = OdsCardImage(
rememberAsyncImagePainter(
model = recipe.imageUrl,
placeholder = painterResource(id = DrawableManager.getPlaceholderResId()),
error = painterResource(id = DrawableManager.getPlaceholderResId(error = true))
),
""
),
subtitle = if (hasSubtitle) recipe.subtitle else null,
text = if (hasText) recipe.description else null,
onCardClick = if (isClickable) {
onClick = if (isClickable) {
{ clickOnElement(context, cardText) }
} else null,
button1Text = if (hasButton1) button1Text else null,
onButton1Click = { clickOnElement(context, button1Text) },
button2Text = if (hasButton2) button2Text else null,
onButton2Click = { clickOnElement(context, button2Text) },
firstButton = if (hasFirstButton) OdsCardButton(firstButtonText) { clickOnElement(context, firstButtonText) } else null,
secondButton = if (hasSecondButton) OdsCardButton(secondButtonText) { clickOnElement(context, secondButtonText) } else null,
imagePosition = imagePosition.value,
dividerEnabled = hasDivider
divider = hasDivider
)

Spacer(modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s)))

CodeImplementationColumn {
CodeImplementationColumn(
modifier = Modifier.padding(top = dimensionResource(com.orange.ods.R.dimen.spacing_s))
) {
FunctionCallCode(
name = OdsComposable.OdsHorizontalCard.name,
exhaustiveParameters = false,
parameters = {
simple("imagePosition", imagePosition.value.name)
enum("imagePosition", imagePosition.value)
title(recipe.title)
image()
classInstance("image", OdsCardImage::class.java) {
painter()
contentDescription("")
}
if (hasSubtitle) subtitle(recipe.subtitle)
if (hasText) cardText()
if (isClickable) onCardClick()
if (hasButton1) {
button1Text(button1Text)
onButton1Click()
if (isClickable) onClick()
if (hasFirstButton) {
classInstance("firstButton", OdsCardButton::class.java) {
text(firstButtonText)
onClick()
}
}
if (hasButton2) {
button2Text(button2Text)
onButton2Click()
if (hasSecondButton) {
classInstance("secondButton", OdsCardButton::class.java) {
text(secondButtonText)
onClick()
}
}
if (!hasDivider && (hasButton1 || hasButton2)) stringRepresentation("dividerEnabled", hasDivider)
simple("imagePosition", imagePosition.value.name)
if (!hasDivider && (hasFirstButton || hasSecondButton)) stringRepresentation("divider", hasDivider)
}
)
}
Expand Down
Loading