diff --git a/app/src/main/java/com/droiddeck/launcher/ui/LiftSheet.kt b/app/src/main/java/com/droiddeck/launcher/ui/LiftSheet.kt index d0734754b..60667ee92 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/LiftSheet.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/LiftSheet.kt @@ -741,7 +741,8 @@ internal fun SheetChips(labels: List, selected: Int, focus: List= 96.dp val scroll = rememberScrollState() - Box(if (equal) Modifier.fillMaxWidth() else Modifier.edgeFade(scroll).horizontalScroll(scroll)) { + // Room inside the scroll for the focus ring, which the scroll's clip would otherwise cut. + Box(if (equal) Modifier.fillMaxWidth() else Modifier.edgeFade(scroll).horizontalScroll(scroll).padding(3.dp)) { ChipGlide(selected, bounds[selected], tint) Row(horizontalArrangement = Arrangement.spacedBy(6.dp), modifier = if (equal) Modifier.fillMaxWidth() else Modifier) { labels.forEachIndexed { i, label -> diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SharedMotion.kt b/app/src/main/java/com/droiddeck/launcher/ui/SharedMotion.kt index 221d383fb..4d01f20da 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SharedMotion.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SharedMotion.kt @@ -107,7 +107,15 @@ internal fun BoxScope.ChipGlide( val r = CornerRadius(corner?.let { lerp(minOf(with(density) { it.toPx() }, round), round, p) } ?: round) // A drop in flight is solid; on a chip it is the chip's tinted fill and outline. drawRoundRect(tint.value.copy(alpha = lerp(fill, 0.9f, p)), at0, size, r) - if (outline > 0f) drawRoundRect(tint.value.copy(alpha = outline * (1f - p)), at0, size, r, style = Stroke(with(density) { 1.dp.toPx() })) + if (outline > 0f) { + // Inside the chip's edge: a stroke on it would lose its outer half to a scrolling row's clip. + val w = with(density) { 1.dp.toPx() } + val inset = w / 2f + drawRoundRect( + tint.value.copy(alpha = outline * (1f - p)), at0 + Offset(inset, inset), Size(size.width - w, size.height - w), + CornerRadius((r.x - inset).coerceAtLeast(0f)), style = Stroke(w), + ) + } } }