question
I am using the android material3 library and want to change the color transparency of the indicator, but the source code uses color transparency by default to control the display or hide, how should I control the display and hide of the indicator?
Navigation bar source code
val animationProgress: Float by animateFloatAsState(
targetValue = if (selected) 1f else 0f,
animationSpec = tween(ItemAnimationDurationMillis)
)
val indicator = @Composable {
Box(
Modifier.layoutId(IndicatorLayoutIdTag)
.background(
color = colors.indicatorColor.copy(alpha = animationProgress),
shape = NavigationBarTokens.ActiveIndicatorShape.toShape(),
)
)
}
The indicator refers to the position of marker 4 on this picture: