Custom view, ViewGroup theory basics in Android

Source: Internet
Author: User

Android itself offers many widgets, but sometimes these widgets do not meet our needs, then we need to customize the view, this article will detail the various theoretical basis of custom view, only to understand this knowledge, we can better implement the various functions of the control.

I think the most important part of the custom view is drawing and interacting, the custom drawing makes your view unique, the interaction allows the user to interact with your view, and the drawing is based on the acreage and layout of the view, and the interaction is the basis of the touch event, so acreage, layout, drawing, Touch events These are the cores of custom view.

In addition to this, a design-friendly custom view should also be able to define attributes in XML like a widget that comes with Android, which is also described in this article.

    • Overview of acreage, layout and drawing mechanism
      Acreage, layout and plotting mechanism of view in Android

    • Measurement
      Source code to resolve the measure acreage process in Android view

    • Layout
      Source code to interpret the layout of view in Android

    • Drawing
      The basics of canvas drawing in Android (with source download)
      Porterduffxfermode use and working principle of canvas drawing in Android
      Shader of canvas drawing in Android using graphic
      Android Canvas Drawing Maskfilter text detailed (with source download)
      GPU hardware acceleration control in Android and its limitations on 2D graphics rendering
      Graphic detail Andorid with shape definition gradientdrawable

    • Touch events
      Motionevent in Android
      TouchEvent Touch event mechanism in Android

    • Defining XML Properties
      Android View custom XML properties in detail and the difference between r.attr and r.styleable

I hope this article will be helpful to you, and you'll write more articles about custom view instances later.

Related reading:
My Android Blog Finishing summary

Custom view, ViewGroup theory basics in Android

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.