AnalyticsScreen
Main UI component for displaying analytics logs in a tabular format.
This composable renders a scrollable list of analytics events with a sticky header displaying highlighted statistics, followed by a filterable and scrollable log list. The bottom bar provides three complementary filtering mechanisms: a category chip row, a time range segmented button, and a text field for filtering by tag or screen class.
Features
Sticky header with highlighted analytics log statistics
Formatted timestamps (HH:mm:ss)
Category colour-coded chips per log entry
Animated item transitions when filters change
Scroll-to-top FAB that appears when the latest entry is out of view
Bottom bar with category filter chips, time range selector, and text filter field
Empty state message when no logs are present or no logs match the current filter
Usage
Basic Usage
CompositionLocalProvider(LocalAnalytics provides AnalyticsLogger.logs) {
AnalyticsScreen(
highlightedAnalyticsLogTypes = persistentListOf(
AnalyticsLogCategory.Action.Click,
AnalyticsLogCategory.Performance.Error
),
modifier = Modifier.fillMaxSize()
)
}Parameters
The list of AnalyticsLogType entries to highlight in the sticky header. Each type is displayed as a summary card showing its event count alongside a total count card. Typically contains two or three types of interest (e.g. clicks, errors).
Modifier to be applied to the root Scaffold.
Additional bottom padding applied to the bottom bar content, used to avoid overlap with system UI elements when this screen is nested inside another Scaffold.