Customise Toggle Widget

Post your questions and help other users.

Moderator: Martin

Post Reply
Adap
Posts: 3
Joined: 07 Feb 2014 03:15

Customise Toggle Widget

Post by Adap » 07 Feb 2014 03:27

I use a toggle widget that is doing exactly what I want but would like to change it's fill colour. Is this possible?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Customise Toggle Widget

Post by Martin » 07 Feb 2014 10:09

Hi,

Sorry, toggle widgets can not be customized.
You could create your own widget (menu->Custom Widgets) and add a clickable action to execute a flow (expand section Clickable Actions and add an action Execute Flows to execute a flow of your choice).
You can also modify the look of your widget with a script function setWidgetElementProperty (use the button Function in action Script to insert the function call since it will display a dialog to compose the function call).

Regards,
Martin

Adap
Posts: 3
Joined: 07 Feb 2014 03:15

Re: Customise Toggle Widget

Post by Adap » 09 Feb 2014 02:33

Thanks for the quick reply.

The toggle works so well. Turning the toggle on acts as its own trigger, the flow commences, it is conditionally tested then one of two paths are executed. The two paths effectively switch the phone between two states; I'm now in my car so set these things on and these other things off, or I'm not in my car, swap everything back again.

If I do it with a custom widget I have to 'code' the moving of the global variable between states. I'd have to test the current state of the global variable, flip it to the opposite and then execute the appropriate flow. Not a big issue it's just that the toggle widget is so elegant. I also like the green-on status indicator in the widget. As you say, using setWidgetElementProperty would probably do that as well but I haven't looked yet.

I know, I'm just being lazy.

Cheers, Andy.

PS - loving Automagic. Just new to smartphones and initially tried Llama but there was too much cell tower confusion to get Llama working reliably. Automagic is just wonderful.

EDIT. Just did the changes using your suggestions to use script/setWidgetElementProperty . Didn't take that long and works well. Thanks.

fytos
Posts: 6
Joined: 19 May 2017 19:25

Re: Customise Toggle Widget

Post by fytos » 08 Dec 2021 15:38

Can anyone give me a link to go check how to use toggles and scripts? Want to start creating some, some 3xamples could be very helpful to start.
Thanks

Post Reply