BottomBar Component
TheBottomBar component provides the main navigation interface using Material 3’s NavigationBar.
BottmBar.kt
Component Structure
TheBottomBar consists of four main elements:
Navigation Items
| Index | Screen | Label | Icon | Description |
|---|---|---|---|---|
| 0 | Home | Inicio | Home | Returns to the home screen |
| 1 | Schedule | Horario | DateRange | Shows the class schedule |
| 2 | Map | Mapa | LocationOn | Displays campus map |
| 3 | Profile | Perfil | AccountCircle | Shows student profile |
Props
The navigation controller used to handle screen transitions and observe the current route
Key Features
Active State Highlighting
The current screen is automatically highlighted based on the navigation route
Material 3 Design
Uses Material Design 3 NavigationBar for modern, adaptive styling
Outlined Icons
Uses outlined icon variants for a clean, professional look
Smart Navigation
Prevents back stack buildup with
popUpTo and launchSingleTopComponent Composition Patterns
The app follows modern Compose patterns for building UI:Stateless Components
Components likeBottomBar are stateless - they receive all necessary data through parameters:
State Hoisting
State is hoisted to the appropriate level in the composition hierarchy:Composition over Inheritance
Compose favors composition over inheritance. Components are built by composing smaller functions:Material 3 Components Used
The app leverages Material 3 components fromandroidx.compose.material3:
NavigationBar
NavigationBar
NavigationBarItem
NavigationBarItem
Icon
Icon
Vector icon component that uses Material Icons from
androidx.compose.material.icons.Text
Text
Text component that automatically uses theme typography styles.
Scaffold
Scaffold
Layout structure used in
AppNavigation to organize the bottom bar and content.Icon Resources
The app uses Material Icons Extended for a comprehensive icon set:Ensure the Material Icons Extended dependency is added to
build.gradle:Icon Variants
The app uses outlined icon variants for consistency:Icons.Outlined.HomeIcons.Outlined.DateRangeIcons.Outlined.LocationOnIcons.Outlined.AccountCircle
Screen Components
Individual screens are implemented as top-level composables in theui/screens/ package:
Screen Implementation
Each screen is a self-contained composable that uses
FakeData to display content. Screens are stateless and will receive data through ViewModels in future updates.Best Practices
Single Responsibility
Each component has a clear, single purpose
Reusability
Components are designed to be reusable across screens
Accessibility
All interactive elements include content descriptions
Theme Consistency
Components use theme colors and typography
Future Components
Planned reusable components for future development:- ClassCard: Card component for displaying class sessions
- BuildingCard: Card component for campus buildings
- ProfileInfoRow: Row component for profile information
- QRScanner: Camera composable for QR code scanning
- LoadingIndicator: Consistent loading state component
- ErrorView: Standard error state display
