Jetpack Compose
implementation("com.cimka:cimka-compose:1.1.1")No registration is needed — just use the helpers below.
import com.xhonaldo.cimka.compose.*Screens
Section titled “Screens”With Navigation Compose
Section titled “With Navigation Compose”Call TrackCimkaScreens once, next to your NavHost. Every navigation logs a screen view plus screen_exit / screen_enter events.
val navController = rememberNavController()TrackCimkaScreens(navController)
NavHost(navController, startDestination = "home") { composable("home") { HomeScreen() } composable("profile") { ProfileScreen() }}Dialogs, sheets and custom screens
Section titled “Dialogs, sheets and custom screens”Wrap content that should count as its own screen:
CimkaScreen("FilterSheet") { FilterSheetContent()}CimkaScreen provides LocalCimkaScreen, which clicks inside it use as their screen name.
Clicks
Section titled “Clicks”Modifier.cimkaClick
Section titled “Modifier.cimkaClick”A drop-in replacement for Modifier.clickable that also logs the interaction.
Row(modifier = Modifier.cimkaClick(label = "Dismiss banner") { onDismiss() }) { /* ... */}
Card( modifier = Modifier.cimkaClick( label = "Product card", onLongClick = { showMenu() }, // logged as LONG_PRESS ) { openProduct() }) { /* ... */ }| Parameter | Default | Description |
|---|---|---|
label |
null |
Human-readable label shown in the dashboard. |
elementId |
null |
Stable id. If omitted, derived from label ("Go to cart" → go_to_cart), else auto-generated. |
enabled |
true |
Same as clickable. |
role |
null |
Accessibility role. |
onLongClick |
null |
Enables long-press handling. |
onClick |
— | Click handler. |
rememberCimkaClick
Section titled “rememberCimkaClick”Wrap an existing onClick — handy for Button, IconButton and other components that take a lambda:
Button(onClick = rememberCimkaClick(label = "Continue") { onContinue() }) { Text("Continue")}Modifier.cimkaListItem
Section titled “Modifier.cimkaListItem”Track taps on list rows with the list and item identity:
LazyColumn { itemsIndexed(products, key = { _, p -> p.id }) { index, product -> ProductRow( product, modifier = Modifier.cimkaListItem( listId = "products", itemId = product.id, index = index, ) { open(product) } ) }}Items are logged as products[<itemId>:<index>].