Skip to content

refactor(theme): remove deprecated ThemeColorUtils and migrate header theming to ColorUtil#16492

Open
joshtrichards wants to merge 5 commits into
masterfrom
jtr/drop-deprecated-ThemeColorUtils
Open

refactor(theme): remove deprecated ThemeColorUtils and migrate header theming to ColorUtil#16492
joshtrichards wants to merge 5 commits into
masterfrom
jtr/drop-deprecated-ThemeColorUtils

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Feb 9, 2026

Copy link
Copy Markdown
Member

Not sure about the fallback colors

  • Removes ThemeColorUtils and all related usages from DrawerActivity, ToolbarActivity, and dependency injection modules.
  • Migrates header and icon theming to use ColorUtil with tone-based contrast logic for improved visual consistency and maintainability.
  • Cleans up DI modules and deletes redundant code.

And addresses these lint warnings:

w: file:///home/runner/work/android/android/app/src/main/java/com/nextcloud/client/di/ThemeModule.kt:13:8 'class ThemeColorUtils : Any' is deprecated. Deprecated in Java.
w: file:///home/runner/work/android/android/app/src/main/java/com/nextcloud/client/di/ThemeModule.kt:30:32 'class ThemeColorUtils : Any' is deprecated. Deprecated in Java.
w: file:///home/runner/work/android/android/app/src/main/java/com/nextcloud/client/di/ThemeModule.kt:30:50 'constructor(): ThemeColorUtils' is deprecated. Deprecated in Java.

Related context: PR #10717

Theming/Drawer Branding PR Test Checklist

  • Drawer header background uses correct branding color (from server or fallback)
  • Switching server branding colors (light, dark, saturated, invalid, unset) updates UI correctly
  • App appears correct in both light and dark mode
  • No crashes or rendering issues after logging into/out of Nextcloud accounts with/without branding
  • Drawer and banner appearance is correct for branded and unbranded builds, and when banner is hidden by preference
  • Multi-account scenarios: branding and contrast are correct per account

Optional:

  • Test on multiple Android versions and screen sizes

🖼️ Screenshots

🏚️ Before 🏡 After
B A

🏁 Checklist

  • Tests written, or not not needed

@joshtrichards joshtrichards added technical debt Refactoring or cleanup needed to improve maintainability. feature: theming labels Feb 9, 2026
@joshtrichards joshtrichards marked this pull request as ready for review February 9, 2026 22:47
…ity header and banner colors

Update DrawerActivity to use ColorUtil and a unified tone-based contrast check for setting ecosystem icon colors and server name text color, ensuring robust fallback and improved legibility with all server branding themes.

Drops reliance on deprecated ThemeColorUtils.

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
@alperozturk96 alperozturk96 force-pushed the jtr/drop-deprecated-ThemeColorUtils branch from a4277db to 748f4f7 Compare February 16, 2026 13:24
@github-actions

Copy link
Copy Markdown

Codacy

SpotBugs

CategoryBaseNew
Bad practice4242
Correctness7575
Dodgy code256256
Experimental11
Internationalization77
Malicious code vulnerability22
Multithreaded correctness3434
Performance4444
Security1818
Total479479

@github-actions

Copy link
Copy Markdown

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/16492.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@github-actions

Copy link
Copy Markdown

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

@alperozturk96

Copy link
Copy Markdown
Collaborator

Hi! Thanks for your contribution.

Could you please resolve conflict? Then we can review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: theming technical debt Refactoring or cleanup needed to improve maintainability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants