Jiggicons

Jetpack Compose

The Jiggicons library for Android apps built with Compose.

build.gradle.kts
dependencies {
    implementation("com.jiggicons:jiggicons-compose:0.1.0")
}
Inbox.kt
import com.jiggicons.JiggIcon
import com.jiggicons.JiggIconVariant

@Composable
fun Inbox() {
    JiggIcon("bell", variant = JiggIconVariant.Solid, size = 32.dp, sound = true, contentDescription = "Notifications")
}

Tap the icon and it plays. It works on Android 7.0 (API 24) and later. Motion is off when the system’s Remove animations setting is on.

Parameters

ParameterDefault
variantOutlineOutline, Solid, Duotone or Glass. Styles
size24.dpWidth and height
colorLocalContentColorThe icon’s colour. Glass keeps its own frosted greys
soundfalsePlay the icon’s spatial sound with its motion
volume1fSound volume from 0 to 1
triggerTapTap, Appear or None
statenullA rememberJiggIconState() to play it from code
contentDescriptionnullAccessible name. Leave it out when the icon sits next to a visible label. Accessibility

Play from code

val bell = rememberJiggIconState()

JiggIcon("bell", trigger = JiggIconTrigger.None, state = bell)
Button(onClick = { bell.play() }) { Text("Ring") }

Sound

Each sound is made by the same synthesis as on the web, already placed between the two speakers along the path the icon moves, and ships in the library as a small .m4a file. Sounds play through SoundPool as interface sounds.

JiggiconsAudio.volume = 0.6f

The Compose library has the 80 free icons.