emailsurajk / dashclock

Automatically exported from code.google.com/p/dashclock
0 stars 0 forks source link

Add extension callbacks for when DashClock is visible and not visible #340

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It would be great for extensions to receive callbacks that signal when the 
DashClock widget is visible and not visible. Extensions could use this 
information to start/stop any rapid updates to DashClock to keep extension 
information up-to-date as well as conserve battery life.

Possibly named onResume and onPause.

Original issue reported on code.google.com by grantlan...@gmail.com on 6 Mar 2013 at 7:23

GoogleCodeExporter commented 8 years ago
Sadly there's no way to know when the widget is visible/invisible; the widget 
framework doesn't really support this :-/ I suppose there are [unreliable] 
hacks for lock screen widgets, but nothing really for home screen widgets AFAIK.

Original comment by roman.nurik on 6 Mar 2013 at 1:37

GoogleCodeExporter commented 8 years ago
Do home screen/lock screen widgets not receive onAttachedToWindow() and 
onDetachedToWindow() calls?

Original comment by grantlan...@gmail.com on 7 Mar 2013 at 7:47

GoogleCodeExporter commented 8 years ago
No, and either way they're not dynamically attached and detached to their host. 
Since they're RemoteViews, they have an entirely different lifecycle.

Original comment by roman.nurik on 7 Mar 2013 at 2:08