Page 1 of 1

Please Assist with UI Action

Posted: 18 Oct 2015 15:11
by autobear
Two Questions:

1. Inside Action UI - please give an example how does the isChecked(variable) work - does it give a Boolean true or false output and into what variable ?

2. I'm trying to check if Power saving is enabled in QuickSettings - can I use isChecked for this ?

Re: Please Assist with UI Action

Posted: 19 Oct 2015 18:56
by Martin
Hi,

Quick settings are often not real toggle buttons or check boxes that can be queried with function isChecked. Please try to see if this power saving toggle is part of the system settings. To do this, create an action Init Variable System Setting and scroll through the list of available settings to see if one could be the power saving toggle (for Samsung devices it might be powersaving_switch or psm_switch). Toggle the setting on/off and verify if the system settings value changes. If yes, you can query the value and store the current value in a variable of your choice.
Use a condition Expression: setting=="1" to check if the setting is turned on.

The power saving mode of the Google-Android 5+ can be checked with condition Battery Saver Mode Enabled.

Regards,
Martin