Repository navigation
feat(settings): add custom theme import and dynamic theming support - #133
Merged
LandWarderer2772 merged 2 commits intoNov 2, 2026
Merged
Conversation
…amic color gating - Gate CUSTOM color scheme behind DynamicColors.isDynamicColorAvailable() - Dynamically resolve custom theme overlay based on system night mode - Share imported themes cache in AppSettings companion and fix deletion fallback - Support top-level metadata, role aliases, and multiple hex formats in theme parser - Prevent coroutine context leaks in AppearanceSettingsFragment - Fix preview indicator shape tinting in ThemeChooserPreference - Add unit tests for theme import parsing and roundtripping
Member
|
Tested on my phone running android 17, works as expected. |
Author
|
So, you are going to merge it ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for creating, importing, managing, and applying custom user themes via JSON files (Idle Fantasy Material 3 compatible format).
Users can now import custom palette files, select their imported themes from a dedicated dialog or the existing color scheme carousel, and have their chosen seed colors dynamically applied throughout the application on Android 6.0+ (API 23+).
Why this is needed
What was done
ImportedTheme.kt):light/dark), and extraction of primary seed and contrast colors.AppSettings.kt):importedThemes,selectedCustomThemeId,importCustomThemes(), anddeleteCustomTheme().@Volatilecache to avoid re-parsing JSON on every property access, preserving strict performance requirements (perCONTRIBUTING.md).BaseActivity.kt):DynamicColors.applyToActivityIfAvailablewithDynamicColorsOptions.Builder().setContentBasedSource(...).isDynamicColorAvailable().ThemeChooserPreference.kt,AppearanceSettingsFragment.kt):Dispatchers.IOusingrunCatchingCancellableto prevent UI thread blockage/ANRs during cloud storage imports.postRestart()) when switching between custom themes.ThemeChooserPreferenceby tinting shapes directly with the seed color rather than flattening the card background.Files Changed
app/src/main/kotlin/.../core/prefs/ImportedTheme.ktapp/src/main/kotlin/.../core/prefs/AppSettings.ktapp/src/main/kotlin/.../core/prefs/ColorScheme.ktCUSTOMentry to the available color schemes list when custom themes exist.app/src/main/kotlin/.../core/ui/BaseActivity.ktDynamicColorsOptions.setContentBasedSource(...).app/src/main/kotlin/.../settings/AppearanceSettingsFragment.ktapp/src/main/kotlin/.../settings/utils/ThemeChooserPreference.ktrefresh()method.app/src/main/res/values/strings.xmlapp/src/main/res/values/themes.xmlThemeOverlay.Futon.Custom.LightandThemeOverlay.Futon.Custom.Dark.app/src/main/res/xml/pref_appearance.xmlVerification
./gradlew compileDebugKotlin(Build succeeded).CONTRIBUTING.mdAPK size rule).Dispatchers.IO(complies with performance rule).