@@ -18,6 +18,7 @@ import androidx.compose.ui.draw.rotate
1818import androidx.compose.ui.draw.scale
1919import androidx.compose.ui.graphics.Color
2020import androidx.compose.ui.graphics.painter.Painter
21+ import androidx.compose.ui.graphics.vector.ImageVector
2122import androidx.compose.ui.layout.Layout
2223import androidx.compose.ui.res.painterResource
2324import androidx.compose.ui.text.font.FontWeight
@@ -40,6 +41,8 @@ fun <T : SpeedDialData> SpeedDialFloatingActionButton(
4041 fabContentColor : Color = contentColorFor(fabBackgroundColor),
4142 speedDialBackgroundColor : Color = MaterialTheme .colors.secondaryVariant,
4243 speedDialContentColor : Color = contentColorFor(speedDialBackgroundColor),
44+ fabIcon : ImageVector = Icons .Default .Add ,
45+ fabIconRotationDegree : Float = 45f,
4346) {
4447 var expanded by remember { mutableStateOf(initialExpanded) }
4548
@@ -85,7 +88,7 @@ fun <T : SpeedDialData> SpeedDialFloatingActionButton(
8588 tween(durationMillis = animationDuration)
8689 }
8790 ) {
88- if (it) 45f else 0f
91+ if (it) fabIconRotationDegree else 0f
8992 }
9093 val fabBackgroundColorAnimated by transition.animateColor(
9194 label = " fabBackgroundColor" ,
@@ -121,7 +124,7 @@ fun <T : SpeedDialData> SpeedDialFloatingActionButton(
121124 ) {
122125 Icon (
123126 modifier = Modifier .rotate(fabIconRotation),
124- imageVector = Icons . Default . Add ,
127+ imageVector = fabIcon ,
125128 contentDescription = null ,
126129 )
127130 }
0 commit comments