spinnable
0.5.1indexedUI library facilitates spinning components using customizable states for manual or automatic rotation, supporting both composable and XML configurations. Offers options for rotation speed and axis control.
UI library facilitates spinning components using customizable states for manual or automatic rotation, supporting both composable and XML configurations. Offers options for rotation speed and axis control.
Kotlin multiplatform ui library to spin components. We support jvm (desktop) and Android. Check out the wiki page for
Compose,
Desktop and
Android usage!
Roadmap
- iOS support
- Api design improvements
- Improve performance, if needed
- Add the option to snap on release to closest side
- Add the option to set component rotation on demand
SpinnableView(
front: @Composable () -> Unit,
back: @Composable () -> Unit,
state: SpinnableState = SpinnableState.Manual.Both,
modifier: Modifier = Modifier
)
front: Your composable content when the Spinnable is front facing
back: Your composable content when the Spinnable is back facing
None: No movement allowed
<williankl.spinnable.core.SpinnableView
android:id="@+id/spinnable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
xml code:app:state="state": This field can be:
none: This one makes the spinnable static. Unable to move.
manual: Comes with a combo of and . The default value for both fields, if not passed, is .
Add these on build.gradle.kts file of the target module.
repositories {
mavenCentral()
}
dependencies {
implementation("io.github.williankl.spinnable:spinnable-core:$spinnableVersion")
}
state: Defines in what state is your Spinnable. The following types are available:
Manual: It can be Manual.Horizontal, Manual.Vertical or Manual.Both. Each makes the component spinnable to the according axis.
Automatic: Has the horizontalSpeed and verticalSpeed. It receives a Float value. 360F makes the component spin 360 degrees per second.
app:isVerticalEnabled="boolean"app:isHorizontalEnabled="boolean"trueautomatic: Comes with a combo of app:horizontalSpeed="float" and app:verticalSpeed="float". The default speed for both fields, if not passed, is 360F
Surfaced from shared tags and platforms — no rankings paid for.