Skip to content

feat(page): add customizable page background selection system#3438

Open
aalhendi wants to merge 12 commits intoquran:mainfrom
aalhendi:feat/aalhendi/add-background-color-picker
Open

feat(page): add customizable page background selection system#3438
aalhendi wants to merge 12 commits intoquran:mainfrom
aalhendi:feat/aalhendi/add-background-color-picker

Conversation

@aalhendi
Copy link

@aalhendi aalhendi commented Nov 17, 2025

Fixes #2737
Fixes #648
Fixes #647
Fixed #3491
Ref #2211 (comment)

Summary

Replaces the gradient background system with a theme selection bottom sheet, matching the design pattern from the iOS sister app.

Features

6 Page Themes:

  • Paper - Cream background
  • Original - Pure white
  • Calm - Parchment
  • Focus - Off-white
  • Quiet - Dark grey with white text
  • Black - Pure black with white text

App Theme Dropdown:

  • Light / Dark / System default
  • Controls overall app UI theming

Dark Theme Support:

  • Quiet and Black themes automatically invert Quran page text to white
  • Uses ColorMatrixColorFilter (same as existing night mode)

UI

  • Bottom sheet with 3-column grid of theme cards
  • Each card shows Arabic preview text "نور" with theme colors
  • Selection border indicates active theme
  • App Theme dropdown above the grid

Screenshots

image

Replace the gradient background system with a more flexible page background selection that includes preset colors and a custom color picker.

- Add preset background options (white, cream, light parchment, soft ivory)
- Implement custom color picker with RGB sliders
- Create PageBackgroundPickerPreference for settings UI
- Update QuranPageLayout to use selected background color
- Remove gradient-related code from QuranDisplayHelper
- Add corresponding settings storage and retrieval methods
- Update preferences UI and resources to support new system
@ahmedre
Copy link
Contributor

ahmedre commented Nov 18, 2025

jazakumAllah khairan. I have built this and sent screenshots to the team and will discuss with them and see whether this is the approach we want to take or not.

in the future, in order to avoid doing unnecessary work, please open an issue and ask before implementing new features so that your effort does not go to waste - really welcome your code contributions though and jazakumAllah khairan!

@ahmedre
Copy link
Contributor

ahmedre commented Dec 12, 2025

sorry for the late reply - we want to go with something similar but a little less open - we'd like to support the same colors that Quran.com supports - so light, dark, and sepia. Our iOS sister app just shipped with this:

Screenshot 2025-12-12 at 2 09 51 PM

we can do something similar and then merge the "dark mode" specific settings under it.

@aalhendi
Copy link
Author

aalhendi commented Jan 5, 2026

@ahmedre This looks great. Would you like me to pick this up and adjust the PR to something close to the attached image? Or do you already have plans to implement this on your side?

@ahmedre
Copy link
Contributor

ahmedre commented Jan 5, 2026

Please feel free to update - JazakumAllah khairan

aalhendi and others added 3 commits February 22, 2026 17:27
Replaces the page background color picker with a new page theme selector. This introduces a bottom sheet with a list of predefined themes (Auto, Paper, Original, Quiet, Calm, Focus) to simplify theme selection and remove the custom color picker.

The new implementation uses a `PageThemeBottomSheet` which is shown when the "Page Theme" preference is tapped. This change streamlines the user experience for customizing the reading view's appearance.
This commit redesigns the page theme selection UI, transitioning from a simple list to a more visually appealing card-based grid.

Key changes include:
*   Introducing a new card layout (`item_page_theme_card`) to display theme previews with sample text.
*   Replacing the old list item layout with a `GridLayoutManager` in the `PageThemeBottomSheet`.
*   Adding an "App Theme" dropdown (Light, Dark, System) to the bottom sheet, allowing users to control both app-wide and reader page themes from one place.
*   Refactoring the `PageTheme` sealed class to include properties for text color and whether the theme is dark.
*   Updating `HighlightingImageView` to apply a color filter for dark page themes, even when the main app theme is not in night mode.
@aalhendi
Copy link
Author

Please feel free to update - JazakumAllah khairan

@ahmedre I've updated the PR to match the iOS design with a theme selection bottom sheet and updated the PR text to reflect the changes.

A few questions came to mind when working on this. Specifically relating to Night Mode and Theme (UI) selection.

1. Night Mode vs Dark Themes
The existing Night Mode feature now has significant overlap with the dark page themes (Quiet, Black). Currently both exist. Night Mode has some unique features:

  • Text brightness slider
  • Background brightness slider
  • Quick toggle in the reading toolbar

Should we:

  • Keep both?
  • Remove Night Mode settings entirely?
  • Keep Night Mode but merge the brightness sliders to apply to dark page themes instead?
  • Remove settings but keep the toolbar toggle as a quick shortcut to cycle between light/dark themes?

2. App Theme Location
App Theme (Light/Dark/System) is currently in two places:

  • Settings > "Appearance" dropdown
  • Page Theme bottom sheet dropdown
    Should we consolidate to just the bottom sheet, or keep both entry points?

Happy to adjust based on your input.

Move the hardcoded hex color values for page themes from `Constants.kt` into `colors.xml`.
Adds content descriptions to the theme selection items in the theme picker bottom sheet. This improves accessibility by allowing screen readers to announce the action associated with each theme option (e.g., "Select Paper theme").
@ahmedre
Copy link
Contributor

ahmedre commented Mar 1, 2026

one thing I just discovered also - iOS app has day/night awareness for these colors depending on the theme

image

@ahmedre
Copy link
Contributor

ahmedre commented Mar 1, 2026

my initial thought is to remove the dark mode settings, but people might be really upset by it, in which case I guess we can bring them back. cc @KhaledKhaled0909 since I think you would have an opinion on this one.

for the theme, keeping both is fine.

Refactors theme handling to unify "Night Mode" with the page theme system. Removes legacy brightness sliders and the standalone night mode preference in favor of a cohesive theme-based approach.

Specific changes include:
- Removed `nightMode`, `nightModeTextBrightness`, and `nightModeBackgroundBrightness` preferences and their associated UI sliders.
- Replaced the manual night mode toggle logic with an automatic system based on the selected App Theme (Light/Dark/System) and Page Theme.
- Updated `HighlightingImageView` to use a dynamic `ColorMatrixColorFilter` based on page theme background and text colors, replacing the old inversion-based night mode.
- Consistently applied page theme colors to translations and page overlays.
- Removed the "Black" page theme in favor of the "Quiet" theme which now correctly forces dark mode.
- Updated color resources for all page themes (Paper, Original, Calm, Focus, Quiet) to include both background and text color definitions for light and dark modes.
- Cleaned up string resources across multiple locales by removing deprecated night mode setting descriptions.
@aalhendi
Copy link
Author

@ahmedre I have updated the PR to now follow a pure theming approach. I have removed brightness slider and kept the night mode toggle. The themes have also been updated to have light and dark mode variants.
note: Quiet theme forces dark mode.

Feel free to test it out and let me know if anything else is needed

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.

Change of default dark mode colors and adding new options Ereader-friendly colour scheme Color Option Reading Mode

2 participants