开发者

Android: implementing sliding cards in widget

I have a widget t开发者_高级运维hat periodically updates itself (hourly) to display top result of search query. I would like to extend it so it captures several top results and then loops through these. The best example would be Genie News and Weather widget for which I was unable to find a source code.

QUESTIONS:

  1. What would be a good way to implement the animation? I'm thinking ViewAnimator + timer, but is there maybe a better way, say FrameLayout + alerts? I'm already using AlertManager to periodically pull search results for the widget
  2. How bad such arraignment would affect phone's battery life?


You cannot animate an app widget by any conventional means. Anything that appears animated is either:

  1. Part of the actual home screen application, so there is no inter-process communication and therefore involves much less overhead
  2. Eating batteries for lunch, by posting new RemoteViews for the app widget every second or so
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜