Custom Controls (2.2): Surfaceview and Surfaceholder

Source: Internet
Author: User
This example needs and procedures: The activity loads the custom Surfaceview-> Surfaceview constructor to start thread A, loops the x, y coordinates of the Surfaceview, and sets the fade flag bit picalphaflag to True when the x, Y coordinates go to a point- > surface is created as surfacecreated, thread B is started, and the loop draws the position of the graph in real time based on the Surfaceview x, y (changed by thread a), and fade another picture when Picalphaflag is true.
This example optimizes the point (personal Opinion): 1. Thread A and thread B can be merged;
This example revelation: 1. Surfaceview are usually used in custom; 2. Surfaceview typically have more than 1 sub-threads, performing time-consuming operations such as drawing, etc. 3. Surfaceview usually implements the Surfaceholder.callback interface, which is mainly used to manage the life cycle surfacecreated and surfacedestroyed; sample Demo

Custom Controls (2.2): Surfaceview and Surfaceholder

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.