Skip to content

Bckp/equalizer#724

Merged
theovilardo merged 9 commits intomasterfrom
bckp/equalizer
Jan 3, 2026
Merged

Bckp/equalizer#724
theovilardo merged 9 commits intomasterfrom
bckp/equalizer

Conversation

@theovilardo
Copy link
Copy Markdown
Owner

Added Equalizer + neccesary UI changes

theovilardo and others added 9 commits January 1, 2026 17:27
Introduces a comprehensive, system-wide audio effects engine, including a 10-band equalizer, bass boost, virtualizer, and loudness enhancer. This feature is integrated into a new dedicated "Equalizer" screen accessible via a new sidebar navigation drawer.

**Core Audio Engine (`EqualizerManager`, `EqualizerPreset`):**
- Adds `EqualizerManager` to manage Android's `Equalizer`, `BassBoost`, `Virtualizer`, and `LoudnessEnhancer` effects.
- Attaches effects directly to ExoPlayer's `audioSessionId` to support crossfades and ensure persistence.
- Defines 10 standard equalizer presets (e.g., Rock, Pop, Jazz) and supports saving/loading custom user-defined presets.
- Normalizes band levels to a consistent -15 to +15 dB range for the UI.

**Equalizer Screen & UI Components:**
- Creates a new `EqualizerScreen` with a modern, expressive UI.
- Implements a collapsible top app bar that shrinks on scroll.
- Adds multiple view modes for adjusting bands: traditional vertical sliders (`SLIDERS`), a real-time frequency response curve (`GRAPH`), and a combined view (`HYBRID`).
- Introduces `CustomVerticalSlider` and `WavyArcSlider` for interactive and visually engaging controls.
- Provides dedicated cards for Bass Boost, Virtualizer, and Loudness, which are hidden if the device does not support them.
- Allows users to save, delete, pin, and reorder custom presets through new bottom sheets (`CustomPresetsSheet`, `ReorderPresetsSheet`).

**State Management & Persistence (`EqualizerViewModel`, `UserPreferencesRepository`):**
- Adds `EqualizerViewModel` to manage UI state and interactions with the `EqualizerManager` and `UserPreferencesRepository`.
- All equalizer settings, including enabled state, presets, band levels, effects strength, and custom presets, are persisted in `UserPreferences`.
- The ViewModel observes player `audioSessionId` changes to re-attach effects seamlessly during playback transitions.

**Navigation and UI Integration:**
- Implements a new `AppSidebarDrawer` for main app navigation, providing access to Home, Equalizer, and Settings.
- Adds a hamburger menu icon to the `HomeScreen` top bar to open the new sidebar.
- Integrates the Equalizer screen into the main navigation graph.
- Introduces a new `SettingsCategory` enum to define and manage distinct settings sections (e.g., Library, Appearance, Playback).
- Creates `SettingsCategoryScreen.kt` to dynamically display the settings for a given category, reusing existing setting components.
- Refactors the main `SettingsScreen.kt` to act as a hub, displaying a list of these categories instead of all individual settings.
- Adds navigation logic to handle routing from `SettingsScreen` to the new `SettingsCategoryScreen` based on the selected category ID.
- Introduces `SettingsComponents.kt` to centralize shared UI components like `SettingsItem`, `ThemeSelectorItem`, and `SliderSettingsItem` that are now used across both the old and new settings screens.
- Implements a new `ExpressiveCategoryItem` composable for the main settings hub, providing a visually distinct entry for each category with an icon, title, and subtitle.
- Add `SettingsCategory` to the list of screens that hide the bottom navigation bar in `MainActivity`.
- Allow the `ExpressiveTopBarContent` title to wrap to a second line and scale from the left-center to prevent overflow with longer text.
- Remove the hamburger menu icon from `GradientTopBar` and adjust padding for the "Beta" button.
- Remove explicit start padding from the "Experimental" settings screen title to align with the updated top bar.
Refactors the `ExpressiveTopBarContent` composable to use explicit padding parameters instead of a `Pair`, improving clarity and control over title animation.

- Replaces `titlePaddingRange` with `collapsedTitleStartPadding` (default 68dp) and `expandedTitleStartPadding` (default 16dp).
- Updates `StatsScreen`, `EqualizerScreen`, and `SettingsCategoryScreen` to use these new padding parameters for a consistent look.
- Adds `zIndex(1f)` to the back buttons in `StatsScreen` and `SettingsScreen` to ensure they render above the animating title text.
- Adjusts miscellaneous layout spacing and conditions for title wrapping in `SettingsScreen` and `SettingsCategoryScreen` to align with the new top bar behavior.
This commit introduces a significant visual redesign of the Stats screen, replacing the main summary card with two distinct hero cards and converting the timeline from a horizontal list to a vertical bar chart.

- **Stats Screen Hero:**
    - Replaces the single large summary card (`StatsSummaryCard`) with a new `StatsHeroSection`.
    - This new section consists of two side-by-side `HeroCard`s for "Listening Time" and "Total Plays", using `primaryContainer` and `tertiaryContainer` for background colors.

- **Listening Timeline Chart:**
    - Replaces the horizontal progress bar list with a vertical bar chart design.
    - Bars are now vertically oriented with rounded top corners (`RoundedCornerShape(topStart = 8.dp, topEnd = 8.dp)`).
    - The chart now supports horizontal scrolling when the number of data points is large.
    - Bar color is simplified to `MaterialTheme.colorScheme.primary`.

- **Removed "Daily Rhythm" Section:**
    - The `DailyListeningDistributionSection` and its related components (`DailyListeningTimeline`, `WeeklyDailyListeningTimeline`) have been completely removed from the UI.

- **Minor UI Tweaks:**
    - **Equalizer Screen:** Adjusts the expanded title start padding for better alignment.
    - **Top Artists/Tracks Chart:** Simplifies the bar background from a gradient to a solid color.
This commit introduces several UI refinements to the Equalizer and Settings screens.

On the Equalizer screen:
- Enlarges the preset selection container for better touch targets.
- Adjusts padding and spacing around sliders and presets for a more balanced layout.

On the Settings screen:
- Implements custom, theme-aware colors for each settings category icon, improving visual distinction.
- Adds `ExpressiveSettingsGroup` to visually group related settings items.
- Ensures category subtitles do not overflow their container.
- Replace outlined settings icons with rounded variants.
- Remove background from expressive category items for a cleaner look.
- Disable the swipe gesture for opening the sidebar.
- Comment out the sidebar-opening functionality from the home screen's menu button.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 84d2037adb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 128 to +132
// Attach listener to initial master
playerA.addListener(masterPlayerListener)

// Initialize active session ID
_activeAudioSessionId.value = playerA.audioSessionId
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Emit audio session changes for equalizer attachment

The equalizer relies on activeAudioSessionId to know when to attach (EqualizerViewModel.initializeEqualizer() collects it), but _activeAudioSessionId is only assigned once at init to playerA.audioSessionId (typically 0 before playback) and again on player swap. There is no AudioListener.onAudioSessionIdChanged hook or other update when ExoPlayer later assigns the real session ID, so the flow never emits a usable ID and the equalizer/bass/virtualizer never attach for normal playback unless a swap happens. Please emit the session ID when it becomes non-zero (e.g., from the audio listener) so effects can be attached.

Useful? React with 👍 / 👎.

@theovilardo theovilardo merged commit 2893e4e into master Jan 3, 2026
@lostf1sh lostf1sh deleted the bckp/equalizer branch January 16, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants