Skip to content
This repository was archived by the owner on Apr 10, 2026. It is now read-only.

Custom Theme Color Picker & Decoupled Player Theme - #47

Closed
adrielGGmotion wants to merge 2 commits into
mainfrom
theme-customization-color-picker-5078750370399123351
Closed

Custom Theme Color Picker & Decoupled Player Theme#47
adrielGGmotion wants to merge 2 commits into
mainfrom
theme-customization-color-picker-5078750370399123351

Conversation

@adrielGGmotion

Copy link
Copy Markdown
Owner

Implemented a robust theme customization system allowing users to decouple the Player's dynamic theme (album art) from the App's theme. Added a custom Color Picker with a unique split-circle design and rainbow presets for static themes. The hierarchy is: Dynamic App > System Material You > Custom Static Color. The Player can independently remain dynamic.


PR created automatically by Jules for task 5078750370399123351 started by @adrielGGmotion

- Added `ColorPickerBottomSheet` with a split-circle visualizer for custom static themes.
- Updated `AppearanceSettings` to include new theme controls:
  - "Dynamic Player Theme" (Album Art for Player)
  - "Dynamic App Theme" (Album Art for App, dependent on Player toggle)
  - "Use System Colors" (Material You, fallback from Dynamic)
  - "Custom Theme Color" (Static color picker, fallback from System)
- Refactored `MainActivity` theme logic to support independent Player and App themes.
- Wrapped `BottomSheetPlayer` in its own `MetrolistTheme` to respect the decoupled configuration.

Co-authored-by: adrielGGmotion <200536612+adrielGGmotion@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @adrielGGmotion, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the application's theming capabilities by providing users with granular control over their visual experience. It introduces the ability to independently configure the player's dynamic theme, based on album art, from the overall application's theme. Furthermore, it integrates a custom color picker for static theme selection and supports system-level Material You theming, offering a flexible and personalized interface.

Highlights

  • Comprehensive Theme Customization: Implemented a robust system allowing users to customize the application's theme with greater control.
  • Decoupled Player Theme: The player's dynamic theme, derived from album art, can now be independently controlled from the main application's theme.
  • Custom Color Picker: Introduced a new custom color picker with a unique split-circle design and predefined rainbow presets for selecting static theme colors.
  • Theme Hierarchy: Established a clear theme hierarchy: Dynamic App > System Material You > Custom Static Color, providing a structured approach to theme application.
Changelog
  • app/src/main/kotlin/com/metrolist/music/MainActivity.kt
    • Added new preference keys (ApplyDynamicThemeToAppKey, StaticThemeColorKey, UseSystemMaterialYouKey) to manage theme settings.
    • Refactored theme state management, introducing dynamicTheme, applyDynamicThemeToApp, useSystemMaterialYou, and staticThemeColor to control different aspects of theming.
    • Introduced albumArtColor to specifically store the color extracted from album art, ensuring clear separation from the general themeColor.
    • Implemented logic to derive appThemeColor based on a priority order: dynamic album art, system Material You, or a user-selected static color.
    • Defined playerThemeColor to allow the player UI to adopt its own dynamic theme independently of the main app's theme.
    • Applied playerThemeColor to the BottomSheetPlayer component, enabling decoupled player theming.
  • app/src/main/kotlin/com/metrolist/music/constants/PreferenceKeys.kt
    • Defined new preference keys: ApplyDynamicThemeToAppKey (boolean), StaticThemeColorKey (integer for ARGB color), and UseSystemMaterialYouKey (boolean) to support the new theme customization options.
  • app/src/main/kotlin/com/metrolist/music/ui/component/ColorPickerBottomSheet.kt
    • Added a new file containing the ColorPickerContent Composable, which serves as a custom color picker UI.
    • The color picker features a live preview of the selected theme and a horizontal scrollable list of predefined color presets.
    • Introduced ColorTupleItem Composable, which visually represents each color preset using a unique split-circle design to showcase its primary, secondary, and tertiary color palette.
  • app/src/main/kotlin/com/metrolist/music/ui/screens/settings/AppearanceSettings.kt
    • Integrated the new theme preference states (applyDynamicThemeToApp, useSystemMaterialYou, staticThemeColor) into the Appearance Settings screen.
    • Updated the "Enable dynamic theme" setting label to "Dynamic player theme" for clarity.
    • Added a new toggle "Dynamic app theme" (visible when "Dynamic player theme" is enabled) to control if the app's theme follows the player's dynamic color.
    • Introduced a "Use system colors" toggle (visible on Android S+ if dynamic app theme is not active) to enable Material You theming.
    • Added a "Customize colors" option (visible if dynamic app theme is off or Material You is not used/available) that launches the new ColorPickerContent bottom sheet for static color selection.
Activity
  • The pull request was automatically generated by Jules for task 5078750370399123351, initiated by @adrielGGmotion.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a great new feature for theme customization, allowing users to decouple the player's theme from the main app theme and select a custom static color using a new color picker. The implementation is solid, with clear logic for theme selection hierarchy.

I've found a few areas for improvement:

  • A critical issue in AppearanceSettings.kt that will cause a build failure due to a missing string resource.
  • Several hardcoded strings in the settings screen that should be moved to strings.xml for localization.
  • Some minor code cleanup opportunities, such as removing unused parameters/variables and refactoring duplicated code.

Overall, this is a well-executed feature addition. Addressing these points will make the code more robust and maintainable.

add(
Material3SettingsItem(
icon = painterResource(R.drawable.palette),
title = { Text(stringResource(R.string.customize_colors)) },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

This code references a string resource R.string.customize_colors which does not exist in the provided app/src/main/res/values/strings.xml file. This will cause a compilation error. Please add this string resource to your strings.xml file to resolve the issue.

Material3SettingsItem(
icon = painterResource(R.drawable.palette),
title = { Text(stringResource(R.string.enable_dynamic_theme)) },
title = { Text("Dynamic player theme") },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The title "Dynamic player theme" is hardcoded. This prevents localization. Please extract this and other new hardcoded strings ("Dynamic app theme" on line 883, "Use system colors" on line 909) into strings.xml and reference them using stringResource().

Suggested change
title = { Text("Dynamic player theme") },
title = { Text(stringResource(R.string.dynamic_player_theme)) },

Comment on lines +817 to +827
MetrolistTheme(
darkTheme = useDarkTheme,
pureBlack = pureBlack,
themeColor = playerThemeColor,
) {
BottomSheetPlayer(
state = playerBottomSheetState,
navController = navController,
pureBlack = pureBlack
)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

There's duplicated code for wrapping the BottomSheetPlayer with MetrolistTheme. This logic appears again on lines 871-881. To improve maintainability and reduce redundancy, consider extracting this themed player into its own composable function or a variable.

Comment on lines +56 to +57
onColorSelected: (Int) -> Unit,
onDismiss: () -> Unit

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The onDismiss parameter is declared but never used within the ColorPickerContent composable. The bottom sheet's dismissal is handled by the BottomSheetMenu component that hosts this content. You can safely remove this parameter to simplify the function signature.

    onColorSelected: (Int) -> Unit

Canvas(modifier = Modifier.fillMaxSize()) {
val width = size.width
val height = size.height
val center = Offset(width / 2, height / 2)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The center variable is calculated but never used. It can be removed to clean up the code.

- Decouple Player Theme (Dynamic) from App Theme (Dynamic/System/Static).
- Add new keys: `UseSystemMaterialYouKey`, `ApplyDynamicThemeToAppKey`, `StaticThemeColorKey`.
- Implement `ColorPickerContent` with a horizontal list of "split-circle" color swatches (Primary/Secondary/Tertiary) and a theme preview card.
- Refactor `AppearanceSettings` to include the new toggles and display the Color Picker inline when custom colors are active.
- Fix UI structure to ensure `Material3SettingsGroup` and inline content are rendered correctly.
- Add localization strings.

Co-authored-by: adrielGGmotion <200536612+adrielGGmotion@users.noreply.github.com>
@adrielGGmotion
adrielGGmotion deleted the theme-customization-color-picker-5078750370399123351 branch February 4, 2026 11:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant