Hier ist das Fehlerprotokoll, das ich erhalte:
Code: Select all
FATAL EXCEPTION: main
Process: br.com.apima.comandaappdroid, PID: 18541
java.lang.IllegalStateException: Could not find delegate: androidx.compose.material.ripple.AndroidRippleNode@e577fcf
at androidx.compose.ui.node.DelegatingNode.undelegate(DelegatingNode.kt:181)
at androidx.compose.material3.DelegatingThemeAwareRippleNode.removeRipple(Ripple.kt:362)
...
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1348)
at android.view.Choreographer.doCallbacks(Choreographer.java:952)
at android.view.Choreographer.doFrame(Choreographer.java:878)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1322)
Hier ist der zusammensetzbare Code, den ich verwende:
Code: Select all
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun LargeFloatingActionButtonCustom(
icon: ImageVector,
contentDescription: String,
onClick: () -> Unit,
enabled: Boolean = true
) {
CompositionLocalProvider(
LocalRippleConfiguration provides
if (enabled) LocalRippleConfiguration.current
else null
) {
LargeFloatingActionButton(
modifier = Modifier.size(52.dp),
shape = CircleShape,
containerColor = if (enabled) MaterialTheme.colorScheme.primaryContainer else MaterialTheme.colorScheme.surfaceDim,
onClick = {
if (enabled) onClick.invoke()
},
) {
Icon(
imageVector = icon,
contentDescription = contentDescription,
tint = if (enabled)
LocalContentColor.current.copy(alpha = LocalContentColor.current.alpha)
else DarkGray
)
}
}
}
- AGP: 8.4.2
- Kotlin: 1.9.0
- Kern KTX: 1.13.1
- Verfassen: 2024.09.01
- Material3: 1.3.0