Closed MFlisar closed 6 years ago
Important question
You use the resource ids to persist user selections in preferences. Is this really safe? I do this in my extensions I made in this pull request as well.
Those ids are not 100% sure to never change after builds as far as I know (so it's not safe to assume, that those persisted ids are valid after a rebuild of the app). We could persist the resource string names instead and use them to read back in the settings. What do you think about this? Sadly this would be a breaking change...
I'll take a look at the PR later today, but the resource ids is a good point. In the old legacy version of colorful I had it loading by resource name versus ID. I don't think it'd be too bad a of a breaking change, at worst the persisted settings are lost. I'll look into it today as well.
Could you update the readme in your PR to document these new features? I'm most likely going to approve this, it's a good change.
I wonder if we could allow the user to implement their own ThemeColor interface so they could have easy syntax such as CustomThemes.Magenta
Extended the readme. Actually, you can use ANY class that implements ThemeColorInterface
, it must not be a CustomThemeColor
, this class only exists for convenience...
It should be no problem to define a custom enum that implements the ThemeColorInterface
that's named CustomThemes
and define user enums like Magenta
in there
I didn't get a chance to look at this tonight, I was busy trying to fix a bug in JRAW, however I will take a look tomorrow and merge. If I have any quibbles it will be in class naming only, this PR looks good.
Done
ColorfulColor
optimisedColorPack
fields made privateColorfulDelegate
toThemeEditor
as this makes more sense imhoThemeEditor
for the preference file nameHow it works
ThemeColor
is replaced byThemeColorInterface
in the whole library.1) Create styles for the custom theme like following:
2) Create a
CustomThemeColor
object like following (or use one of the alternative constructors):3) simply use this
primaryColor
object like you used e.g.ThemeColor.RED
beforeWhat do you think about this? Do you consider this feature useful as well?