Skip to content

Commit

Permalink
Merge pull request #510 from Orange-OpenSource/504-navigation-drawer-…
Browse files Browse the repository at this point in the history
…design-corrections

504 - Navigation drawer - Display a recipe picture as avatar
  • Loading branch information
paulinea authored Apr 7, 2023
2 parents b15a4c8 + 7ca61e0 commit b50f727
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ fun ComponentModalDrawers() {
error = painterResource(id = R.drawable.placeholder)
)
} else if (customizationState.hasAvatar) {
painterResource(id = R.drawable.placeholder)
rememberAsyncImagePainter(
model = rememberSaveable { recipes.random() }.imageUrl,
placeholder = painterResource(id = R.drawable.placeholder),
error = painterResource(id = R.drawable.placeholder)
)
} else null,
subtitle = if (customizationState.isSubTitleChecked) stringResource(id = R.string.component_element_example) else null,
imageDisplayType = if (customizationState.hasAvatar) OdsModalDrawerHeaderImageDisplayType.Avatar else if (customizationState.hasBackground) OdsModalDrawerHeaderImageDisplayType.Background else OdsModalDrawerHeaderImageDisplayType.None
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ 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).

## [Unreleased](https://github.com/Orange-OpenSource/ods-android/compare/0.12.0...develop)

### Fixed

- \[App\] Fix a bug where avatar have a default image ([#504](https://github.com/Orange-OpenSource/ods-android/issues/504))

## [0.12.0](https://github.com/Orange-OpenSource/ods-android/compare/0.11.1...0.12.0) - 2023-04-06

### Added
Expand Down

0 comments on commit b50f727

Please sign in to comment.