Watchface settings and properties

Former Member
Former Member
Hi,

i want to create user settings properties for my watchface to let the user chosse some colors.

I already create some settings and properties which works fine.

<properties>
<property id="FONT_COLOR" type="number">1</property>
<property id="BACK_COLOR" type="number">2</property>
</properties>
<strings>
<string id="title_font_color">Font Color</string>
<string id="title_back_color">Background Color</string>

<string id="opt_color_1">White</string>
<string id="opt_color_2">Yellow</string>
<string id="opt_color_3">Orange</string>
<string id="opt_color_4">Red</string>
<string id="opt_color_5">Green</string>
<string id="opt_color_6">Blue</string>
<string id="opt_color_7">Black</string>
</strings>

<settings>
<setting propertyKey="@Properties.FONT_COLOR" title="@Strings.title_font_color">
<settingConfig type="list">
<listEntry value="1">Rez.Strings.opt_color_1</listEntry>
<listEntry value="2">Rez.Strings.opt_color_2</listEntry>
<listEntry value="3">Rez.Strings.opt_color_3</listEntry>
<listEntry value="4">Rez.Strings.opt_color_4</listEntry>
<listEntry value="5">Rez.Strings.opt_color_5</listEntry>
<listEntry value="6">Rez.Strings.opt_color_6</listEntry>
<listEntry value="7">Rez.Strings.opt_color_7</listEntry>
</settingConfig>
</setting>
<setting propertyKey="@Properties.BACK_COLOR" title="@Strings.title_back_color">
<settingConfig type="list">
<listEntry value="1">Rez.Strings.opt_color_1</listEntry>
<listEntry value="2">Rez.Strings.opt_color_2</listEntry>
<listEntry value="3">Rez.Strings.opt_color_3</listEntry>
<listEntry value="4">Rez.Strings.opt_color_4</listEntry>
<listEntry value="5">Rez.Strings.opt_color_5</listEntry>
<listEntry value="6">Rez.Strings.opt_color_6</listEntry>
<listEntry value="7">Rez.Strings.opt_color_7</listEntry>
</settingConfig>
</setting>
</settings>


How can I set the choices?

function onSettingsChanged() {
var font_color = App.getApp().getProperty("FONT_COLOR");
handleYourColorChangesHere(back_color);
var back_color = App.getApp().getProperty("BACK_COLOR");
handleYourColorChangesHere(back_color);
Ui.requestUpdate();
}


Can I set the choice directly in the layout? How?

<label id="TimeLabel" x="center" y="center" font="Gfx.FONT_NUMBER_THAI_HOT" justification="Gfx.TEXT_JUSTIFY_CENTER" color="Gfx.COLOR_WHITE"></label>

Greetings Ronny