Android View 源码解析(二)

来源:互联网 发布:网络大病众筹 编辑:程序博客网 时间:2024/06/07 13:27

民主万岁!

———-

共和万岁!

———-
我的上一篇博客就开始研究View的源码,上一篇主要把View的注释部分解释完,说实话,Google的工程师还是非常负责任的。代码写的非常严谨,而且可读性也是非常高。注释很全面,这是我以后要学习的啊。没想到大神写代码也是这么的一丝不苟。佩服佩服。
说是话这项工作的还是非常浩大的,记得以前看到view的源码也就是大概13000行,现在已经不知不觉的增加到21100行,这说明,大神们比我们还努力啊。生活不易啊,比我优秀的人,永远比我更努力。吾等屌丝简直没有活路了啊。

话不多说我们开始死磕。

我们先看一下view类的结构。

我们先不看View中的内部类和接口,而是先看它的继承关系和实现关系。

这里写图片描述

从结构上我们可以看到,view类实现了三个接口。
我们先看一下这三个接口 ,如下图所示。我们先不去管接口的实现。只是先讲类的结构。当然这也是一个学习方法。好了我们看他的属性。好在Google大神的注释都是非常齐全的要不然的话我看起来也是非常吃力的。在此还是再次感谢Google大神。开源万岁!

这里写图片描述

这里写图片描述

这里写图片描述

 /**     * The logging tag used by this class with android.util.Log.     * log的名字     */    protected static final String VIEW_LOG_TAG = "View";    /**     * When set to true, apps will draw debugging information about their layouts.     *当设置为true时,应用程序将绘制有关其布局的调试信息。     * @hide     */    public static final String DEBUG_LAYOUT_PROPERTY = "debug.layout";    /**     * When set to true, this view will save its attribute data.     * 当设置为true时,View将保存其属性数据     * @hide     */    public static boolean mDebugViewAttributes = false;    /**     * Used to mark a View that has no ID.     * 标记没有Id的View     */    public static final int NO_ID = -1;    /**     * Signals that compatibility booleans have been initialized according to     * target SDK versions.     * 根据当前初始化的version 给出合适的boolean     */    private static boolean sCompatibilityDone = false;    /**     * Use the old (broken) way of building MeasureSpecs.     * 使用旧的)方法建立MeasureSpecs。     */    private static boolean sUseBrokenMakeMeasureSpec = false;    /**     * Ignore any optimizations using the measure cache.     * 忽略测量优化     */    private static boolean sIgnoreMeasureCache = false;    /**     * This view does not want keystrokes. Use with TAKES_FOCUS_MASK when     * calling setFlags.     *  当前view不想要任何的按键操作使用TAKES_FOCUS_MASK 调用这个标记     */    private static final int NOT_FOCUSABLE = 0x00000000;    /**     * This view wants keystrokes. Use with TAKES_FOCUS_MASK when calling     * setFlags.     * 当前view想要按键操作使用TAKES_FOCUS_MASK 调用这个标记     */    private static final int FOCUSABLE = 0x00000001;    /**     * Mask for use with setFlags indicating bits used for focus.     * 表名有焦点的标志位     */    private static final int FOCUSABLE_MASK = 0x00000001;    /**     * This view will adjust its padding to fit sytem windows (e.g. status bar)     * view将根据系统window改变     */    private static final int FITS_SYSTEM_WINDOWS = 0x00000002;    /*    * VISIBLE    *INVISIBLE    *GONE    * 资源    /    /** @hide */    @IntDef({VISIBLE, INVISIBLE, GONE})    @Retention(RetentionPolicy.SOURCE)    public @interface Visibility {}    /**     * This view is visible.     * Use with {@link #setVisibility} and <a href="#attr_android:visibility">{@code     * android:visibility}.     */    public static final int VISIBLE = 0x00000000;    /**     * This view is invisible, but it still takes up space for layout purposes.     * Use with {@link #setVisibility} and <a href="#attr_android:visibility">{@code     * android:visibility}.     */    public static final int INVISIBLE = 0x00000004;    /**     * This view is invisible, and it doesn't take any space for layout     * purposes. Use with {@link #setVisibility} and <a href="#attr_android:visibility">{@code     * android:visibility}.     */    public static final int GONE = 0x00000008;    /**     * Mask for use with setFlags indicating bits used for visibility.     * {@hide}     */    static final int VISIBILITY_MASK = 0x0000000C;    private static final int[] VISIBILITY_FLAGS = {VISIBLE, INVISIBLE, GONE};    /**     * This view is enabled. Interpretation varies by subclass.     * Use with ENABLED_MASK when calling setFlags.     * {@hide}     */    static final int ENABLED = 0x00000000;    /**     * This view is disabled. Interpretation varies by subclass.     * Use with ENABLED_MASK when calling setFlags.     * {@hide}     */    static final int DISABLED = 0x00000020;   /**    * Mask for use with setFlags indicating bits used for indicating whether    * this view is enabled    * {@hide}    */    static final int ENABLED_MASK = 0x00000020;    /**     * This view won't draw. {@link #onDraw(android.graphics.Canvas)} won't be     * called and further optimizations will be performed. It is okay to have     * this flag set and a background. Use with DRAW_MASK when calling setFlags.     * {@hide}     */    static final int WILL_NOT_DRAW = 0x00000080;    /**     * Mask for use with setFlags indicating bits used for indicating whether     * this view is will draw     * {@hide}     */    static final int DRAW_MASK = 0x00000080;    /**     * <p>This view doesn't show scrollbars.</p>     * {@hide}     */    static final int SCROLLBARS_NONE = 0x00000000;    /**     * <p>This view shows horizontal scrollbars.</p>     * {@hide}     */    static final int SCROLLBARS_HORIZONTAL = 0x00000100;    /**     * <p>This view shows vertical scrollbars.</p>     * {@hide}     */    static final int SCROLLBARS_VERTICAL = 0x00000200;    /**     * <p>Mask for use with setFlags indicating bits used for indicating which     * scrollbars are enabled.</p>     * {@hide}     */    static final int SCROLLBARS_MASK = 0x00000300;    /**     * Indicates that the view should filter touches when its window is obscured.     * Refer to the class comments for more information about this security feature.     * {@hide}     */    static final int FILTER_TOUCHES_WHEN_OBSCURED = 0x00000400;    /**     * Set for framework elements that use FITS_SYSTEM_WINDOWS, to indicate     * that they are optional and should be skipped if the window has     * requested system UI flags that ignore those insets for layout.     */    static final int OPTIONAL_FITS_SYSTEM_WINDOWS = 0x00000800;    /**     * <p>This view doesn't show fading edges.</p>     * {@hide}     */    static final int FADING_EDGE_NONE = 0x00000000;    /**     * <p>This view shows horizontal fading edges.</p>     * {@hide}     */    static final int FADING_EDGE_HORIZONTAL = 0x00001000;    /**     * <p>This view shows vertical fading edges.</p>     * {@hide}     */    static final int FADING_EDGE_VERTICAL = 0x00002000;    /**     * <p>Mask for use with setFlags indicating bits used for indicating which     * fading edges are enabled.</p>     * {@hide}     */    static final int FADING_EDGE_MASK = 0x00003000;    /**     * <p>Indicates this view can be clicked. When clickable, a View reacts     * to clicks by notifying the OnClickListener.<p>     * {@hide}     */    static final int CLICKABLE = 0x00004000;    /**     * <p>Indicates this view is caching its drawing into a bitmap.</p>     * {@hide}     */    static final int DRAWING_CACHE_ENABLED = 0x00008000;    /**     * <p>Indicates that no icicle should be saved for this view.<p>     * {@hide}     */    static final int SAVE_DISABLED = 0x000010000;    /**     * <p>Mask for use with setFlags indicating bits used for the saveEnabled     * property.</p>     * {@hide}     */    static final int SAVE_DISABLED_MASK = 0x000010000;    /**     * <p>Indicates that no drawing cache should ever be created for this view.<p>     * {@hide}     */    static final int WILL_NOT_CACHE_DRAWING = 0x000020000;    /**     * <p>Indicates this view can take / keep focus when int touch mode.</p>     * {@hide}     */    static final int FOCUSABLE_IN_TOUCH_MODE = 0x00040000;    /** @hide */    @Retention(RetentionPolicy.SOURCE)    @IntDef({DRAWING_CACHE_QUALITY_LOW, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_AUTO})    public @interface DrawingCacheQuality {}    /**     * <p>Enables low quality mode for the drawing cache.</p>     */    public static final int DRAWING_CACHE_QUALITY_LOW = 0x00080000;    /**     * <p>Enables high quality mode for the drawing cache.</p>     */    public static final int DRAWING_CACHE_QUALITY_HIGH = 0x00100000;    /**     * <p>Enables automatic quality mode for the drawing cache.</p>     */    public static final int DRAWING_CACHE_QUALITY_AUTO = 0x00000000;    private static final int[] DRAWING_CACHE_QUALITY_FLAGS = {            DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_LOW, DRAWING_CACHE_QUALITY_HIGH    };    /**     * <p>Mask for use with setFlags indicating bits used for the cache     * quality property.</p>     * {@hide}     */    static final int DRAWING_CACHE_QUALITY_MASK = 0x00180000;    /**     * <p>     * Indicates this view can be long clicked. When long clickable, a View     * reacts to long clicks by notifying the OnLongClickListener or showing a     * context menu.     * </p>     * {@hide}     */    static final int LONG_CLICKABLE = 0x00200000;    /**     * <p>Indicates that this view gets its drawable states from its direct parent     * and ignores its original internal states.</p>     *     * @hide     */    static final int DUPLICATE_PARENT_STATE = 0x00400000;    /** @hide */    @IntDef({        SCROLLBARS_INSIDE_OVERLAY,        SCROLLBARS_INSIDE_INSET,        SCROLLBARS_OUTSIDE_OVERLAY,        SCROLLBARS_OUTSIDE_INSET    })    @Retention(RetentionPolicy.SOURCE)    public @interface ScrollBarStyle {}    /**     * The scrollbar style to display the scrollbars inside the content area,     * without increasing the padding. The scrollbars will be overlaid with     * translucency on the view's content.     */    public static final int SCROLLBARS_INSIDE_OVERLAY = 0;    /**     * The scrollbar style to display the scrollbars inside the padded area,     * increasing the padding of the view. The scrollbars will not overlap the     * content area of the view.     */    public static final int SCROLLBARS_INSIDE_INSET = 0x01000000;    /**     * The scrollbar style to display the scrollbars at the edge of the view,     * without increasing the padding. The scrollbars will be overlaid with     * translucency.     */    public static final int SCROLLBARS_OUTSIDE_OVERLAY = 0x02000000;    /**     * The scrollbar style to display the scrollbars at the edge of the view,     * increasing the padding of the view. The scrollbars will only overlap the     * background, if any.     */    public static final int SCROLLBARS_OUTSIDE_INSET = 0x03000000;    /**     * Mask to check if the scrollbar style is overlay or inset.     * {@hide}     */    static final int SCROLLBARS_INSET_MASK = 0x01000000;    /**     * Mask to check if the scrollbar style is inside or outside.     * {@hide}     */    static final int SCROLLBARS_OUTSIDE_MASK = 0x02000000;    /**     * Mask for scrollbar style.     * {@hide}     */    static final int SCROLLBARS_STYLE_MASK = 0x03000000;    /**     * View flag indicating that the screen should remain on while the     * window containing this view is visible to the user.  This effectively     * takes care of automatically setting the WindowManager's     * {@link WindowManager.LayoutParams#FLAG_KEEP_SCREEN_ON}.     */    public static final int KEEP_SCREEN_ON = 0x04000000;    /**     * View flag indicating whether this view should have sound effects enabled     * for events such as clicking and touching.     */    public static final int SOUND_EFFECTS_ENABLED = 0x08000000;    /**     * View flag indicating whether this view should have haptic feedback     * enabled for events such as long presses.     */    public static final int HAPTIC_FEEDBACK_ENABLED = 0x10000000;    /**     * <p>Indicates that the view hierarchy should stop saving state when     * it reaches this view.  If state saving is initiated immediately at     * the view, it will be allowed.     * {@hide}     */    static final int PARENT_SAVE_DISABLED = 0x20000000;    /**     * <p>Mask for use with setFlags indicating bits used for PARENT_SAVE_DISABLED.</p>     * {@hide}     */    static final int PARENT_SAVE_DISABLED_MASK = 0x20000000;    /** @hide */    @IntDef(flag = true,            value = {                FOCUSABLES_ALL,                FOCUSABLES_TOUCH_MODE            })    @Retention(RetentionPolicy.SOURCE)    public @interface FocusableMode {}    /**     * View flag indicating whether {@link #addFocusables(ArrayList, int, int)}     * should add all focusable Views regardless if they are focusable in touch mode.     */    public static final int FOCUSABLES_ALL = 0x00000000;    /**     * View flag indicating whether {@link #addFocusables(ArrayList, int, int)}     * should add only Views focusable in touch mode.     */    public static final int FOCUSABLES_TOUCH_MODE = 0x00000001;    /** @hide */    @IntDef({            FOCUS_BACKWARD,            FOCUS_FORWARD,            FOCUS_LEFT,            FOCUS_UP,            FOCUS_RIGHT,            FOCUS_DOWN    })    @Retention(RetentionPolicy.SOURCE)    public @interface FocusDirection {}    /** @hide */    @IntDef({            FOCUS_LEFT,            FOCUS_UP,            FOCUS_RIGHT,            FOCUS_DOWN    })    @Retention(RetentionPolicy.SOURCE)    public @interface FocusRealDirection {} // Like @FocusDirection, but without forward/backward    /**     * Use with {@link #focusSearch(int)}. Move focus to the previous selectable     * item.     */    public static final int FOCUS_BACKWARD = 0x00000001;    /**     * Use with {@link #focusSearch(int)}. Move focus to the next selectable     * item.     */    public static final int FOCUS_FORWARD = 0x00000002;    /**     * Use with {@link #focusSearch(int)}. Move focus to the left.     */    public static final int FOCUS_LEFT = 0x00000011;    /**     * Use with {@link #focusSearch(int)}. Move focus up.     */    public static final int FOCUS_UP = 0x00000021;    /**     * Use with {@link #focusSearch(int)}. Move focus to the right.     */    public static final int FOCUS_RIGHT = 0x00000042;    /**     * Use with {@link #focusSearch(int)}. Move focus down.     */    public static final int FOCUS_DOWN = 0x00000082;    /**     * Bits of {@link #getMeasuredWidthAndState()} and     * {@link #getMeasuredWidthAndState()} that provide the actual measured size.     */    public static final int MEASURED_SIZE_MASK = 0x00ffffff;    /**     * Bits of {@link #getMeasuredWidthAndState()} and     * {@link #getMeasuredWidthAndState()} that provide the additional state bits.     */    public static final int MEASURED_STATE_MASK = 0xff000000;    /**     * Bit shift of {@link #MEASURED_STATE_MASK} to get to the height bits     * for functions that combine both width and height into a single int,     * such as {@link #getMeasuredState()} and the childState argument of     * {@link #resolveSizeAndState(int, int, int)}.     */    public static final int MEASURED_HEIGHT_STATE_SHIFT = 16;    /**     * Bit of {@link #getMeasuredWidthAndState()} and     * {@link #getMeasuredWidthAndState()} that indicates the measured size     * is smaller that the space the view would like to have.     */    public static final int MEASURED_STATE_TOO_SMALL = 0x01000000;    /**     * Base View state sets     */    // Singles    /**     * Indicates the view has no states set. States are used with     * {@link android.graphics.drawable.Drawable} to change the drawing of the     * view depending on its state.     *     * @see android.graphics.drawable.Drawable     * @see #getDrawableState()     */    protected static final int[] EMPTY_STATE_SET;    /**     * Indicates the view is enabled. States are used with     * {@link android.graphics.drawable.Drawable} to change the drawing of the     * view depending on its state.     *     * @see android.graphics.drawable.Drawable     * @see #getDrawableState()     */    protected static final int[] ENABLED_STATE_SET;    /**     * Indicates the view is focused. States are used with     * {@link android.graphics.drawable.Drawable} to change the drawing of the     * view depending on its state.     *     * @see android.graphics.drawable.Drawable     * @see #getDrawableState()     */    protected static final int[] FOCUSED_STATE_SET;    /**     * Indicates the view is selected. States are used with     * {@link android.graphics.drawable.Drawable} to change the drawing of the     * view depending on its state.     *     * @see android.graphics.drawable.Drawable     * @see #getDrawableState()     */    protected static final int[] SELECTED_STATE_SET;    /**     * Indicates the view is pressed. States are used with     * {@link android.graphics.drawable.Drawable} to change the drawing of the     * view depending on its state.     *     * @see android.graphics.drawable.Drawable     * @see #getDrawableState()     */    protected static final int[] PRESSED_STATE_SET;    /**     * Indicates the view's window has focus. States are used with     * {@link android.graphics.drawable.Drawable} to change the drawing of the     * view depending on its state.     *     * @see android.graphics.drawable.Drawable     * @see #getDrawableState()     */    protected static final int[] WINDOW_FOCUSED_STATE_SET;    // Doubles    /**     * Indicates the view is enabled and has the focus.     *     * @see #ENABLED_STATE_SET     * @see #FOCUSED_STATE_SET     */    protected static final int[] ENABLED_FOCUSED_STATE_SET;    /**     * Indicates the view is enabled and selected.     *     * @see #ENABLED_STATE_SET     * @see #SELECTED_STATE_SET     */    protected static final int[] ENABLED_SELECTED_STATE_SET;    /**     * Indicates the view is enabled and that its window has focus.     *     * @see #ENABLED_STATE_SET     * @see #WINDOW_FOCUSED_STATE_SET     */    protected static final int[] ENABLED_WINDOW_FOCUSED_STATE_SET;    /**     * Indicates the view is focused and selected.     *     * @see #FOCUSED_STATE_SET     * @see #SELECTED_STATE_SET     */    protected static final int[] FOCUSED_SELECTED_STATE_SET;    /**     * Indicates the view has the focus and that its window has the focus.     *     * @see #FOCUSED_STATE_SET     * @see #WINDOW_FOCUSED_STATE_SET     */    protected static final int[] FOCUSED_WINDOW_FOCUSED_STATE_SET;    /**     * Indicates the view is selected and that its window has the focus.     *     * @see #SELECTED_STATE_SET     * @see #WINDOW_FOCUSED_STATE_SET     */    protected static final int[] SELECTED_WINDOW_FOCUSED_STATE_SET;    // Triples    /**     * Indicates the view is enabled, focused and selected.     *     * @see #ENABLED_STATE_SET     * @see #FOCUSED_STATE_SET     * @see #SELECTED_STATE_SET     */    protected static final int[] ENABLED_FOCUSED_SELECTED_STATE_SET;    /**     * Indicates the view is enabled, focused and its window has the focus.     *     * @see #ENABLED_STATE_SET     * @see #FOCUSED_STATE_SET     * @see #WINDOW_FOCUSED_STATE_SET     */    protected static final int[] ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET;    /**     * Indicates the view is enabled, selected and its window has the focus.     *     * @see #ENABLED_STATE_SET     * @see #SELECTED_STATE_SET     * @see #WINDOW_FOCUSED_STATE_SET     */    protected static final int[] ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET;    /**     * Indicates the view is focused, selected and its window has the focus.     *     * @see #FOCUSED_STATE_SET     * @see #SELECTED_STATE_SET     * @see #WINDOW_FOCUSED_STATE_SET     */    protected static final int[] FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET;    /**     * Indicates the view is enabled, focused, selected and its window     * has the focus.     *     * @see #ENABLED_STATE_SET     * @see #FOCUSED_STATE_SET     * @see #SELECTED_STATE_SET     * @see #WINDOW_FOCUSED_STATE_SET     */    protected static final int[] ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET;    /**     * Indicates the view is pressed and its window has the focus.     *     * @see #PRESSED_STATE_SET     * @see #WINDOW_FOCUSED_STATE_SET     */    protected static final int[] PRESSED_WINDOW_FOCUSED_STATE_SET;    /**     * Indicates the view is pressed and selected.     *     * @see #PRESSED_STATE_SET     * @see #SELECTED_STATE_SET     */    protected static final int[] PRESSED_SELECTED_STATE_SET;    /**     * Indicates the view is pressed, selected and its window has the focus.     *     * @see #PRESSED_STATE_SET     * @see #SELECTED_STATE_SET     * @see #WINDOW_FOCUSED_STATE_SET     */    protected static final int[] PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET;    /**     * Indicates the view is pressed and focused.     *     * @see #PRESSED_STATE_SET     * @see #FOCUSED_STATE_SET     */    protected static final int[] PRESSED_FOCUSED_STATE_SET;    /**     * Indicates the view is pressed, focused and its window has the focus.     *     * @see #PRESSED_STATE_SET     * @see #FOCUSED_STATE_SET     * @see #WINDOW_FOCUSED_STATE_SET     */    protected static final int[] PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET;    /**     * Indicates the view is pressed, focused and selected.     *     * @see #PRESSED_STATE_SET     * @see #SELECTED_STATE_SET     * @see #FOCUSED_STATE_SET     */    protected static final int[] PRESSED_FOCUSED_SELECTED_STATE_SET;    /**     * Indicates the view is pressed, focused, selected and its window has the focus.     *     * @see #PRESSED_STATE_SET     * @see #FOCUSED_STATE_SET     * @see #SELECTED_STATE_SET     * @see #WINDOW_FOCUSED_STATE_SET     */    protected static final int[] PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET;    /**     * Indicates the view is pressed and enabled.     *     * @see #PRESSED_STATE_SET     * @see #ENABLED_STATE_SET     */    protected static final int[] PRESSED_ENABLED_STATE_SET;    /**     * Indicates the view is pressed, enabled and its window has the focus.     *     * @see #PRESSED_STATE_SET     * @see #ENABLED_STATE_SET     * @see #WINDOW_FOCUSED_STATE_SET     */    protected static final int[] PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET;    /**     * Indicates the view is pressed, enabled and selected.     *     * @see #PRESSED_STATE_SET     * @see #ENABLED_STATE_SET     * @see #SELECTED_STATE_SET     */    protected static final int[] PRESSED_ENABLED_SELECTED_STATE_SET;    /**     * Indicates the view is pressed, enabled, selected and its window has the     * focus.     *     * @see #PRESSED_STATE_SET     * @see #ENABLED_STATE_SET     * @see #SELECTED_STATE_SET     * @see #WINDOW_FOCUSED_STATE_SET     */    protected static final int[] PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET;    /**     * Indicates the view is pressed, enabled and focused.     *     * @see #PRESSED_STATE_SET     * @see #ENABLED_STATE_SET     * @see #FOCUSED_STATE_SET     */    protected static final int[] PRESSED_ENABLED_FOCUSED_STATE_SET;    /**     * Indicates the view is pressed, enabled, focused and its window has the     * focus.     *     * @see #PRESSED_STATE_SET     * @see #ENABLED_STATE_SET     * @see #FOCUSED_STATE_SET     * @see #WINDOW_FOCUSED_STATE_SET     */    protected static final int[] PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET;    /**     * Indicates the view is pressed, enabled, focused and selected.     *     * @see #PRESSED_STATE_SET     * @see #ENABLED_STATE_SET     * @see #SELECTED_STATE_SET     * @see #FOCUSED_STATE_SET     */    protected static final int[] PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET;    /**     * Indicates the view is pressed, enabled, focused, selected and its window     * has the focus.     *     * @see #PRESSED_STATE_SET     * @see #ENABLED_STATE_SET     * @see #SELECTED_STATE_SET     * @see #FOCUSED_STATE_SET     * @see #WINDOW_FOCUSED_STATE_SET     */    protected static final int[] PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET;    /**     * The order here is very important to {@link #getDrawableState()}     */    private static final int[][] VIEW_STATE_SETS;    static final int VIEW_STATE_WINDOW_FOCUSED = 1;    static final int VIEW_STATE_SELECTED = 1 << 1;    static final int VIEW_STATE_FOCUSED = 1 << 2;    static final int VIEW_STATE_ENABLED = 1 << 3;    static final int VIEW_STATE_PRESSED = 1 << 4;    static final int VIEW_STATE_ACTIVATED = 1 << 5;    static final int VIEW_STATE_ACCELERATED = 1 << 6;    static final int VIEW_STATE_HOVERED = 1 << 7;    static final int VIEW_STATE_DRAG_CAN_ACCEPT = 1 << 8;    static final int VIEW_STATE_DRAG_HOVERED = 1 << 9;
0 0
原创粉丝点击