Skip to content

Commit

Permalink
Add grid illustrations
Browse files Browse the repository at this point in the history
  • Loading branch information
paulinea committed Oct 22, 2024
1 parent 18ca9b6 commit 645695a
Show file tree
Hide file tree
Showing 32 changed files with 69 additions and 1 deletion.
30 changes: 30 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,36 @@ app/src/main/res/drawable/ic_spacing.xml
app/src/main/res/drawable/ic_ui_dark_mode.xml
app/src/main/res/drawable/ic_ui_light_mode.xml
app/src/main/res/drawable/il_opacity_union.xml
app/src/main/res/drawable-hdpi/il_tokens_grid_column_margin.png
app/src/main/res/drawable-hdpi/il_tokens_grid_max_width.png
app/src/main/res/drawable-hdpi/il_tokens_grid_min_width.png
app/src/main/res/drawable-mdpi/il_tokens_grid_column_margin.png
app/src/main/res/drawable-mdpi/il_tokens_grid_max_width.png
app/src/main/res/drawable-mdpi/il_tokens_grid_min_width.png
app/src/main/res/drawable-xhdpi/il_tokens_grid_column_margin.png
app/src/main/res/drawable-xhdpi/il_tokens_grid_max_width.png
app/src/main/res/drawable-xhdpi/il_tokens_grid_min_width.png
app/src/main/res/drawable-xxhdpi/il_tokens_grid_column_margin.png
app/src/main/res/drawable-xxhdpi/il_tokens_grid_max_width.png
app/src/main/res/drawable-xxhdpi/il_tokens_grid_min_width.png
app/src/main/res/drawable-xxxhdpi/il_tokens_grid_column_margin.png
app/src/main/res/drawable-xxxhdpi/il_tokens_grid_max_width.png
app/src/main/res/drawable-xxxhdpi/il_tokens_grid_min_width.png
app/src/main/res/drawable-night-hdpi/il_tokens_grid_column_margin.png
app/src/main/res/drawable-night-hdpi/il_tokens_grid_max_width.png
app/src/main/res/drawable-night-hdpi/il_tokens_grid_min_width.png
app/src/main/res/drawable-night-mdpi/il_tokens_grid_column_margin.png
app/src/main/res/drawable-night-mdpi/il_tokens_grid_max_width.png
app/src/main/res/drawable-night-mdpi/il_tokens_grid_min_width.png
app/src/main/res/drawable-night-xhdpi/il_tokens_grid_column_margin.png
app/src/main/res/drawable-night-xhdpi/il_tokens_grid_max_width.png
app/src/main/res/drawable-night-xhdpi/il_tokens_grid_min_width.png
app/src/main/res/drawable-night-xxhdpi/il_tokens_grid_column_margin.png
app/src/main/res/drawable-night-xxhdpi/il_tokens_grid_max_width.png
app/src/main/res/drawable-night-xxhdpi/il_tokens_grid_min_width.png
app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_column_margin.png
app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_max_width.png
app/src/main/res/drawable-night-xxxhdpi/il_tokens_grid_min_width.png

docs/images/favicon-16x16.png
docs/images/orange-logo.svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

package com.orange.ouds.app.ui.tokens

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
Expand All @@ -25,6 +27,7 @@ import androidx.compose.foundation.lazy.items
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.style.TextOverflow
Expand Down Expand Up @@ -52,6 +55,10 @@ fun TokenCategoryDetailScreen(tokenCategory: TokenCategory, onSubcategoryClick:
descriptionRes = tokenCategory.descriptionRes,
imageRes = tokenCategory.imageRes
)

if (tokenCategory == TokenCategory.Grid) {
GridIllustrations()
}
}

if (tokenCategory.subcategories.isNotEmpty()) {
Expand Down Expand Up @@ -169,6 +176,36 @@ private fun TokenIllustration(tokenProperty: TokenProperty, token: Token<Any>) =
is TokenProperty.Typography, TokenProperty.Grid -> Unit
}

@Composable
private fun GridIllustrations() {
Image(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = OudsSpacingFixedKeyToken.Medium.value)
.background(OudsColorKeyToken.OnSurface.value), //TODO use BgEmphasizedPrimary token when available
painter = painterResource(id = R.drawable.il_tokens_grid_column_margin),
contentDescription = null
)
Image(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = OudsSpacingFixedKeyToken.Medium.value)
.padding(top = OudsSpacingFixedKeyToken.Medium.value)
.background(OudsColorKeyToken.OnSurface.value), //TODO use BgEmphasizedPrimary token when available
painter = painterResource(id = R.drawable.il_tokens_grid_min_width),
contentDescription = null
)
Image(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = OudsSpacingFixedKeyToken.Medium.value)
.padding(top = OudsSpacingFixedKeyToken.Medium.value)
.background(OudsColorKeyToken.OnSurface.value), //TODO use BgEmphasizedPrimary token when available
painter = painterResource(id = R.drawable.il_tokens_grid_max_width),
contentDescription = null
)
}

@UiModePreviews.Default
@Composable
private fun PreviewTokenCategoryDetailScreen(
Expand All @@ -182,5 +219,6 @@ private class TokenCategoryDetailScreenPreviewParameterProvider : BasicPreviewPa
private val previewParameterValues: List<TokenCategory>
get() = listOf(
TokenCategory.Opacity,
TokenCategory.Elevation
TokenCategory.Elevation,
TokenCategory.Grid
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 645695a

Please sign in to comment.