Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Refactor the Pocket category colors into a singular data class #27457

Closed
MozillaNoah opened this issue Oct 18, 2022 · 0 comments · Fixed by #27851, Leland-Takamine/fenix#159, nathanmkaya/fenix#108 or fork-house/fenix#14
Assignees
Labels
compose Tickets involving Composable changes eng:health Improve code health Feature:PocketIntegration
Milestone

Comments

@MozillaNoah
Copy link
Contributor

MozillaNoah commented Oct 18, 2022

After the introduction of wallpaper-adjusted colors, PocketCategoriesViewHolder initializes four colors to cover the selection state. For parameter simplification and down-the-road refactoring quality of life, this would benefit from having the colors wrapped in a new data class, such as PocketCategoryColors. This way, a single parameter can be passed around rather than a growing list of colors as the business logic evolves.

The default/fallback colors should be be inlined with the data class and the fallbacks when the passed-in colors are null.

Any nullability handling should be handled with a secondary constructor.

data class PocketCategoryColors(
    val selectedBackgroundColor: Color,
    val unselectedBackgroundColor: Color,
    val selectedTextColor: Color,
    val unselectedTextColor: Color,
)

┆Issue is synchronized with this Jira Task

@MozillaNoah MozillaNoah added the eng:health Improve code health label Oct 18, 2022
@MozillaNoah MozillaNoah self-assigned this Oct 18, 2022
@github-actions github-actions bot added the needs:triage Issue needs triage label Oct 18, 2022
@MozillaNoah MozillaNoah removed the needs:triage Issue needs triage label Oct 18, 2022
@gabrielluong gabrielluong added compose Tickets involving Composable changes Feature:PocketIntegration labels Oct 20, 2022
@MozillaNoah MozillaNoah changed the title Refactor Pocket's UI colors into a singular data class Refactor the Pocket category colors into a singular data class Nov 8, 2022
@mergify mergify bot closed this as completed in #27851 Nov 16, 2022
mergify bot pushed a commit that referenced this issue Nov 16, 2022
mergify bot pushed a commit that referenced this issue Nov 16, 2022
@github-actions github-actions bot added this to the 109 milestone Nov 16, 2022
AndiAJ pushed a commit to AndiAJ/fenix that referenced this issue Nov 21, 2022
AndiAJ pushed a commit to AndiAJ/fenix that referenced this issue Nov 21, 2022
JohanLorenzo pushed a commit to mozilla-mobile/firefox-android that referenced this issue Feb 14, 2023
JohanLorenzo pushed a commit to mozilla-mobile/firefox-android that referenced this issue Feb 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.