Page 1 of 1

Overlay widget improvement

Posted: 21 Nov 2015 11:44
by MURTUMA
I use an overlay widget which covers entire screen. Currently I have to create two different widgets to both portrait and landscape orientations. The small problem here is that the widget flashes off quickly when changing phones orientation as the widget changes to another. This could be prevented by using the same widget for both orientations. My screen resolution is 480x800 so the widget would be 800x800.

It is omportant that the widget would be centered so that x-offset would be -240. That, however is impossible currently. The widget can go nicely off screen on the right and down if it is too big for the screen, but this should be possible for the left and up too by using negative offsets.

Also, if I could use only one widget, it would be much less of a hassle to maintain than two identical widgets for both orientations. And like I said, it would eliminate the small visual annoyance by preventing the widget to flash off briefly.

EDIT: It seems like the offset values are ignored completely when the overlay widget is same size or bigger as screen resolution which is inconvenient in some cases.

Re: Overlay widget improvement

Posted: 09 Jan 2016 08:53
by MURTUMA
What do you think, Martin? Would it be feasible to allow achorpoint to be located off screen?

Re: Overlay widget improvement

Posted: 09 Jan 2016 19:32
by Martin
I have not looked into this yet. The offsets and gravity are passed as is directly to the window manager of Android so I think it might require quite a hack to make the offsets for an oversized widget work.
Do you use the same overlay name in the two actions Show Custom Widget Overlay? Maybe you could avoid the flickering by using the same overlay name and by only using the Show-action when the orientation changes (Don't hide the old one). Automagic replaces the overlay with the new values when an overlay with the same name is already showing.

Re: Overlay widget improvement

Posted: 10 Jan 2016 16:49
by MURTUMA
That's how I'm doing it. In optimal situation it works but if I have a cpu demanding app running at the time, nothing helps.