Skip to content

Configuration

The rebound { } block in your build.gradle.kts controls build-time behavior:

app/build.gradle.kts
rebound {
enabled.set(true) // Whether the compiler plugin instruments composables
debugOnly.set(true) // Only instrument debug build variants
}
PropertyTypeDefaultDescription
enabledBooleantrueMaster switch. When false, the compiler plugin is a no-op — no tracking calls are injected.
debugOnlyBooleantrueWhen true, only debug variants are instrumented. Release APKs contain no Rebound code.

Setting enabled = false is useful for temporarily disabling instrumentation without removing the plugin from your build file.

These are set in your application code and take effect at runtime:

// Toggle tracking on/off at runtime (e.g., only enable for specific screens)
ReboundTracker.enabled = true // default: true
// Log every composition event to logcat (throttled to 1 per composable per second)
ReboundTracker.logCompositions = true // default: false

Controls whether the runtime actually records metrics when the injected tracking calls fire. Set this to false to pause monitoring without rebuilding. Useful for toggling monitoring on specific screens or user flows.

When enabled, every composition event is logged to logcat with tag Rebound. This produces a lot of output, so logging is throttled to a maximum of one log line per composable per second. Budget violations are always logged regardless of this setting.

Override the compiler’s automatic budget classification for any composable:

@ReboundBudget(BudgetClass.ANIMATED)
@Composable
fun PhysicsSticker(offset: Offset) {
// The compiler would classify this as LEAF (no child composable calls)
// but it is driven by physics animation, so ANIMATED is correct
Box(
modifier = Modifier
.offset { IntOffset(offset.x.toInt(), offset.y.toInt()) }
.size(80.dp)
)
}

Available budget classes for annotation:

Budget ClassRate LimitUse When
SCREEN3/sFull screens that should rarely recompose
LEAF5/sTerminal composables with no children
CONTAINER10/sLayout wrappers with children
INTERACTIVE30/sUser input handlers
LIST_ITEM60/sRecycled items in lazy lists
ANIMATED120/sAnimation or gesture-driven composables

The annotation takes priority over all heuristic classification. Use it when the automatic classification does not match the composable’s actual role. See Custom Budgets for detailed guidance.