A floating button which expands to support multiple operations in Jetpack Compose.
implementation("io.github.agent-polyblank:extendedfab:1.0.0")// ...
import io.github.agentpolyblank.extendefab.ui.ExtendedFab
import io.github.agentpolyblank.extendefab.ui.ExtendedFabItem
//...
val isExpanded = remember { mutableStateOf(false) }
ExtendedFab(
isExpanded = isExpanded,
icon = {
Icon(
imageVector = Icons.Default.Settings,
contentDescription = null,
modifier = Modifier.size(50.dp).rotate(rotation)
)
},
) {
ExtendedFabItem(
icon = {
Icon(
imageVector = Icons.Default.Add,
contentDescription = null
)
},
onClick = {
// Handle click
}
)
ExtendedFabItem(
icon = {
Icon(
imageVector = Icons.Default.ShoppingCart,
contentDescription = null
)
},
onClick = {
// Handle click
}
)
}You can find the demo app in the app module.
- check your system with KDoctor
- install JDK 23 or higher on your machine
- add
local.propertiesfile to the project root and set a path to Android SDK there
To build the application bundle:
- run
./gradlew :sample:composeApp:assembleDebug - find
.apkfile insample/build/outputs/apk/debug/sample-debug.apkRun android UI tests on the connected device:./gradlew :sample:composeApp:connectedDebugAndroidTest
Run the desktop application: ./gradlew :sample:composeApp:run
Run desktop UI tests: ./gradlew :sample:composeApp:jvmTest
To run the application on iPhone device/simulator:
- Open
iosApp/iosApp.xcprojectin Xcode and run standard configuration - Or use Kotlin Multiplatform Mobile plugin for Android Studio
Run iOS simulator UI tests:
./gradlew :sample:composeApp:iosSimulatorArm64Test
Run the browser application: ./gradlew :sample:composeApp:wasmJsBrowserDevelopmentRun --continue
Run browser UI tests: ./gradlew :sample:composeApp:wasmJsBrowserTest
