Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WatchFaceKotlin: ColorStyleIdAndResourceIds & setting CustomValues #658

Open
MikeMannox opened this issue Jan 17, 2023 · 0 comments
Open

Comments

@MikeMannox
Copy link

MikeMannox commented Jan 17, 2023

I have started working on designing my first WearOS Watchface & I am using the sample project WatchFaceKotlin as a guide. Initially I found it quite confusing to follow how UserStyleSetting & ColorStyleIdAndResourceIds fits into the architecture, I think I am starting to understand it now.

BUT... If I want to give the User an option to [say] change just the color of the hands or edit some text on the watchface I am stuck on how I should go about this as ColorStyleIdAndResourceIds is an enum class with color presets, & therefore is immutable.

An Idea I had is to use the WatchFaceConfigStateHolder#setMinuteHandArmLength(newLengthRatio: Float) example & then apply any colors or strings changes afterward the preset style has been applied.

However, there is no option to set an Int or String & UserStyleSetting.CustomValueUserStyleSetting.CustomValueOption(customValue: ByteArray) seems overkill to store a ColorResource or Int (color value) or a String.

  • Even setMinuteHandArmLength is converting types: Float to a Double and storing using UserStyleSetting.DoubleRangeUserStyleSetting.DoubleRangeOption(value: Double)

@codingjeremy I can see from this PR that you designed this mechanism, can you offer some guidance?

Cheers

Mike

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

No branches or pull requests

1 participant