Roberto Fernandez Montero
02/19/2025, 3:13 PMChrimaeon
02/19/2025, 3:16 PMcompose focus
is https://developer.android.com/develop/ui/compose/touch-input/focusChrimaeon
02/19/2025, 3:17 PMRoberto Fernandez Montero
02/19/2025, 3:19 PMChrimaeon
02/19/2025, 3:20 PMRoberto Fernandez Montero
02/19/2025, 3:37 PMprivate fun ButtonRowBody(
isHovered: Boolean,
isFocused: Boolean,
interactionSource: MutableInteractionSource,
text: String,
showMicIcon: Boolean,
enabled: Boolean,
modifier: Modifier = Modifier,
onClick: () -> Unit,
) {
Box(modifier) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.padding(start = 8.dp)
.height(80.dp)
.fillMaxWidth()
.clip(RoundedCornerShape(8.dp))
.conditional(showMicIcon && (isHovered || isFocused), {
graphicsLayer { compositingStrategy = CompositingStrategy.Offscreen }
.background(color = White.copy(alpha = .12f))
.drawWithContent {
drawContent()
drawCircle(
color = White,
center = Offset(x = 0f, y = size.height / 2),
radius = 36f,
blendMode = BlendMode.DstOut
)
}
})
.conditional(!showMicIcon && (isHovered || isFocused), {
background(White.copy(alpha = 0.12f), RoundedCornerShape(8.dp))
})
.conditional(enabled.not(), {
background(White.copy(alpha = 0.40f), RoundedCornerShape(8.dp))
})
.clickable(
onClick = onClick,
indication = null,
interactionSource = interactionSource
)
) {
Spacer(modifier = Modifier.width(24.dp))
Text(
modifier = Modifier.align(Alignment.CenterVertically),
textAlign = TextAlign.Start,
text = text,
color = White,
style = TextStyle(
fontFamily = FontFamily(Font(R.font.circular_font_family)),
fontWeight = FontWeight(450),
fontSize = 24.sp,
lineHeight = 26.sp
)
)
}
if (showMicIcon)
MicIcon(
modifier = Modifier.align(Alignment.CenterStart)
)
}
}
Alex Styl
02/20/2025, 9:06 AMAlex Styl
02/20/2025, 9:08 AMRoberto Fernandez Montero
02/20/2025, 9:41 AM