Skip to content

Commit c9385c1

Browse files
committed
Fix after rebase
1 parent b449f85 commit c9385c1

File tree

5 files changed

+25
-46
lines changed

5 files changed

+25
-46
lines changed

app/src/main/java/com/orange/ouds/app/ui/MainScreen.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ fun MainScreen(
116116
},
117117
bottomBar = {
118118
BottomBar(
119-
modifier = Modifier.hazeEffect(state = hazeState, style = HazeStyle(tint = null, blurRadius = OudsTheme.effects.blurNavigationBar.dp)),
119+
modifier = Modifier.hazeEffect(
120+
state = hazeState,
121+
style = HazeStyle(tint = null, blurRadius = OudsTheme.navigationBarBlur.dp)
122+
),
120123
currentRoute = mainState.navigationState.currentRoute.orEmpty(),
121124
navigateToRoute = { route ->
122125
mainState.navigationState.navigateToBottomBarRoute(route)

core/src/main/java/com/orange/ouds/core/component/OudsNavigationBar.kt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ val OudsNavigationBarHeight = 80.dp
9999
* 1. Add Haze dependency
100100
* 2. Follow Haze basic usage instructions:
101101
* - Define Haze state in the screen containing the navigation bar: `val hazeState = rememberHazeState()`
102-
* - Use `hazeEffect` Modifier on OudsNavigationBar providing OUDS blur radius: `Modifier.hazeEffect(state = hazeState, style = HazeStyle(tint = null, blurRadius = OudsTheme.effects.blurNavigationBar.dp)),`
102+
* - Use `hazeEffect` Modifier on OudsNavigationBar providing OUDS blur radius: `Modifier.hazeEffect(state = hazeState, style = HazeStyle(tint = null, blurRadius = OudsTheme.navigationBarBlur.dp)),`
103103
* - Apply `hazeSource` Modifier on the content that scrolls behind the navigation bar: `Modifier.hazeSource(state = hazeState)`
104104
* 3. As your screen content needs to scroll behind the navigation bar, you'll probably need to adjust paddings and to add a spacer at the end of the screen
105105
* content that will have the height of OudsNavigationBar. For this, please use `OudsNavigationBarHeight` constant.
@@ -118,8 +118,8 @@ fun OudsNavigationBar(
118118
windowInsets: WindowInsets = NavigationBarDefaults.windowInsets,
119119
content: @Composable RowScope.() -> Unit
120120
) {
121+
val topBorderColor = OudsTheme.colorScheme.border.minimal
121122
with(OudsTheme.componentsTokens.bar) {
122-
val topBorderColor = colorBorder.value
123123
NavigationBar(
124124
modifier = modifier
125125
.focusProperties { canFocus = false }
@@ -196,20 +196,20 @@ fun RowScope.OudsNavigationBarItem(
196196

197197
// Top active indicator: visual alternative for selected item (a11y)
198198
val topIndicatorColor = topIndicatorColor(state = state)
199-
val topIndicatorOpacityColor = topIndicatorColor.copy(alpha = topIndicatorColor.alpha * opacityTopActiveIndicator.value)
199+
val topIndicatorOpacityColor = topIndicatorColor.copy(alpha = topIndicatorColor.alpha * opacityActiveIndicatorCustom.value)
200200
val topIndicatorShape = RoundedCornerShape(
201201
topStart = 0.dp,
202202
topEnd = 0.dp,
203-
bottomStart = borderRadiusTopActiveIndicator.value,
204-
bottomEnd = borderRadiusTopActiveIndicator.value
203+
bottomStart = borderRadiusActiveIndicatorCustomTop.value,
204+
bottomEnd = borderRadiusActiveIndicatorCustomTop.value
205205
)
206206
this@OudsNavigationBarItem.AnimatedVisibility(
207207
modifier = Modifier.constrainAs(topIndicatorRef) {
208208
top.linkTo(parent.top)
209209
start.linkTo(parent.start)
210210
end.linkTo(parent.end)
211-
height = Dimension.value(sizeHeightTopActiveIndicator.dp)
212-
width = Dimension.value(sizeWidthTopActiveIndicator.dp)
211+
height = Dimension.value(sizeHeightActiveIndicatorCustom.dp)
212+
width = Dimension.value(sizeWidthActiveIndicatorCustomTop.dp)
213213
},
214214
visible = selected || state == OudsNavigationBarItemState.Hovered,
215215
enter = fadeIn() + slideInVertically { -it * 2 },
@@ -298,11 +298,11 @@ private fun contentColor(state: OudsNavigationBarItemState, selected: Boolean):
298298
private fun materialIndicatorColor(state: OudsNavigationBarItemState, selected: Boolean): Color {
299299
return with(OudsTheme.componentsTokens.bar) {
300300
when (state) {
301-
OudsNavigationBarItemState.Enabled -> if (selected) colorMaterialActiveIndicatorSelectedEnabled.value else OudsTheme.colorScheme.opacity.transparent
302-
OudsNavigationBarItemState.Hovered -> if (selected) colorMaterialActiveIndicatorSelectedHover.value else colorMaterialActiveIndicatorUnselectedHover.value
303-
OudsNavigationBarItemState.Pressed -> if (selected) colorMaterialActiveIndicatorSelectedPressed.value else colorMaterialActiveIndicatorUnselectedPressed.value
301+
OudsNavigationBarItemState.Enabled -> if (selected) colorActiveIndicatorAndroidSelectedEnabled.value else OudsTheme.colorScheme.opacity.transparent
302+
OudsNavigationBarItemState.Hovered -> if (selected) colorActiveIndicatorAndroidSelectedHover.value else colorActiveIndicatorAndroidUnselectedHover.value
303+
OudsNavigationBarItemState.Pressed -> if (selected) colorActiveIndicatorAndroidSelectedPressed.value else colorActiveIndicatorAndroidUnselectedPressed.value
304304
OudsNavigationBarItemState.Disabled -> OudsTheme.colorScheme.opacity.transparent
305-
OudsNavigationBarItemState.Focused -> if (selected) colorMaterialActiveIndicatorSelectedFocus.value else colorMaterialActiveIndicatorUnselectedFocus.value
305+
OudsNavigationBarItemState.Focused -> if (selected) colorActiveIndicatorAndroidSelectedFocus.value else colorActiveIndicatorAndroidUnselectedFocus.value
306306
}
307307
}
308308
}
@@ -311,11 +311,11 @@ private fun materialIndicatorColor(state: OudsNavigationBarItemState, selected:
311311
private fun topIndicatorColor(state: OudsNavigationBarItemState): Color {
312312
return with(OudsTheme.componentsTokens.bar) {
313313
when (state) {
314-
OudsNavigationBarItemState.Enabled -> colorTopActiveIndicatorSelectedEnabled.value
315-
OudsNavigationBarItemState.Hovered -> colorTopActiveIndicatorSelectedHover.value
316-
OudsNavigationBarItemState.Pressed -> colorTopActiveIndicatorSelectedPressed.value
314+
OudsNavigationBarItemState.Enabled -> colorActiveIndicatorCustomSelectedEnabled.value
315+
OudsNavigationBarItemState.Hovered -> colorActiveIndicatorCustomSelectedHover.value
316+
OudsNavigationBarItemState.Pressed -> colorActiveIndicatorCustomSelectedPressed.value
317317
OudsNavigationBarItemState.Disabled -> OudsTheme.colorScheme.opacity.transparent
318-
OudsNavigationBarItemState.Focused -> colorTopActiveIndicatorSelectedFocus.value
318+
OudsNavigationBarItemState.Focused -> colorActiveIndicatorCustomSelectedFocus.value
319319
}
320320
}
321321
}

core/src/main/java/com/orange/ouds/core/theme/OudsEffects.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,17 @@ import com.orange.ouds.theme.tokens.semantic.OudsEffectSemanticTokens
2323
* @suppress
2424
*/
2525
data class OudsEffects(
26-
val blurDrag: Int,
27-
val blurNavigationBar: Int
26+
val blurDrag: Int
2827
)
2928

3029
internal fun OudsEffectSemanticTokens.getEffect() = OudsEffects(
3130
blurDrag = blurDrag,
32-
blurNavigationBar = blurNavigationBar
3331
)
3432

3533
@Stable
3634
private fun OudsEffects.fromToken(token: OudsEffectKeyToken): Int {
3735
return when (token) {
3836
OudsEffectKeyToken.Blur.Drag -> blurDrag
39-
OudsEffectKeyToken.Blur.NavigationBar -> blurNavigationBar
4037
}
4138
}
4239

core/src/main/java/com/orange/ouds/core/theme/OudsTheme.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ object OudsTheme {
109109
@ReadOnlyComposable
110110
get() = LocalSpaces.current
111111

112+
val navigationBarBlur
113+
@Composable
114+
@ReadOnlyComposable
115+
get() = LocalComponentsTokens.current.bar.effectBgBlur
116+
112117
internal val componentsTokens: OudsComponentsTokens
113118
@Composable
114119
@ReadOnlyComposable

theme-contract/src/main/java/com/orange/ouds/theme/tokens/OudsEffectKeyTokens.kt

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)