grayscale tiles

Post your questions and help other users.

Moderator: Martin

Post Reply
yxd0018
Posts: 85
Joined: 05 Dec 2018 15:14

grayscale tiles

Post by yxd0018 » 23 Feb 2019 19:13

I installed liquidRemix rom to replace los16 and it's been crash-free and has tons of customization.
I play a bit with quick setting trigger and action "update quick setting tile". It seems automagic insert 5 custom tiles by default (Tile1 - 5).
1. I create a flow to triggered by "quick settings tile selected" by Tile1, followed up by "update quick settings tile". But execution always yield error "tile is not available, please enable the trigger for this tile first".
flow_Tile1_20190223_140346.xml
(1.76 KiB) Downloaded 871 times
EDIT: fitured out, the flow must be enabled to work and can't be tested alone.

2. LiquidRemix rom has a grayscale in the digital wellness section and also a builtin grayscale tile in the quick setting. The grayscale tile's target is custom(com.google.android.apps.wellbeing/.screen.ui.GrayscaleTileService). It doesn't work with click() or clickById(). Any idea how to toggle it?

Pepy
Posts: 76
Joined: 31 Oct 2018 10:53
Location: Canada

Re: grayscale tiles

Post by Pepy » 13 Jun 2019 06:17

For number 2, a click(); command does the trick for me to toggle the Digital Wellbeing's Grayscale tile.

Code: Select all

quickSettings();
sleep(500);
click("Grayscale");
Hope my post was helpful :D
Device: OnePlus 5T running crDroid, rooted with Magisk 8-)

yxd0018
Posts: 85
Joined: 05 Dec 2018 15:14

Re: grayscale tiles

Post by yxd0018 » 14 Jun 2019 10:35

Thanks. quicksettings() is inside controlUI. When I combined with app start/stop, the flow flips focus to the quick setting. When I close quick setting, app start trigger fires again, then quick setting again. Thus never get into the app. Should I disable the flow inside itself and enable strat flow in the stop flow?

EDIT: I wonder if there is a way to trigger controlUI away then back to the app without triggering app start trigger again.

Pepy
Posts: 76
Joined: 31 Oct 2018 10:53
Location: Canada

Re: grayscale tiles

Post by Pepy » 14 Jun 2019 21:21

If you want to exit out of quick settings and back into the app, just put an additional back() function into your Control UI script.
Hope my post was helpful :D
Device: OnePlus 5T running crDroid, rooted with Magisk 8-)

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

Re: grayscale tiles

Post by Desmanto » 15 Jun 2019 16:53

In oreo above, pulling down quick setting will trigger App Task Started SystemUI and App Task Ended for the last app. When you close the quick setting, it will trigger App Task Ended for SystemUI and App Task Started for the last app you have. Hence the flow got triggered again.

1. If you combine the trigger into the same flow and the Control UI doing the things is in the same flow too, you can simply use AEP - Skip. This will make sure when the flow is running,perfoming the Control UI and back to the app, App Task Started won't be trigger. Of course you have to add some sleep at the end of the flow, to make sure it is protected properly. See : viewtopic.php?f=3&t=6985
2. You can also protect the flow by separating the trigger App Task Start/stop to different flow. When executing the Control UI to the quick setting, disable the App task started flow first, then enabled it back after the Control UI finish. However, you will have to disable/enable the flow everytime it is running. Seems unnecessary.
3. Another method is to set a separate glovar as the state. Create a condition to check if global_cui_running == true. False, go to main branch; true, do nothing. When the flow first triggered, this is false, so it will continue to the main branch. set the global_cui_running to true, do all the stuff, then at the end of the flow set it back to false. When the same flow is running, if the flow trigger again during the first run, the value global_cui_running is still true, so it will continue to false branch, ended up doing nothing, protecting your main branch.

It seems the first solution is still the easiest. I just provide another solution as example if somehow you can't use the AEP - Skip for certain cases.
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.

yxd0018
Posts: 85
Joined: 05 Dec 2018 15:14

Re: grayscale tiles

Post by yxd0018 » 16 Jun 2019 13:59

Single back() only collapse the setting, but I managed to do it by combining back and sleep for 2 times. Thanks.
Pepy wrote:
14 Jun 2019 21:21
If you want to exit out of quick settings and back into the app, just put an additional back() function into your Control UI script.

yxd0018
Posts: 85
Joined: 05 Dec 2018 15:14

Re: grayscale tiles

Post by yxd0018 » 16 Jun 2019 14:29

I set AEP-skip in flow option and 2 back() to exit the quick setting (first back just collapse settings, 2nd after the sleep exit settings). I set app start/app stop trigger by the same app. But the quick setting was triggered 3- 6 times before finally stops. In the log, I saw start/stop get triggered multiple times. So I remove the stop trigger. With only start trigger, I still see quick setting get triggered multiple times. Considering I might switch to other apps (ex: browser for links) I gave up the idea of automating the greyscale, so this is just learning experience now. I wonder why AEP-skip didn't work.
My flow is attached.
flow_Greyscale_Mode_App[1].xml
(2.03 KiB) Downloaded 726 times

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

Re: grayscale tiles

Post by Desmanto » 16 Jun 2019 17:01

@yxd0018 : Try sleep(2000) at the end of the Control UI, instead of 500 only. It works at mine.
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