Widget clickables

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

Moderator: Martin

Locked
lchiocca
Posts: 69
Joined: 15 Aug 2013 10:11

Widget clickables

Post by lchiocca » 11 Mar 2014 13:06

Hi Martin,

I searched the forum for a similar request, but didn't find any.

My first request: Right now each widget has a grid of clickable actions that are defined "globally". This is good enough for some simple widgets. What I'm currently doing is a lock screen widget that shows me a couple of vital stats and a couple of buttons (actually rectangles right now). Due to some really nice layouting the action grid cannot be superimposed on top of the "buttons". Would it be possible to have a more finer grained action control? As an example: a rectangle definition has a couple of attribute groups (bounds, rectangle, fill, outline). There could be an additional group "action" that would override the widget's default click actions.

My second request is a minor one... for rectangles and ellipses, you can define a fill color. Would it be possible to specify a background image that is cropped within the object's boudaries?

Thanks
Loris

PaulyQ
Posts: 29
Joined: 18 Oct 2013 20:36

Re: Widget clickables

Post by PaulyQ » 12 Mar 2014 19:06

+1

lchiocca
Posts: 69
Joined: 15 Aug 2013 10:11

Re: Widget clickables

Post by lchiocca » 14 Mar 2014 07:10

@PaulyQ

"+1" for the better widget actions or "+1" for the background image in rectangles and elipses? ;)

lchiocca
Posts: 69
Joined: 15 Aug 2013 10:11

Re: Widget clickables

Post by lchiocca » 19 Mar 2014 10:36

Martin, what's you view?

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

Re: Widget clickables

Post by Martin » 19 Mar 2014 17:14

The first request is not easy to implement respectively I have not yet found a solution that works across different launchers reliably so I fear that this won't be added anytime soon.

Images as backgrounds in rectangles and ellipses should be possible to implement so I've added it to my todo-list (which is quite long so it might take some time until this feature becomes available).

lchiocca
Posts: 69
Joined: 15 Aug 2013 10:11

Re: Widget clickables

Post by lchiocca » 20 Mar 2014 12:27

Hi Martin,

Thanks for responding... I don't quite get what you mean with the launcher. I tried to look at how you're building up your views but since you've obfuscated the code, it's a bit harder. But this is what I was thinking of:
At some stage you need to define a widget layout. You've probably got a GridLayout at some stage for the "touchable" parts. What I was thinking of was to simply add event handlers to the individual controls of the widget and not just let the GridLayout handle the events. If the GridLayout wasn't there to catch the events, they would eventually go down to the actual objects and they could handle the event based on whatever definition was defined.

By the way, I don't know if it's a topic or not, but I'm happy to donate a bit of swissies for this feature. I mean: 3.50Fr for your app is basically free :). And if you don't want a donation, I'll be more than happy to help you code/test this feature.

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

Re: Widget clickables

Post by Martin » 20 Mar 2014 18:20

Hi,

The widget content itself is based on one single image, no views at all (respectively one single ImageView) so it's not that simple to attach an intent to one of the graphical elements and Android does not send the click coordinates within the image element to Automagic. Basing the widget on an image has the advantage that it can be scaled properly on different launchers and can be imported on different devices and look the same, even when the launcher uses a different size/aspect ratio of the widget cell.
I considered using real views at the time when I initially wrote the custom widget support but this has also some disadvantages and there have been some bugs in Android that made this too complicated.

Regards,
Martin

lchiocca
Posts: 69
Joined: 15 Aug 2013 10:11

Re: Widget clickables

Post by lchiocca » 24 Mar 2014 10:34

Ah... I see... that's is the reason you can't do scrollable widget ;). What you could do is "paint" a second image with the component that was painted last... kind of a z-image but with ref's to the top-most component. That way you can very easily simulate the "component event".

Rethinking about my main problem (I've visually drawing buttons but then clickable area doesn't fit), I've come to the conclusion that I don't really need a full-fledged component clicking. If the clickable area was a bit more relaxed in the structure, then I could do it very easily. If you could add "spacer" elements in the action grid, then that would actually solve my issue. And there wouldn't be too much to change.

Locked