This module contains the enhanced UI components and design system for IReader, following Mihon's proven Material Design 3 patterns.
- IReaderErrorScreen: Comprehensive error display with random kaomoji faces and contextual action buttons
- IReaderLoadingScreen: Enhanced loading states with optional progress indicators and messages
- IReaderEmptyScreen: Consistent empty state handling with helpful messaging and actions
- IReaderScaffold: Enhanced scaffold with proper scroll behavior and Material Design 3 theming
- TwoPanelBox: Responsive tablet layouts with automatic WindowSizeClass detection
- AppBar: Consistent app bar components with proper scroll behavior
- ActionButton: Material Design 3 button components with icon and text
- Pill: Pill-shaped badges for labels and tags
- IReaderElevatedCard: Consistent card styling with proper elevation
- IReaderFastScrollLazyColumn: Optimized list handling with performance improvements
- IReaderTheme: Comprehensive Material Design 3 theme with multiple color schemes
- Typography: Consistent text styling following Material Design 3 guidelines
- Shapes: Rounded corner shapes for consistent visual hierarchy
- Padding: Standardized spacing values across the application
IReaderErrorScreen(
message = "Something went wrong",
actions = listOf(
ErrorScreenAction(
title = "Retry",
icon = Icons.Default.Refresh,
onClick = { /* retry logic */ }
)
)
)IReaderScaffold(
topBar = { scrollBehavior ->
AppBar(
title = { Text("My Screen") },
scrollBehavior = scrollBehavior
)
}
) { paddingValues ->
// Content
}TwoPanelBox(
startContent = { /* Left panel for tablets */ },
endContent = { /* Main content */ }
)IReaderFastScrollLazyColumn {
items(
items = books,
key = { book -> book.id },
contentType = { "book_item" }
) { book ->
BookItem(book = book)
}
}- Consistency: All components follow Material Design 3 guidelines
- Performance: Optimized for smooth scrolling and efficient rendering
- Accessibility: Proper content descriptions and touch targets
- Responsiveness: Adaptive layouts for different screen sizes
- Theming: Comprehensive theme support with AMOLED options
- Replace
ErrorScreenwithIReaderErrorScreen - Replace
LoadingScreenwithIReaderLoadingScreen - Replace
EmptyScreenwithIReaderEmptyScreen - Replace
LazyColumnwithIReaderFastScrollLazyColumnfor better performance
- Use
IReaderScaffoldfor enhanced Material Design 3 support - Use
TwoPanelScaffoldfor responsive tablet layouts
- Apply
IReaderThemeat the root of your app - Use
MaterialTheme.paddingfor consistent spacing - Use
MaterialTheme.colorSchemefor proper theming
- List Performance: Use proper
keyandcontentTypeparameters in LazyColumn items - State Management: Minimize recomposition with stable state holders
- Memory Efficiency: Proper lifecycle management and resource cleanup
- Responsive Design: Efficient layout switching based on screen size
All components are designed to be testable with:
- Proper semantic properties for accessibility testing
- Stable state management for UI testing
- Clear component boundaries for unit testing
- Fast scroll implementation for large lists
- Advanced animation support
- Enhanced accessibility features
- Performance monitoring integration