Expression widget

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

Expression widget

Post by Rafi4 » 21 Oct 2018 13:10

Hi
I want to know about expression with overlay widget visibility. Is this possible? If yes? How?
Attachments
screenshot.png
screenshot.png (180.48 KiB) Viewed 13119 times
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: Expression widget

Post by digitalstone » 21 Oct 2018 14:38

Just use a script:
overlay=true
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

Re: Expression widget

Post by Rafi4 » 22 Oct 2018 03:57

Hi
Digitalstone I am using an overlay name = 44 for example and the script is [44= true] is not working as I wish.any modification?
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: Expression widget

Post by digitalstone » 22 Oct 2018 07:28

No i mean you should create a custom boolean variable to be able to evaluate if your overlay is on/off.
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

Re: Expression widget

Post by Rafi4 » 22 Oct 2018 08:40

Hi Digitalstone
Please give me one example.
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: Expression widget

Post by digitalstone » 22 Oct 2018 10:30

Place your widget overlay action.
Connect that to a script action in which you type something like: global_overlay-name = true

Then, whenever you want to check anywhere if that widget overlay is on or off, you can now just place a condition in which you type the name of your overlay variable.
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Expression widget

Post by Desmanto » 22 Oct 2018 12:28

It has been requested as feature before, to check whether an overlay is being shown or not : viewtopic.php?f=4&t=7142
The new feature probably can query using condition "Overlay SSown". The field can have multiple overlay checkbox, support global pattern. then there is invert checkbox to reverse the logic. (needed because sometimes we want to define all other widget besides the selected ones)

As for now, use glovar to store your widget state. (sorry to rephrase digitalstone post, I have typed this finish before the post) Add action script after you have show the widget.

Code: Select all

global_widget_callbutton = true;
Then after hiding it, add script

Code: Select all

global_widget_callbutton = false;
Later you can query the glovar to check widget visibility.

Code: Select all

global_widget_callbutton; //widget is being shown?
//or global_widget_callbutton == true, above is the shortened version.
You can use glovar map type, so you don't waste so many glovar solely for this. Create a glovar to store the state of the overlay you use frequently. At glovar, create global_widget as map type. Then at the script use

Code: Select all

global_widget["callbutton"] = true; // or false when hiding it.
There you can create as many overlay state you want (example : global_widget["network stats"], global_widget["shutter button"], etc), and you only require single glovar to store all of them.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply