Plus App Custom user settings
-
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 -
The manual provides an example of using an Enum, so that cannot by itself be the problem.
What kind of error are you getting.
Do not know if it is relevant here. But I had to init settings in code like below. I initially thought the data file was sufficient to do this but it seems not.
// Load app settings settings = localStorage.getObject("appSettings"); // Create default settings if none found if (settings == null) { settings = { targetPaceWarm: 2.326, targetPaceInterval: 2.857, targetPaceRecovery: 2.083, targetPaceCool: 2.083, durationWarm: 10, durationInterval: 12, durationRecovery: 5, durationCool: 20, repeatCount: 2 } }
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login