Share and discuss your flows and ideas with other users.
Moderator: Martin
-
Martin
- Posts: 4468
- Joined: 09 Nov 2012 14:23
Post
by Martin » 03 Dec 2014 20:29
Hi,
While looking for a possibility to switch mobile data on Lollipop without root I stumbled on a way to show your own quick settings tile that allows to execute a flow in Automagic.
Requires root and Lollipop. Maybe it completely messes up the regular quick settings tiles/toggles. I've not checked if it can be completely reverted so it's only something you should do when you have a proper backup and factory reset is an option in the worst case. Use at your own risk etc...
How it looks:
- AutomagicQuickSetting.png (27.28 KiB) Viewed 34091 times
Here are the two required flows:
Flows (imports into flow group
Tile)
- ShowTile: modifies a system setting to show the default quick settings tiles plus your own tile. The last action in the flow configures the visibility, label and the broadcast intent to send when the tile is pressed.
The action Set System Setting needs to be verified after the import: open the flow ShowTile, edit action Set System Setting and check I have verified the setting, I know what I'm doing
- TileFlow: simple flow to execute when the tile is pressed. The broadcast action is defined in flow ShowTile above.
You can remove the system setting with action
Execute Root Command: settings delete secure sysui_qs_tiles. It seems that installing the Automagic tile also shows the Cast screen and Hotspot tiles, not sure if the tiles will go away again after the tiles are not used for some time.
Regards,
Martin
-
cimbrum
- Posts: 9
- Joined: 22 Jan 2014 15:27
-
Contact:
Post
by cimbrum » 17 Dec 2014 12:18
Nice! Thanks for sharing!
LE: Just tried it on latest Lollipop 5.0.1 on Nexus 5. "Flows ended with an error". Maybe there's some incompatibilities with the latest Android build.
-
Martin
- Posts: 4468
- Joined: 09 Nov 2012 14:23
Post
by Martin » 18 Dec 2014 19:40
Maybe action Set System Setting failed the verification. The action Set System Setting needs to be manually verified first after the flow is imported for security reasons otherwise it will fail with an error.
To do the verification, open the flow ShowTile, edit action Set System Setting and check I have verified the setting, I know what I'm doing and try to execute the flow again. Please send the log to me if the flow still fails (on the flowlist: menu->Manage->Log, menu->Send Log).
-
jadaag
- Posts: 17
- Joined: 24 Dec 2014 19:53
Post
by jadaag » 24 Dec 2014 19:58
After reverification of the set system settings working perfect on lollipop 5.0.1
What functions can I give to the quick settings tile??
Thnx
-
Martin
- Posts: 4468
- Joined: 09 Nov 2012 14:23
Post
by Martin » 29 Dec 2014 19:55
The tile executes the flow called 'TileFlow' so you can execute every action available in Automagic that you would like to use. For example to turn on/off auto sync, request a manual sync, connect to a specific bluetooth device etc.
The tile can be quite useful because it can be accessed also on the lock screen by swiping down from the top of the screen.
BTW: the last update of Automagic included a new extension that allows to set an arbitrary image in the tile. The image needs to be quite small, otherwise the intent will not work.
To set an image use an action Init Variable Image File, scale down the image with action Modify Image to approximately 300*300 and then replace putInt("iconId", 17301577); with putByteArray("iconBitmap", image_data); in the action Send Broadcast that's used to update the tile.
This mechanism could be useful to switch between two images when you implement a flow that acts like a toggle.
-
jadaag
- Posts: 17
- Joined: 24 Dec 2014 19:53
Post
by jadaag » 31 Dec 2014 12:05
Okay thnx for the info.. Appreciate it.
-
steelersmb
- Posts: 30
- Joined: 21 Oct 2013 21:27
Post
by steelersmb » 10 Jan 2015 13:07
So, just to confirm if I wanted to use an image. I would go and edit the Send Broadcast and under the Extras, I would do "Init Variable Image File, scale down the image with action Modify Image to approximately 300*300 " and then replace putInt("iconId", 17301577); with putByteArray("iconBitmap", image_data).
Thank you.
-
Martin
- Posts: 4468
- Joined: 09 Nov 2012 14:23
Post
by Martin » 12 Jan 2015 20:15
Here's an example flow called
ShowTile2 that can be used instead of the regular
ShowTile flow from before:
ShowTile2
The last action that's used to update the tile now uses the putByteArray-function:
Code: Select all
putBoolean("visible", true);
putString("label", "Automagic");
putString("onClickUri", "intent:#Intent;action=automagic.ACTION_1;end");
//putInt("iconId", 17301577);
putByteArray("iconBitmap", image_data);// <-- important line to add the image to the intent
//putString("iconPackage", "android");
-
jadaag
- Posts: 17
- Joined: 24 Dec 2014 19:53
Post
by jadaag » 13 Jan 2015 16:51
Is there a way to get more then one tile with different flows?
-
Martin
- Posts: 4468
- Joined: 09 Nov 2012 14:23
Post
by Martin » 13 Jan 2015 20:50
You can add more tiles by editing action Set System Setting to default,intent(automagic.TILE_1),intent(automagic.TILE_2).
The individual tiles can be visually modified by using either automagic.TILE_1 or automagic.TILE_2 in the action field of action Send Broadcast.
To execute another flow you would also have to use a different value for the onClickUri in the extras of the intent, for example ...;action=automagic.ACTION_2;... and also use automagic.ACTION_2 in the trigger of the second flow to execute.