Access custom widgets

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
bogdyro
Posts: 241
Joined: 04 Apr 2015 15:14

Access custom widgets

Post by bogdyro » 27 Apr 2016 03:59

Hi Martin. I've been using custom widgets alot lately and I think that accessing the widgets list should be easier.
I was thinking that you could do some kind of overlaying buttons when in the flows list to go straight to the list of widgets and the other way around. Maybe a menubar at the bottom with additional commands. I dont know how hard it would be to modify the interface right now though.
I've attached a picture. U can see the red button on the bottom right
Thanks
Attachments
Screenshot_20160427-065810.png
Screenshot_20160427-065810.png (392.97 KiB) Viewed 9415 times

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

Re: Access custom widgets

Post by Martin » 28 Apr 2016 18:40

Adding such a button or a command bar or even a menu item to switch to the widget list should be doable.
Unofficially you could use action Start Activity with explizit component package set to automagic and class name set to ch.gridvision.ppam.androidautomagic.WidgetListActivity.

Do you eventually want to open one particular widget and switch from a flow to this particular widget and back again? I could also add an open widget button for actions Show/Hide Custom Widget Overlay like it's available to open flows for action Execute Flows. Would that also help or is the flow and the widget not directly related?

Regards,
Martin

bogdyro
Posts: 241
Joined: 04 Apr 2015 15:14

Re: Access custom widgets

Post by bogdyro » 28 Apr 2016 19:27

Hi Martin. I was thinking about making my own custom widget with a command to get to the widgets list. How can I reliably detect that I have the flows list showing on-screen ?
Of course, making a shortcut from action show overlay to the widget would also be great.
If anyone else has any ideeas about this..

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: Access custom widgets

Post by MURTUMA » 29 Apr 2016 05:33

Use trigger Activity started, package name: "ch.gridvision.ppam.androidautomagic", class name: "*".

Condition: Expression, activity_class == "ch.gridvision.ppam.androidautomagic.FlowListActivity"
>TRUE: Action Script, global_list = "true"
>FALSE: Action Script, global_list = "false"


That flow check which activity is active in AM and sets the variable to "true" if you are in the flow list, otherwise to "false". This method is quite reliable although it can become a pain to configure, if you want to check more than one activity and set their own values to the variable.

EDIT: It just occurred to me that you can skip the condition and following scripts and do it all just in one action script. It depends on the use case, which method is best, but I think you could do it with the latter. Also, it's easier to configure for multiple activities as you don't have to make a large or else tree with expression.

Locked