Android Custom View

by keen
  • Android Custom View Tutorial (Part 1) – Combining Existing Views

    The Android framework has a large variety of View classes that cover many of the needs of a typical Android application. These views, along with the multitude of options for using drawable resources, make it possible to create complex user interfaces for Android applications...

  • Android Custom View Tutorial (Part 2) – Custom Attributes, Drawing, and Measuring

    Creating a fully custom view in Android involves both measuring and drawing the view. You accomplish this by overriding the corresponding methods in the View class: onMeasure and onDraw. Both of these tasks are simple in principle, but can involve some lengthy code. However, once you get over the initial learning curve, you will be creating custom views quickly and effectively...

  • Android Custom View Tutorial (Part 3) – Saving State

    As you will see, saving and restoring a view’s state takes a fair amount of work, so it is natural to wonder if it is worth the effort. Generally speaking, if a view’s state contains input from the user, then the best practice is to save its state. Take, for example, the built-in Android views TextView and EditText...

  • Android Custom View Tutorial (Part 4) – Animation

    In the last post, we talked about saving and restoring state of a custom view. We used the example application to demonstrate interaction between the two views that we have created: ValueSelector and ValueBar. More specifically...

  • Android Customization: How to Build a UI Component That Does What You Want

    It is not uncommon for developers to find themselves in need of a UI component that is either not provided by the platform they are targeting or is, indeed, provided, but lacks a certain property or behavior. The answer to both scenarios is a custom UI component...

  • android自定义view

    作为一个有创意的开发者,或者软件对UI设计的要求比较高,你经常会遇到安卓自带的控件无法满足你的需求的情况,这种时候,我们只能去自己去实现适合项目的控件。同时,安卓也允许你去继承已经存在的控件或者实现你自己的控件以便优化界面和创造更加丰富的用户体验。 那么怎样来创建一个新的控件呢?

  • android显示原理

    一句话来概括一下Android应用程序显示的过程:Android应用程序调用SurfaceFlinger服务把经过测量、布局和绘制后的Surface渲染到显示屏幕上...

  • Android中View绘制流程

    为整个View树计算实际的大小,即设置实际的高(对应属性:mMeasuredHeight)和宽(对应属性: mMeasureWidth),每个View的控件的实际宽高都是由父视图和本身视图决定的...

  • Android中View绘制流程以及invalidate()等相关方法分析

    整个View树的绘图流程是在ViewRoot.java类的performTraversals()函数展开的,该函数做的执行过程可简单概况为:根据之前设置的状态,判断是否需要重新计算视图大小(measure)、是否重新需要安置视图的位置(layout)、以及是否需要重绘,其框架...

  • Creating custom and compound Views in Android - Tutorial

    The Android framework provides several default views but developer can also create their custom views and use them in their application. The base class a view is the View...

  • custom layouts on android(自定义layout)

    If you ever built an Android app, you have definitely used some of the built-in layouts available in the platform—RelativeLayout, LinearLayout, FrameLayout, etc. They are our bread and butter for building Android UIs...

  • Custom UI for Android

    The Android Style and Theme system can be daunting to approach; this document is meant to be a introduction to the theme system, and is intended to help you define custom themes for use with the Social Login Android SDK...