Loading packages/SystemUI/compose/features/src/com/android/systemui/ambientcue/ui/compose/NavBarPill.kt +40 −19 Original line number Diff line number Diff line Loading @@ -128,12 +128,15 @@ fun NavBarPill( .onGloballyPositioned { expandedSize = it.size }, ) { // Should have at most 1 expanded chip var expandedChip by remember { mutableStateOf(false) } var expandedChip = false actions.fastForEach { action -> if ((actions.size == 1 || action.attribution != null) && !expandedChip) { expandedChip = true Row( horizontalArrangement = Arrangement.spacedBy(4.dp, Alignment.CenterHorizontally), verticalAlignment = Alignment.CenterVertically, modifier = Modifier.weight(1f), ) { Image( painter = rememberDrawablePainter(action.icon), Loading @@ -146,8 +149,7 @@ fun NavBarPill( contentDescription = action.label, modifier = Modifier.size(16.dp).clip(CircleShape), ) if ((actions.size == 1 || action.attribution != null) && !expandedChip) { expandedChip = true Text( text = action.label, style = MaterialTheme.typography.labelSmall, Loading @@ -170,6 +172,25 @@ fun NavBarPill( ) } } } else { // collapsed chip Row( horizontalArrangement = Arrangement.spacedBy(4.dp, Alignment.CenterHorizontally), verticalAlignment = Alignment.CenterVertically, ) { Image( painter = rememberDrawablePainter(action.icon), colorFilter = if (action.attribution != null) { ColorFilter.tint(outlineColor) } else { null }, contentDescription = action.label, modifier = Modifier.size(16.dp).clip(CircleShape), ) } } } } Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/ambientcue/ui/compose/NavBarPill.kt +40 −19 Original line number Diff line number Diff line Loading @@ -128,12 +128,15 @@ fun NavBarPill( .onGloballyPositioned { expandedSize = it.size }, ) { // Should have at most 1 expanded chip var expandedChip by remember { mutableStateOf(false) } var expandedChip = false actions.fastForEach { action -> if ((actions.size == 1 || action.attribution != null) && !expandedChip) { expandedChip = true Row( horizontalArrangement = Arrangement.spacedBy(4.dp, Alignment.CenterHorizontally), verticalAlignment = Alignment.CenterVertically, modifier = Modifier.weight(1f), ) { Image( painter = rememberDrawablePainter(action.icon), Loading @@ -146,8 +149,7 @@ fun NavBarPill( contentDescription = action.label, modifier = Modifier.size(16.dp).clip(CircleShape), ) if ((actions.size == 1 || action.attribution != null) && !expandedChip) { expandedChip = true Text( text = action.label, style = MaterialTheme.typography.labelSmall, Loading @@ -170,6 +172,25 @@ fun NavBarPill( ) } } } else { // collapsed chip Row( horizontalArrangement = Arrangement.spacedBy(4.dp, Alignment.CenterHorizontally), verticalAlignment = Alignment.CenterVertically, ) { Image( painter = rememberDrawablePainter(action.icon), colorFilter = if (action.attribution != null) { ColorFilter.tint(outlineColor) } else { null }, contentDescription = action.label, modifier = Modifier.size(16.dp).clip(CircleShape), ) } } } } Loading