-
Notifications
You must be signed in to change notification settings - Fork 12
3 User Interface System
Relevant source files
The following files were used as context for generating this wiki page:
This document covers the user interface architecture for AudioScape, including navigation patterns, screen hierarchy, and component organization. It focuses on the structural aspects of the UI system and how different interface components are organized and connected.
For detailed information about specific UI components like the music player interface, see Player Interface. For the modal system specifics, see Modal System. For content display components, see Content Display Components.
AudioScape uses Expo Router for file-based routing with a nested navigation structure. The root layout establishes global providers and defines the main navigation stack, while tab navigation provides the primary user interface structure.
The root layout in app/_layout.tsx sets up the application's foundation with global context providers and defines the main navigation stack:
graph TD
RootLayout["RootLayout"]
Provider["Provider (Redux)"]
MusicPlayerProvider["MusicPlayerProvider"]
LyricsProvider["LyricsProvider"]
SafeAreaProvider["SafeAreaProvider"]
GestureHandlerRootView["GestureHandlerRootView"]
ThemeProvider["ThemeProvider"]
Stack["Stack (expo-router)"]
TabsScreen["(tabs) - Main Tab Navigation"]
PlayerScreen["player - Music Player Modal"]
ModalsGroup["(modals) - Various Modal Screens"]
RootLayout --> Provider
Provider --> MusicPlayerProvider
MusicPlayerProvider --> LyricsProvider
LyricsProvider --> SafeAreaProvider
SafeAreaProvider --> GestureHandlerRootView
GestureHandlerRootView --> ThemeProvider
ThemeProvider --> Stack
Stack --> TabsScreen
Stack --> PlayerScreen
Stack --> ModalsGroup
The navigation stack defines several key screen groups:
- Main tabs: The primary navigation interface with four tabs
- Player modal: Full-screen music player interface
- Modal screens: Various overlay screens for specific actions
Sources: app/_layout.tsx:119-171
The navigation follows Expo Router's file-based routing conventions:
| Route Pattern | Purpose | Presentation |
|---|---|---|
(tabs) |
Main tab navigation container | Standard |
player |
Full-screen music player | Transparent modal |
(modals)/addToPlaylist |
Add songs to playlist | Transparent modal |
(modals)/deletePlaylist |
Delete playlist confirmation | Transparent modal |
(modals)/queue |
Playback queue management | Transparent modal |
(modals)/lyrics |
Synchronized lyrics display | Transparent modal |
(modals)/menu |
Context menu actions | Transparent modal |
Sources: app/_layout.tsx:119-171
The tab navigation system provides the primary interface structure with four main tabs and an integrated floating player.
The TabLayoutContent component in app/(tabs)/_layout.tsx configures the tab navigation:
graph TB
TabLayoutContent["TabLayoutContent"]
TabsComponent["Tabs (expo-router)"]
FloatingPlayer["FloatingPlayer"]
HomeTab["home - Home Tab"]
FavoritesTab["favorites - Favorites Tab"]
PlaylistsTab["playlists - Playlists Tab"]
DownloadsTab["downloads - Downloads Tab"]
IndexTab["index - Hidden Redirect Tab"]
TabBarBackground["LinearGradient TabBar Background"]
TabBarIcon["TabBarIcon Components"]
TabLayoutContent --> TabsComponent
TabLayoutContent --> FloatingPlayer
TabsComponent --> HomeTab
TabsComponent --> FavoritesTab
TabsComponent --> PlaylistsTab
TabsComponent --> DownloadsTab
TabsComponent --> IndexTab
TabsComponent --> TabBarBackground
TabsComponent --> TabBarIcon
Each tab is configured with specific icons and behaviors:
| Tab | Screen Name | Focused Icon | Unfocused Icon | Purpose |
|---|---|---|---|---|
| Home | home |
home |
home-outline |
Main content discovery |
| Favorites | favorites |
heart |
heart-outline |
Liked songs management |
| Playlists | playlists |
list |
list-outline |
Playlist management |
| Downloads | downloads |
download |
download-outline |
Downloaded content |
The tab bar uses a gradient background overlay and is positioned absolutely at the bottom with custom styling that removes default borders and shadows.
Sources: app/(tabs)/_layout.tsx:66-120
The FloatingPlayer component is positioned above the tab bar and provides persistent access to playback controls:
- Position: Absolute positioning above tab bar
- Spacing: 8px margin from left/right edges
-
Bottom offset:
bottom + 60pixels from safe area bottom -
Integration: Rendered outside the
Tabscomponent but within the same container
Sources: app/(tabs)/_layout.tsx:122-129
The UI system follows a hierarchical structure with clear separation of concerns between navigation, content display, and interactive components.
The application wraps components in multiple context providers to manage global state:
graph TD
ReduxProvider["Provider (Redux Store)"]
MusicProvider["MusicPlayerProvider"]
LyricsProvider["LyricsProvider"]
SafeAreaProvider["SafeAreaProvider"]
GestureHandler["GestureHandlerRootView"]
Navigation["Navigation Stack"]
ReduxProvider --> MusicProvider
MusicProvider --> LyricsProvider
LyricsProvider --> SafeAreaProvider
SafeAreaProvider --> GestureHandler
GestureHandler --> Navigation
This hierarchy ensures that:
- Redux state is available throughout the application
- Music player context manages playback state globally
- Lyrics context handles synchronized lyrics display
- Safe area context provides device-specific layout information
- Gesture handling is enabled for interactive components
Sources: app/_layout.tsx:106-116
The UI screens are organized into distinct categories:
| Category | Location | Purpose |
|---|---|---|
| Tab Screens | app/(tabs)/ |
Primary navigation screens |
| Modal Screens | app/(modals)/ |
Overlay screens for specific actions |
| Player Screen | app/player/ |
Full-screen music player interface |
| Redirect Screens | app/(tabs)/index.tsx |
Navigation redirects |
The index.tsx file in the tabs directory serves as a simple redirect to ensure users always land on the home tab when entering the tab navigation flow.
Sources: app/(tabs)/index.tsx:9-17
The UI system uses consistent styling patterns and integrates with React Navigation's theming system.
The application uses React Navigation's DarkTheme as the base theme, ensuring consistent dark mode appearance across navigation elements.
The tab bar implements custom styling with:
- Background: Linear gradient from transparent to black
- Position: Absolute positioning at bottom
- Border: Removed top border and elevation for seamless appearance
-
Typography: Scaled font sizes using
react-native-size-matters - Colors: Tint color for active state, muted gray for inactive
The UI adapts to different screen sizes and safe areas:
- Safe area insets are used for proper spacing around device-specific UI elements
- Font sizes are scaled using
moderateScalefor consistent appearance across devices - The floating player adjusts its position based on safe area bottom insets
Sources: app/(tabs)/_layout.tsx:24-63
The UI system integrates with multiple global state management systems to coordinate user interface updates with application state.
Three main context providers manage different aspects of the UI state:
- Redux Provider: Manages library state including favorites, playlists, and downloads
- MusicPlayerProvider: Handles playback state and player controls
- LyricsProvider: Manages synchronized lyrics display and timing
The root layout coordinates the initialization of various systems:
- Font loading (
useFontshook) - TrackPlayer setup (
useSetupTrackPlayerhook) - Notification channel setup
- Redux library initialization
- System UI configuration
- Splash screen dismissal
This sequence ensures all UI dependencies are ready before the interface becomes interactive.
Sources: app/_layout.tsx:52-98