4.2 daydream

Source: Internet
Author: User

Daydream implementation

Daydream is implemented through the Android. Service. Dreams. dreamservice subclass. The following are some key methods:

  • Onattachedtowindow (): initial settings
  • Ondreamingstarted (): Start animation and Timer
  • Ondreamingstopped (): stops an animation.
  • Ondetachedfromwindow (): Clears Everything you build in onattachedtowindow ().

Some important methods that may be called:

  • Setcontentview (): Set the daydream scenario
  • Setinteractive (Boolean): by default, daydream exits when you touch it. If you want to interact with users, call setinteractive (true)
  • Setfullscreen (Boolean): hides the status bar
  • Setscreenbright (Boolean): by default, daydream is in full brightness mode. Setting it to false will reduce the screen brightness.

Details: Daydream: interactive screen savers

Documents and examples:

  • Documentation: dreamservice API
  • ExampleCode: Bouncerdaydream, a jumping little green man in Android
  • Sample Code: webview, which displays an HTML page
  • Example code: colors: demonstrate OpenGL ES 2.0 and textureview

Original article address

Http://www.iteye.com/news/26872

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.