Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setting conditional on device

I have some settings for location of the activities counters and also the colour of them.

 

Since versa lite doesn't support elevation, I wanted to hide these options from the settings if the device is a versa lite, but can't see anyway in the docs to achieve this?  Is this possible?

Best Answer
0 Votes
3 REPLIES 3

It's possible. Use React to conditionally display settings. See the hiddenToggle example here.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

I want a colour picker though that can be hidden based on device.

So there are issues.  The 1st is getting the device in the settings.  The 2nd is hiding the colour picker

Best Answer
0 Votes

The recommended way of doing a device-specific conditional is to query the device capabilities using the Device API, communicate that to the companion API, set a setting for the capability in the companion API, then use that setting in the conditional expression in the settings JSX. Phew!

 

Unfortunately, that process tends to be slow and unreliable. A non-robust work-around is to cheat using info available here.

Peter McLennan
Gondwana Software
Best Answer
0 Votes