Во время Google IO 2025 они представили новую композицию Buttongroup , которая анимирует ширину содержащихся кнопок после их нажатия. However, the latest non-deprecated overload does not offer a Composable scope and I don't see how we can use the animatedWidth Modifier in there.
ButtonGroup(
modifier = Modifier
.safeDrawingPadding()
.padding(horizontal = 4.dp)
.fillMaxWidth(),
overflowIndicator = {}
) {
// Error: Composable invocations may only happen from the context of a @Composable function
ToggleButton() { }
}
Как я могу реализовать это поведение в Material3-Android: 1.4.0-alpha16 ?
Во время Google IO 2025 они представили новую композицию Buttongroup , которая анимирует ширину содержащихся кнопок после их нажатия. However, the latest non-deprecated overload does not offer a Composable scope and I don't see how we can use the animatedWidth Modifier in there. [code]ButtonGroup( modifier = Modifier .safeDrawingPadding() .padding(horizontal = 4.dp) .fillMaxWidth(), overflowIndicator = {} ) { // Error: Composable invocations may only happen from the context of a @Composable function ToggleButton() { } } [/code] Как я могу реализовать это поведение в Material3-Android: 1.4.0-alpha16 ?