Hello everyone!
I am struggling to implement custom settings for a Suunto Plus app.
I’d like to add a drop down menu, where the user can select 3 color themes.
Data.json
{
“appSettings”: { “centerValues”: false },
“colorTheme”: { “names”: [“classic”, “pink”, “purple”], “value”: 0 }
}
Manifest.json
“settings”: [
{ “shownName”: “Center values”, “path”: “appSettings.centerValues”, “type”: “boolean” },
{ “shownName”: “Pick color theme”, “path”: “colorTheme.value”, “type”: “enum”, “valuePath”: “colorTheme.names” }
],
The HEX values are in the html template onActivate:
var ct=localStorage.getItem(‘colorTheme.value’);
var hrColor=(ct===‘1’)?‘#EF009C’:(ct===‘2’)?‘#5700C2’:‘#CC2200’;
_accentColor=(ct===‘1’)?‘#FF422F’:(ct===‘2’)?‘#F83607’:‘#FFDE31’;
Ideas anyone? Or is Enum not supported at all?
Many thanks,
Markus