Theme、Style、attr、declare-styleable

 

Theme或者Style中(或者说Android中其他xml资源使用的属性)的属性都是一样的,首先都需要定义<attr name="" format="reference|dimension|color|boolean|float|integer|fraction"/>。可以在单独一个attr中定义,也可以一个<declare-styleable/>tag包含多个attr,再declare-styleable中声明或者定义多个attr的好处在于代码引用属性时可以直接R.styleable.styleable_name_attr_name,如果attr已经单独定义过了,那么再styleable中只需声明就好。

Theme是Style的子集,定义Theme和定义一般style形式上是一样的,只是内容略有不同。如果Theme的属性有些是针对Window的有些是针对View的,而一般的style中的属性是只针对View的。

reference数据类型,一般是用于指向某个style,也可以指向某个类型的数据,如color,string等使用示例:

        <item name="buttonStyle">@style/Widget.Button</item>

 在定义或者声明attr时,并没有指明这些属性是属于谁的,所以谁都能用。系统的widget一般都在java文件中使用了注解,TextView的如下:

* <p>
 * <b>XML attributes</b>
 * <p>
 * See {@link android.R.styleable#TextView TextView Attributes},
 * {@link android.R.styleable#View View Attributes}
 *
 * @attr ref android.R.styleable#TextView_text
 * @attr ref android.R.styleable#TextView_bufferType
 * @attr ref android.R.styleable#TextView_hint
 * @attr ref android.R.styleable#TextView_textColor
 * @attr ref android.R.styleable#TextView_textColorHighlight
 * @attr ref android.R.styleable#TextView_textColorHint
 * @attr ref android.R.styleable#TextView_textAppearance
 * @attr ref android.R.styleable#TextView_textColorLink
 * @attr ref android.R.styleable#TextView_textSize
 * @attr ref android.R.styleable#TextView_textScaleX
 * @attr ref android.R.styleable#TextView_fontFamily
 * @attr ref android.R.styleable#TextView_typeface
 * @attr ref android.R.styleable#TextView_textStyle
 * @attr ref android.R.styleable#TextView_cursorVisible
 * @attr ref android.R.styleable#TextView_maxLines
 * @attr ref android.R.styleable#TextView_maxHeight
 * @attr ref android.R.styleable#TextView_lines
 * @attr ref android.R.styleable#TextView_height
 * @attr ref android.R.styleable#TextView_minLines
 * @attr ref android.R.styleable#TextView_minHeight
 * @attr ref android.R.styleable#TextView_maxEms
 * @attr ref android.R.styleable#TextView_maxWidth
 * @attr ref android.R.styleable#TextView_ems
 * @attr ref android.R.styleable#TextView_width
 * @attr ref android.R.styleable#TextView_minEms
 * @attr ref android.R.styleable#TextView_minWidth
 * @attr ref android.R.styleable#TextView_gravity
 * @attr ref android.R.styleable#TextView_scrollHorizontally
 * @attr ref android.R.styleable#TextView_password
 * @attr ref android.R.styleable#TextView_singleLine
 * @attr ref android.R.styleable#TextView_selectAllOnFocus
 * @attr ref android.R.styleable#TextView_includeFontPadding
 * @attr ref android.R.styleable#TextView_maxLength
 * @attr ref android.R.styleable#TextView_shadowColor
 * @attr ref android.R.styleable#TextView_shadowDx
 * @attr ref android.R.styleable#TextView_shadowDy
 * @attr ref android.R.styleable#TextView_shadowRadius
 * @attr ref android.R.styleable#TextView_autoLink
 * @attr ref android.R.styleable#TextView_linksClickable
 * @attr ref android.R.styleable#TextView_numeric
 * @attr ref android.R.styleable#TextView_digits
 * @attr ref android.R.styleable#TextView_phoneNumber
 * @attr ref android.R.styleable#TextView_inputMethod
 * @attr ref android.R.styleable#TextView_capitalize
 * @attr ref android.R.styleable#TextView_autoText
 * @attr ref android.R.styleable#TextView_editable
 * @attr ref android.R.styleable#TextView_freezesText
 * @attr ref android.R.styleable#TextView_ellipsize
 * @attr ref android.R.styleable#TextView_drawableTop
 * @attr ref android.R.styleable#TextView_drawableBottom
 * @attr ref android.R.styleable#TextView_drawableRight
 * @attr ref android.R.styleable#TextView_drawableLeft
 * @attr ref android.R.styleable#TextView_drawableStart
 * @attr ref android.R.styleable#TextView_drawableEnd
 * @attr ref android.R.styleable#TextView_drawablePadding
 * @attr ref android.R.styleable#TextView_drawableTint
 * @attr ref android.R.styleable#TextView_drawableTintMode
 * @attr ref android.R.styleable#TextView_lineSpacingExtra
 * @attr ref android.R.styleable#TextView_lineSpacingMultiplier
 * @attr ref android.R.styleable#TextView_marqueeRepeatLimit
 * @attr ref android.R.styleable#TextView_inputType
 * @attr ref android.R.styleable#TextView_imeOptions
 * @attr ref android.R.styleable#TextView_privateImeOptions
 * @attr ref android.R.styleable#TextView_imeActionLabel
 * @attr ref android.R.styleable#TextView_imeActionId
 * @attr ref android.R.styleable#TextView_editorExtras
 * @attr ref android.R.styleable#TextView_elegantTextHeight
 * @attr ref android.R.styleable#TextView_letterSpacing
 * @attr ref android.R.styleable#TextView_fontFeatureSettings
 * @attr ref android.R.styleable#TextView_breakStrategy
 * @attr ref android.R.styleable#TextView_hyphenationFrequency
 * @attr ref android.R.styleable#TextView_autoSizeTextType
 * @attr ref android.R.styleable#TextView_autoSizeMinTextSize
 * @attr ref android.R.styleable#TextView_autoSizeMaxTextSize
 * @attr ref android.R.styleable#TextView_autoSizeStepGranularity
 * @attr ref android.R.styleable#TextView_autoSizePresetSizes

这样在编写layout文件使用到TextView时编译器就能自动检查哪些属性能用哪些不能用。

Window的属性基本都在R.styleable.Window中声明了。

关于xmlns命名空间,xml标准原意是赋予命名空间一个惟一的名称。不过,很多公司常常会作为指针来使用命名空间指向实际存在的网页,这个网页包含关于命名空间的信息。而Android中定义这个命名空间的标准是在使用到自定义View的xml布局文件中需要加入在引用Library的第三方View时,我们需要在XML布局文件头部添加xmlns:app="http://schemas.android.com/apk/res-auto"或者xmlns:app="http://schemas.android.com/apk/res/包名"。所以xmlns:android="http://schemas.android.com/apk/res/android"是因为系统属性都定义在package name为"andrioid"的apk(framework_res.apk)中。

系统的xml资源除了兼容包中的,其他都在frameworks/base/core/res中,attr在res/values中的attrs.xml,attrs_manifest.xml,而style在styles.xml,styles_device_defaults.xml,styles_material.xml等文件中。Theme在themes.xml,themes_device_defaults.xml,themes_material.xml等。

frameworks/base/core/res中定义style和Theme都是不带android这个xmlns前缀的,但是看到v7包中有些Theme部分属性会加,查过这些属性在frameworks/base/core/res中是没有加的,有时候使用的时确实必须要加上才能用,不知道为什么,有知道的留言告诉一下。

还拿TextView来分析,因为相对比较简单。在TextView构造函数中,首先取TextView绑定的Context的theme中TextView感兴趣的属性,然后再取Layout文件中属性,如果前者和后者有相同的,则后者覆盖前者。TextView构造方法中,跟提取属性相关的代码如下:

final Resources.Theme theme = context.getTheme();

        /*
         * Look the appearance up without checking first if it exists because
         * almost every TextView has one and it greatly simplifies the logic
         * to be able to parse the appearance first and then let specific tags
         * for this View override it.
         */
        TypedArray a = theme.obtainStyledAttributes(attrs,
                com.android.internal.R.styleable.TextViewAppearance, defStyleAttr, defStyleRes);//TextViewAppearance只声明了一个属性,textAppearance,format="reference"
//然后在Theme中加入与Text相关的属性时,把所有属性集合到一个style中,使textAppearance指向
//该style
        TypedArray appearance = null;
        int ap = a.getResourceId(
                com.android.internal.R.styleable.TextViewAppearance_textAppearance, -1);
        a.recycle();//提取该textAppearance指向的style
        if (ap != -1) {
//从textAppearance指向的style中取出TextAppearance声明过的属性。下面会从attrs中取出布局文件
//中在R.styleable.TextView声明过的属性。所以由此可看出,有些属性可以在Theme中声明,
//有些必须要在layout文件中声明,在Theme声明了也没用。而且在Theme怎么声明也要看代码中怎么写,
//在TextView中,如果想在Theme中声明textColor这个属性,需要写在一个style,然后使用
//textAppearance指向它。(也许单独在Theme中声明textColor也行,一样会写如attrs中,然后在下一阶段取出)
            appearance = theme.obtainStyledAttributes(
                    ap, com.android.internal.R.styleable.TextAppearance);
        }
        if (appearance != null) {
            int n = appearance.getIndexCount();
            for (int i = 0; i < n; i++) {
                int attr = appearance.getIndex(i);

                switch (attr) {
                    case com.android.internal.R.styleable.TextAppearance_textColorHighlight:
                        textColorHighlight = appearance.getColor(attr, textColorHighlight);
                        break;

                    case com.android.internal.R.styleable.TextAppearance_textColor:
                        textColor = appearance.getColorStateList(attr);
                        break;

                    case com.android.internal.R.styleable.TextAppearance_textColorHint:
                        textColorHint = appearance.getColorStateList(attr);
                        break;

                    case com.android.internal.R.styleable.TextAppearance_textColorLink:
                        textColorLink = appearance.getColorStateList(attr);
                        break;

                    case com.android.internal.R.styleable.TextAppearance_textSize:
                        textSize = appearance.getDimensionPixelSize(attr, textSize);
                        break;

                    case com.android.internal.R.styleable.TextAppearance_typeface:
                        typefaceIndex = appearance.getInt(attr, -1);
                        break;

                    case com.android.internal.R.styleable.TextAppearance_fontFamily:
                        if (!context.isRestricted() && context.canLoadUnsafeResources()) {
                            try {
                                fontTypeface = appearance.getFont(attr);
                            } catch (UnsupportedOperationException
                                    | Resources.NotFoundException e) {
                                // Expected if it is not a font resource.
                            }
                        }
                        if (fontTypeface == null) {
                            fontFamily = appearance.getString(attr);
                        }
                        break;

                    case com.android.internal.R.styleable.TextAppearance_textStyle:
                        styleIndex = appearance.getInt(attr, -1);
                        break;

                    case com.android.internal.R.styleable.TextAppearance_textAllCaps:
                        allCaps = appearance.getBoolean(attr, false);
                        break;

                    case com.android.internal.R.styleable.TextAppearance_shadowColor:
                        shadowcolor = appearance.getInt(attr, 0);
                        break;

                    case com.android.internal.R.styleable.TextAppearance_shadowDx:
                        dx = appearance.getFloat(attr, 0);
                        break;

                    case com.android.internal.R.styleable.TextAppearance_shadowDy:
                        dy = appearance.getFloat(attr, 0);
                        break;

                    case com.android.internal.R.styleable.TextAppearance_shadowRadius:
                        r = appearance.getFloat(attr, 0);
                        break;

                    case com.android.internal.R.styleable.TextAppearance_elegantTextHeight:
                        elegant = appearance.getBoolean(attr, false);
                        break;

                    case com.android.internal.R.styleable.TextAppearance_letterSpacing:
                        letterSpacing = appearance.getFloat(attr, 0);
                        break;

                    case com.android.internal.R.styleable.TextAppearance_fontFeatureSettings:
                        fontFeatureSettings = appearance.getString(attr);
                        break;
                }
            }

            appearance.recycle();
        }

        boolean editable = getDefaultEditable();
        CharSequence inputMethod = null;
        int numeric = 0;
        CharSequence digits = null;
        boolean phone = false;
        boolean autotext = false;
        int autocap = -1;
        int buffertype = 0;
        boolean selectallonfocus = false;
        Drawable drawableLeft = null, drawableTop = null, drawableRight = null,
                drawableBottom = null, drawableStart = null, drawableEnd = null;
        ColorStateList drawableTint = null;
        PorterDuff.Mode drawableTintMode = null;
        int drawablePadding = 0;
        int ellipsize = -1;
        boolean singleLine = false;
        int maxlength = -1;
        CharSequence text = "";
        CharSequence hint = null;
        boolean password = false;
        float autoSizeMinTextSizeInPx = UNSET_AUTO_SIZE_UNIFORM_CONFIGURATION_VALUE;
        float autoSizeMaxTextSizeInPx = UNSET_AUTO_SIZE_UNIFORM_CONFIGURATION_VALUE;
        float autoSizeStepGranularityInPx = UNSET_AUTO_SIZE_UNIFORM_CONFIGURATION_VALUE;
        int inputType = EditorInfo.TYPE_NULL;
//从attrs中取出在R.styleable.TextView中声明过的属性。
        a = theme.obtainStyledAttributes(
                    attrs, com.android.internal.R.styleable.TextView, defStyleAttr, defStyleRes);

        int n = a.getIndexCount();

        boolean fromResourceId = false;
        for (int i = 0; i < n; i++) {
            int attr = a.getIndex(i);

            switch (attr) {
                case com.android.internal.R.styleable.TextView_editable:
                    editable = a.getBoolean(attr, editable);
                    break;

                case com.android.internal.R.styleable.TextView_inputMethod:
                    inputMethod = a.getText(attr);
                    break;

                case com.android.internal.R.styleable.TextView_numeric:
                    numeric = a.getInt(attr, numeric);
                    break;

                case com.android.internal.R.styleable.TextView_digits:
                    digits = a.getText(attr);
                    break;

                case com.android.internal.R.styleable.TextView_phoneNumber:
                    phone = a.getBoolean(attr, phone);
                    break;

                case com.android.internal.R.styleable.TextView_autoText:
                    autotext = a.getBoolean(attr, autotext);
                    break;

                case com.android.internal.R.styleable.TextView_capitalize:
                    autocap = a.getInt(attr, autocap);
                    break;

                case com.android.internal.R.styleable.TextView_bufferType:
                    buffertype = a.getInt(attr, buffertype);
                    break;

                case com.android.internal.R.styleable.TextView_selectAllOnFocus:
                    selectallonfocus = a.getBoolean(attr, selectallonfocus);
                    break;

                case com.android.internal.R.styleable.TextView_autoLink:
                    mAutoLinkMask = a.getInt(attr, 0);
                    break;

                case com.android.internal.R.styleable.TextView_linksClickable:
                    mLinksClickable = a.getBoolean(attr, true);
                    break;

                case com.android.internal.R.styleable.TextView_drawableLeft:
                    drawableLeft = a.getDrawable(attr);
                    break;

                case com.android.internal.R.styleable.TextView_drawableTop:
                    drawableTop = a.getDrawable(attr);
                    break;

                case com.android.internal.R.styleable.TextView_drawableRight:
                    drawableRight = a.getDrawable(attr);
                    break;

                case com.android.internal.R.styleable.TextView_drawableBottom:
                    drawableBottom = a.getDrawable(attr);
                    break;

                case com.android.internal.R.styleable.TextView_drawableStart:
                    drawableStart = a.getDrawable(attr);
                    break;

                case com.android.internal.R.styleable.TextView_drawableEnd:
                    drawableEnd = a.getDrawable(attr);
                    break;

                case com.android.internal.R.styleable.TextView_drawableTint:
                    drawableTint = a.getColorStateList(attr);
                    break;

                case com.android.internal.R.styleable.TextView_drawableTintMode:
                    drawableTintMode = Drawable.parseTintMode(a.getInt(attr, -1), drawableTintMode);
                    break;

                case com.android.internal.R.styleable.TextView_drawablePadding:
                    drawablePadding = a.getDimensionPixelSize(attr, drawablePadding);
                    break;

                case com.android.internal.R.styleable.TextView_maxLines:
                    setMaxLines(a.getInt(attr, -1));
                    break;

                case com.android.internal.R.styleable.TextView_maxHeight:
                    setMaxHeight(a.getDimensionPixelSize(attr, -1));
                    break;

                case com.android.internal.R.styleable.TextView_lines:
                    setLines(a.getInt(attr, -1));
                    break;

                case com.android.internal.R.styleable.TextView_height:
                    setHeight(a.getDimensionPixelSize(attr, -1));
                    break;

                case com.android.internal.R.styleable.TextView_minLines:
                    setMinLines(a.getInt(attr, -1));
                    break;

                case com.android.internal.R.styleable.TextView_minHeight:
                    setMinHeight(a.getDimensionPixelSize(attr, -1));
                    break;

                case com.android.internal.R.styleable.TextView_maxEms:
                    setMaxEms(a.getInt(attr, -1));
                    break;

                case com.android.internal.R.styleable.TextView_maxWidth:
                    setMaxWidth(a.getDimensionPixelSize(attr, -1));
                    break;

                case com.android.internal.R.styleable.TextView_ems:
                    setEms(a.getInt(attr, -1));
                    break;

                case com.android.internal.R.styleable.TextView_width:
                    setWidth(a.getDimensionPixelSize(attr, -1));
                    break;

                case com.android.internal.R.styleable.TextView_minEms:
                    setMinEms(a.getInt(attr, -1));
                    break;

                case com.android.internal.R.styleable.TextView_minWidth:
                    setMinWidth(a.getDimensionPixelSize(attr, -1));
                    break;

                case com.android.internal.R.styleable.TextView_gravity:
                    setGravity(a.getInt(attr, -1));
                    break;

                case com.android.internal.R.styleable.TextView_hint:
                    hint = a.getText(attr);
                    break;

                case com.android.internal.R.styleable.TextView_text:
                    fromResourceId = true;
                    text = a.getText(attr);
                    break;

                case com.android.internal.R.styleable.TextView_scrollHorizontally:
                    if (a.getBoolean(attr, false)) {
                        setHorizontallyScrolling(true);
                    }
                    break;

                case com.android.internal.R.styleable.TextView_singleLine:
                    singleLine = a.getBoolean(attr, singleLine);
                    break;

                case com.android.internal.R.styleable.TextView_ellipsize:
                    ellipsize = a.getInt(attr, ellipsize);
                    break;

                case com.android.internal.R.styleable.TextView_marqueeRepeatLimit:
                    setMarqueeRepeatLimit(a.getInt(attr, mMarqueeRepeatLimit));
                    break;

                case com.android.internal.R.styleable.TextView_includeFontPadding:
                    if (!a.getBoolean(attr, true)) {
                        setIncludeFontPadding(false);
                    }
                    break;

                case com.android.internal.R.styleable.TextView_cursorVisible:
                    if (!a.getBoolean(attr, true)) {
                        setCursorVisible(false);
                    }
                    break;

                case com.android.internal.R.styleable.TextView_maxLength:
                    maxlength = a.getInt(attr, -1);
                    break;

                case com.android.internal.R.styleable.TextView_textScaleX:
                    setTextScaleX(a.getFloat(attr, 1.0f));
                    break;

                case com.android.internal.R.styleable.TextView_freezesText:
                    mFreezesText = a.getBoolean(attr, false);
                    break;

                case com.android.internal.R.styleable.TextView_shadowColor:
                    shadowcolor = a.getInt(attr, 0);
                    break;

                case com.android.internal.R.styleable.TextView_shadowDx:
                    dx = a.getFloat(attr, 0);
                    break;

                case com.android.internal.R.styleable.TextView_shadowDy:
                    dy = a.getFloat(attr, 0);
                    break;

                case com.android.internal.R.styleable.TextView_shadowRadius:
                    r = a.getFloat(attr, 0);
                    break;

                case com.android.internal.R.styleable.TextView_enabled:
                    setEnabled(a.getBoolean(attr, isEnabled()));
                    break;

                case com.android.internal.R.styleable.TextView_textColorHighlight:
                    textColorHighlight = a.getColor(attr, textColorHighlight);
                    break;

                case com.android.internal.R.styleable.TextView_textColor:
                    textColor = a.getColorStateList(attr);
                    break;

                case com.android.internal.R.styleable.TextView_textColorHint:
                    textColorHint = a.getColorStateList(attr);
                    break;

                case com.android.internal.R.styleable.TextView_textColorLink:
                    textColorLink = a.getColorStateList(attr);
                    break;

                case com.android.internal.R.styleable.TextView_textSize:
                    textSize = a.getDimensionPixelSize(attr, textSize);
                    break;

                case com.android.internal.R.styleable.TextView_typeface:
                    typefaceIndex = a.getInt(attr, typefaceIndex);
                    break;

                case com.android.internal.R.styleable.TextView_textStyle:
                    styleIndex = a.getInt(attr, styleIndex);
                    break;

                case com.android.internal.R.styleable.TextView_fontFamily:
                    if (!context.isRestricted() && context.canLoadUnsafeResources()) {
                        try {
                            fontTypeface = a.getFont(attr);
                        } catch (UnsupportedOperationException | Resources.NotFoundException e) {
                            // Expected if it is not a resource reference or if it is a reference to
                            // another resource type.
                        }
                    }
                    if (fontTypeface == null) {
                        fontFamily = a.getString(attr);
                    }
                    fontFamilyExplicit = true;
                    break;

                case com.android.internal.R.styleable.TextView_password:
                    password = a.getBoolean(attr, password);
                    break;

                case com.android.internal.R.styleable.TextView_lineSpacingExtra:
                    mSpacingAdd = a.getDimensionPixelSize(attr, (int) mSpacingAdd);
                    break;

                case com.android.internal.R.styleable.TextView_lineSpacingMultiplier:
                    mSpacingMult = a.getFloat(attr, mSpacingMult);
                    break;

                case com.android.internal.R.styleable.TextView_inputType:
                    inputType = a.getInt(attr, EditorInfo.TYPE_NULL);
                    break;

                case com.android.internal.R.styleable.TextView_allowUndo:
                    createEditorIfNeeded();
                    mEditor.mAllowUndo = a.getBoolean(attr, true);
                    break;

                case com.android.internal.R.styleable.TextView_imeOptions:
                    createEditorIfNeeded();
                    mEditor.createInputContentTypeIfNeeded();
                    mEditor.mInputContentType.imeOptions = a.getInt(attr,
                            mEditor.mInputContentType.imeOptions);
                    break;

                case com.android.internal.R.styleable.TextView_imeActionLabel:
                    createEditorIfNeeded();
                    mEditor.createInputContentTypeIfNeeded();
                    mEditor.mInputContentType.imeActionLabel = a.getText(attr);
                    break;

                case com.android.internal.R.styleable.TextView_imeActionId:
                    createEditorIfNeeded();
                    mEditor.createInputContentTypeIfNeeded();
                    mEditor.mInputContentType.imeActionId = a.getInt(attr,
                            mEditor.mInputContentType.imeActionId);
                    break;

                case com.android.internal.R.styleable.TextView_privateImeOptions:
                    setPrivateImeOptions(a.getString(attr));
                    break;

                case com.android.internal.R.styleable.TextView_editorExtras:
                    try {
                        setInputExtras(a.getResourceId(attr, 0));
                    } catch (XmlPullParserException e) {
                        Log.w(LOG_TAG, "Failure reading input extras", e);
                    } catch (IOException e) {
                        Log.w(LOG_TAG, "Failure reading input extras", e);
                    }
                    break;

                case com.android.internal.R.styleable.TextView_textCursorDrawable:
                    mCursorDrawableRes = a.getResourceId(attr, 0);
                    break;

                case com.android.internal.R.styleable.TextView_textSelectHandleLeft:
                    mTextSelectHandleLeftRes = a.getResourceId(attr, 0);
                    break;

                case com.android.internal.R.styleable.TextView_textSelectHandleRight:
                    mTextSelectHandleRightRes = a.getResourceId(attr, 0);
                    break;

                case com.android.internal.R.styleable.TextView_textSelectHandle:
                    mTextSelectHandleRes = a.getResourceId(attr, 0);
                    break;

                case com.android.internal.R.styleable.TextView_textEditSuggestionItemLayout:
                    mTextEditSuggestionItemLayout = a.getResourceId(attr, 0);
                    break;

                case com.android.internal.R.styleable.TextView_textEditSuggestionContainerLayout:
                    mTextEditSuggestionContainerLayout = a.getResourceId(attr, 0);
                    break;

                case com.android.internal.R.styleable.TextView_textEditSuggestionHighlightStyle:
                    mTextEditSuggestionHighlightStyle = a.getResourceId(attr, 0);
                    break;

                case com.android.internal.R.styleable.TextView_textIsSelectable:
                    setTextIsSelectable(a.getBoolean(attr, false));
                    break;

                case com.android.internal.R.styleable.TextView_textAllCaps:
                    allCaps = a.getBoolean(attr, false);
                    break;

                case com.android.internal.R.styleable.TextView_elegantTextHeight:
                    elegant = a.getBoolean(attr, false);
                    break;

                case com.android.internal.R.styleable.TextView_letterSpacing:
                    letterSpacing = a.getFloat(attr, 0);
                    break;

                case com.android.internal.R.styleable.TextView_fontFeatureSettings:
                    fontFeatureSettings = a.getString(attr);
                    break;

                case com.android.internal.R.styleable.TextView_breakStrategy:
                    mBreakStrategy = a.getInt(attr, Layout.BREAK_STRATEGY_SIMPLE);
                    break;

                case com.android.internal.R.styleable.TextView_hyphenationFrequency:
                    mHyphenationFrequency = a.getInt(attr, Layout.HYPHENATION_FREQUENCY_NONE);
                    break;

                case com.android.internal.R.styleable.TextView_autoSizeTextType:
                    mAutoSizeTextType = a.getInt(attr, AUTO_SIZE_TEXT_TYPE_NONE);
                    break;

                case com.android.internal.R.styleable.TextView_autoSizeStepGranularity:
                    autoSizeStepGranularityInPx = a.getDimension(attr,
                        UNSET_AUTO_SIZE_UNIFORM_CONFIGURATION_VALUE);
                    break;

                case com.android.internal.R.styleable.TextView_autoSizeMinTextSize:
                    autoSizeMinTextSizeInPx = a.getDimension(attr,
                        UNSET_AUTO_SIZE_UNIFORM_CONFIGURATION_VALUE);
                    break;

                case com.android.internal.R.styleable.TextView_autoSizeMaxTextSize:
                    autoSizeMaxTextSizeInPx = a.getDimension(attr,
                        UNSET_AUTO_SIZE_UNIFORM_CONFIGURATION_VALUE);
                    break;

                case com.android.internal.R.styleable.TextView_autoSizePresetSizes:
                    final int autoSizeStepSizeArrayResId = a.getResourceId(attr, 0);
                    if (autoSizeStepSizeArrayResId > 0) {
                        final TypedArray autoSizePresetTextSizes = a.getResources()
                                .obtainTypedArray(autoSizeStepSizeArrayResId);
                        setupAutoSizeUniformPresetSizes(autoSizePresetTextSizes);
                        autoSizePresetTextSizes.recycle();
                    }
                    break;
                case com.android.internal.R.styleable.TextView_justificationMode:
                    mJustificationMode = a.getInt(attr, Layout.JUSTIFICATION_MODE_NONE);
                    break;
            }
        }

        a.recycle();

R.styleable.TextView的定义如下:

<declare-styleable name="TextView">
        <!-- Determines the minimum type that getText() will return.
             The default is "normal".
             Note that EditText and LogTextBox always return Editable,
             even if you specify something less powerful here. -->
        <attr name="bufferType">
            <!-- Can return any CharSequence, possibly a
             Spanned one if the source text was Spanned. -->
            <enum name="normal" value="0" />
            <!-- Can only return Spannable. -->
            <enum name="spannable" value="1" />
            <!-- Can only return Spannable and Editable. -->
            <enum name="editable" value="2" />
        </attr>
        <!-- Text to display. -->
        <attr name="text" format="string" localization="suggested" />
        <!-- Hint text to display when the text is empty. -->
        <attr name="hint" format="string" />
        <!-- Text color. -->
        <attr name="textColor" />
        <!-- Color of the text selection highlight. -->
        <attr name="textColorHighlight" />
        <!-- Color of the hint text. -->
        <attr name="textColorHint" />
        <!-- Base text color, typeface, size, and style. -->
        <attr name="textAppearance" />
        <!-- Size of the text. Recommended dimension type for text is "sp" for scaled-pixels (example: 15sp). -->
        <attr name="textSize" />
        <!-- Sets the horizontal scaling factor for the text. -->
        <attr name="textScaleX" format="float" />
        <!-- Typeface (normal, sans, serif, monospace) for the text. -->
        <attr name="typeface" />
        <!-- Style (normal, bold, italic, bold|italic) for the text. -->
        <attr name="textStyle" />
        <!-- Weight for the font used in the TextView. -->
        <attr name="textFontWeight" />
        <!-- Font family (named by string or as a font resource reference) for the text. -->
        <attr name="fontFamily" />
        <!-- Text color for links. -->
        <attr name="textColorLink" />
        <!-- Makes the cursor visible (the default) or invisible. -->
        <attr name="cursorVisible" format="boolean" />
        <!-- Makes the TextView be at most this many lines tall.

        When used on an editable text, the <code>inputType</code> attribute's value must be
        combined with the <code>textMultiLine</code> flag for the maxLines attribute to apply. -->
        <attr name="maxLines" format="integer" min="0" />
        <!-- Makes the TextView be at most this many pixels tall. -->
        <attr name="maxHeight" />
        <!-- Makes the TextView be exactly this many lines tall. -->
        <attr name="lines" format="integer" min="0" />
        <!-- Makes the TextView be exactly this tall.
             You could get the same effect by specifying this number in the
             layout parameters. -->
        <attr name="height" format="dimension" />
        <!-- Makes the TextView be at least this many lines tall.

        When used on an editable text, the <code>inputType</code> attribute's value must be
        combined with the <code>textMultiLine</code> flag for the minLines attribute to apply. -->
        <attr name="minLines" format="integer" min="0" />
        <!-- Makes the TextView be at least this many pixels tall. -->
        <attr name="minHeight" />
        <!-- Makes the TextView be at most this many ems wide. -->
        <attr name="maxEms" format="integer" min="0" />
        <!-- Makes the TextView be at most this many pixels wide. -->
        <attr name="maxWidth" />
        <!-- Makes the TextView be exactly this many ems wide. -->
        <attr name="ems" format="integer" min="0" />
        <!-- Makes the TextView be exactly this wide.
             You could get the same effect by specifying this number in the
             layout parameters. -->
        <attr name="width" format="dimension" />
        <!-- Makes the TextView be at least this many ems wide. -->
        <attr name="minEms" format="integer" min="0" />
        <!-- Makes the TextView be at least this many pixels wide. -->
        <attr name="minWidth" />
        <!-- Specifies how to align the text by the view's x- and/or y-axis
             when the text is smaller than the view. -->
        <attr name="gravity" />
        <!-- Whether the text is allowed to be wider than the view (and
             therefore can be scrolled horizontally). -->
        <attr name="scrollHorizontally" format="boolean" />
        <!-- Whether the characters of the field are displayed as
             password dots instead of themselves.
             {@deprecated Use inputType instead.} -->
        <attr name="password" format="boolean" />
        <!-- Constrains the text to a single horizontally scrolling line
             instead of letting it wrap onto multiple lines, and advances
             focus instead of inserting a newline when you press the
             enter key.

             The default value is false (multi-line wrapped text mode) for non-editable text, but if
             you specify any value for inputType, the default is true (single-line input field mode).

             {@deprecated This attribute is deprecated. Use <code>maxLines</code> instead to change
             the layout of a static text, and use the <code>textMultiLine</code> flag in the
             inputType attribute instead for editable text views (if both singleLine and inputType
             are supplied, the inputType flags will override the value of singleLine). } -->
        <attr name="singleLine" format="boolean" />
        <!-- Specifies whether the widget is enabled. The interpretation of the enabled state varies by subclass.
             For example, a non-enabled EditText prevents the user from editing the contained text, and
             a non-enabled Button prevents the user from tapping the button.
             The appearance of enabled and non-enabled widgets may differ, if the drawables referenced
             from evaluating state_enabled differ. -->
        <attr name="enabled" format="boolean" />
        <!-- If the text is selectable, select it all when the view takes
             focus. -->
        <attr name="selectAllOnFocus" format="boolean" />
        <!-- Leave enough room for ascenders and descenders instead of
             using the font ascent and descent strictly.  (Normally true). -->
        <attr name="includeFontPadding" format="boolean" />
        <!-- Set an input filter to constrain the text length to the
             specified number. -->
        <attr name="maxLength" format="integer" min="0" />
        <!-- Place a blurred shadow of text underneath the text, drawn with the
             specified color. The text shadow produced does not interact with
             properties on View that are responsible for real time shadows,
             {@link android.R.styleable#View_elevation elevation} and
             {@link android.R.styleable#View_translationZ translationZ}. -->
        <attr name="shadowColor" />
        <!-- Horizontal offset of the text shadow. -->
        <attr name="shadowDx" />
        <!-- Vertical offset of the text shadow. -->
        <attr name="shadowDy" />
        <!-- Blur radius of the text shadow. -->
        <attr name="shadowRadius" />
        <attr name="autoLink" />
        <!-- If set to false, keeps the movement method from being set
             to the link movement method even if autoLink causes links
             to be found. -->
        <attr name="linksClickable" format="boolean" />
        <!-- If set, specifies that this TextView has a numeric input method.
             The default is false.
             {@deprecated Use inputType instead.} -->
        <attr name="numeric">
            <!-- Input is numeric. -->
            <flag name="integer" value="0x01" />
            <!-- Input is numeric, with sign allowed. -->
            <flag name="signed" value="0x03" />
            <!-- Input is numeric, with decimals allowed. -->
            <flag name="decimal" value="0x05" />
        </attr>
        <!-- If set, specifies that this TextView has a numeric input method
             and that these specific characters are the ones that it will
             accept.
             If this is set, numeric is implied to be true.
             The default is false. -->
        <attr name="digits" format="string" />
        <!-- If set, specifies that this TextView has a phone number input
             method. The default is false.
             {@deprecated Use inputType instead.} -->
        <attr name="phoneNumber" format="boolean" />
        <!-- If set, specifies that this TextView should use the specified
             input method (specified by fully-qualified class name).
             {@deprecated Use inputType instead.} -->
        <attr name="inputMethod" format="string" />
        <!-- If set, specifies that this TextView has a textual input method
             and should automatically capitalize what the user types.
             The default is "none".
             {@deprecated Use inputType instead.} -->
        <attr name="capitalize">
            <!-- Don't automatically capitalize anything. -->
            <enum name="none" value="0" />
            <!-- Capitalize the first word of each sentence. -->
            <enum name="sentences" value="1" />
            <!-- Capitalize the first letter of every word. -->
            <enum name="words" value="2" />
            <!-- Capitalize every character. -->
            <enum name="characters" value="3" />
        </attr>
        <!-- If set, specifies that this TextView has a textual input method
             and automatically corrects some common spelling errors.
             The default is "false".
             {@deprecated Use inputType instead.} -->
        <attr name="autoText" format="boolean" />
        <!-- If set, specifies that this TextView has an input method.
             It will be a textual one unless it has otherwise been specified.
             For TextView, this is false by default.  For EditText, it is
             true by default.
             {@deprecated Use inputType instead.} -->
        <attr name="editable" format="boolean" />
        <!-- If set, the text view will include its current complete text
             inside of its frozen icicle in addition to meta-data such as
             the current cursor position.  By default this is disabled;
             it can be useful when the contents of a text view is not stored
             in a persistent place such as a content provider. For
             {@link android.widget.EditText} it is always enabled, regardless
             of the value of the attribute. -->
        <attr name="freezesText" format="boolean" />
        <!-- If set, causes words that are longer than the view is wide
             to be ellipsized instead of broken in the middle.
             You will often also want to set scrollHorizontally or singleLine
             as well so that the text as a whole is also constrained to
             a single line instead of still allowed to be broken onto
             multiple lines. -->
        <attr name="ellipsize" />
        <!-- The drawable to be drawn above the text. -->
        <attr name="drawableTop" format="reference|color" />
        <!-- The drawable to be drawn below the text. -->
        <attr name="drawableBottom" format="reference|color" />
        <!-- The drawable to be drawn to the left of the text. -->
        <attr name="drawableLeft" format="reference|color" />
        <!-- The drawable to be drawn to the right of the text. -->
        <attr name="drawableRight" format="reference|color" />
        <!-- The drawable to be drawn to the start of the text. -->
        <attr name="drawableStart" format="reference|color" />
        <!-- The drawable to be drawn to the end of the text. -->
        <attr name="drawableEnd" format="reference|color" />
        <!-- The padding between the drawables and the text. -->
        <attr name="drawablePadding" format="dimension" />
        <!-- Tint to apply to the compound (left, top, etc.) drawables. -->
        <attr name="drawableTint" format="color" />
        <!-- Blending mode used to apply the compound (left, top, etc.) drawables tint. -->
        <attr name="drawableTintMode">
            <!-- The tint is drawn on top of the drawable.
                 [Sa + (1 - Sa)*Da, Rc = Sc + (1 - Sa)*Dc] -->
            <enum name="src_over" value="3" />
            <!-- The tint is masked by the alpha channel of the drawable. The drawable’s
                 color channels are thrown out. [Sa * Da, Sc * Da] -->
            <enum name="src_in" value="5" />
            <!-- The tint is drawn above the drawable, but with the drawable’s alpha
                 channel masking the result. [Da, Sc * Da + (1 - Sa) * Dc] -->
            <enum name="src_atop" value="9" />
            <!-- Multiplies the color and alpha channels of the drawable with those of
                 the tint. [Sa * Da, Sc * Dc] -->
            <enum name="multiply" value="14" />
            <!-- [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc] -->
            <enum name="screen" value="15" />
            <!-- Combines the tint and drawable color and alpha channels, clamping the
                 result to valid color values. Saturate(S + D) -->
            <enum name="add" value="16" />
        </attr>
        <!-- Extra spacing between lines of text. The value will not be applied for the last
             line of text. -->
        <attr name="lineSpacingExtra" format="dimension" />
        <!-- Extra spacing between lines of text, as a multiplier. The value will not be applied
             for the last line of text.-->
        <attr name="lineSpacingMultiplier" format="float" />
        <!-- Explicit height between lines of text. If set, this will override the values set
             for lineSpacingExtra and lineSpacingMultiplier. -->
        <attr name="lineHeight" format="dimension" />
        <!-- Distance from the top of the TextView to the first text baseline. If set, this
             overrides the value set for paddingTop. -->
        <attr name="firstBaselineToTopHeight" format="dimension" />
        <!-- Distance from the bottom of the TextView to the last text baseline. If set, this
             overrides the value set for paddingBottom. -->
        <attr name="lastBaselineToBottomHeight" format="dimension" />
        <!-- The number of times to repeat the marquee animation. Only applied if the
             TextView has marquee enabled. -->
        <attr name="marqueeRepeatLimit" format="integer">
            <!-- Indicates that marquee should repeat indefinitely. -->
            <enum name="marquee_forever" value="-1" />
        </attr>
        <attr name="inputType" />
        <!-- Whether undo should be allowed for editable text. Defaults to true. -->
        <attr name="allowUndo" format="boolean" />
        <attr name="imeOptions" />
        <!-- An addition content type description to supply to the input
             method attached to the text view, which is private to the
             implementation of the input method.  This simply fills in
             the {@link android.view.inputmethod.EditorInfo#privateImeOptions
             EditorInfo.privateImeOptions} field when the input
             method is connected. -->
        <attr name="privateImeOptions" format="string" />
        <!-- Supply a value for
             {@link android.view.inputmethod.EditorInfo#actionLabel EditorInfo.actionLabel}
             used when an input method is connected to the text view. -->
        <attr name="imeActionLabel" format="string" />
        <!-- Supply a value for
             {@link android.view.inputmethod.EditorInfo#actionId EditorInfo.actionId}
             used when an input method is connected to the text view. -->
        <attr name="imeActionId" format="integer" />
        <!-- Reference to an
             {@link android.R.styleable#InputExtras &lt;input-extras&gt;}
             XML resource containing additional data to
             supply to an input method, which is private to the implementation
             of the input method.  This simply fills in
             the {@link android.view.inputmethod.EditorInfo#extras
             EditorInfo.extras} field when the input
             method is connected. -->
        <attr name="editorExtras" format="reference" />

        <!-- Reference to a drawable that will be used to display a text selection
             anchor on the left side of a selection region. -->
        <attr name="textSelectHandleLeft" />
        <!-- Reference to a drawable that will be used to display a text selection
             anchor on the right side of a selection region. -->
        <attr name="textSelectHandleRight" />
        <!-- Reference to a drawable that will be used to display a text selection
             anchor for positioning the cursor within text. -->
        <attr name="textSelectHandle" />
        <!-- The layout of the view that is displayed on top of the cursor to paste inside a
             TextEdit field. -->
        <attr name="textEditPasteWindowLayout" />
        <!-- Variation of textEditPasteWindowLayout displayed when the clipboard is empty. -->
        <attr name="textEditNoPasteWindowLayout" />
        <!-- Used instead of textEditPasteWindowLayout when the window is moved on the side of the
             insertion cursor because it would be clipped if it were positioned on top. -->
        <attr name="textEditSidePasteWindowLayout" />
        <!-- Variation of textEditSidePasteWindowLayout displayed when the clipboard is empty. -->
        <attr name="textEditSideNoPasteWindowLayout" />

        <!-- Layout of the TextView item that will populate the suggestion popup window. -->
        <attr name="textEditSuggestionItemLayout" />
        <!-- Layout of the container of the suggestion popup window. -->
        <attr name="textEditSuggestionContainerLayout" />
        <!-- Style of the highlighted string in the suggestion popup window. -->
        <attr name="textEditSuggestionHighlightStyle" />


        <!-- Reference to a drawable that will be drawn under the insertion cursor. -->
        <attr name="textCursorDrawable" />

        <!-- Indicates that the content of a non-editable text can be selected. -->
        <attr name="textIsSelectable" />
        <!-- Present the text in ALL CAPS. This may use a small-caps form when available. -->
        <attr name="textAllCaps" />
        <!-- Elegant text height, especially for less compacted complex script text. -->
        <attr name="elegantTextHeight" />
        <!-- Whether to respect the ascent and descent of the fallback fonts that are used in
        displaying the text. When true, fallback fonts that end up getting used can increase
        the ascent and descent of the lines that they are used on. -->
        <attr name="fallbackLineSpacing" format="boolean"/>
        <!-- Text letter-spacing. -->
        <attr name="letterSpacing" />
        <!-- Font feature settings. -->
        <attr name="fontFeatureSettings" />
        <!-- Break strategy (control over paragraph layout). -->
        <attr name="breakStrategy">
            <!-- Line breaking uses simple strategy. -->
            <enum name="simple" value="0" />
            <!-- Line breaking uses high-quality strategy, including hyphenation. -->
            <enum name="high_quality" value="1" />
            <!-- Line breaking strategy balances line lengths. -->
            <enum name="balanced" value="2" />
        </attr>
        <!-- Frequency of automatic hyphenation. -->
        <attr name="hyphenationFrequency">
            <!-- No hyphenation. -->
            <enum name="none" value="0" />
            <!-- Less frequent hyphenation, useful for informal use cases, such
            as chat messages. -->
            <enum name="normal" value="1" />
            <!-- Standard amount of hyphenation, useful for running text and for
            screens with limited space for text. -->
            <enum name="full" value="2" />
        </attr>
        <!-- Specify the type of auto-size. Note that this feature is not supported by EditText,
        works only for TextView. -->
        <attr name="autoSizeTextType" format="enum">
            <!-- No auto-sizing (default). -->
            <enum name="none" value="0" />
            <!-- Uniform horizontal and vertical text size scaling to fit within the
            container. -->
            <enum name="uniform" value="1" />
        </attr>
        <!-- Specify the auto-size step size if <code>autoSizeTextType</code> is set to
        <code>uniform</code>. The default is 1px. Overwrites
        <code>autoSizePresetSizes</code> if set. -->
        <attr name="autoSizeStepGranularity" format="dimension" />
        <!-- Resource array of dimensions to be used in conjunction with
        <code>autoSizeTextType</code> set to <code>uniform</code>. Overrides
        <code>autoSizeStepGranularity</code> if set. -->
        <attr name="autoSizePresetSizes"/>
        <!-- The minimum text size constraint to be used when auto-sizing text. -->
        <attr name="autoSizeMinTextSize" format="dimension" />
        <!-- The maximum text size constraint to be used when auto-sizing text. -->
        <attr name="autoSizeMaxTextSize" format="dimension" />
        <!-- Mode for justification. -->
        <attr name="justificationMode">
            <!-- No justification. -->
            <enum name="none" value="0" />
            <!-- Justification by stretching word spacing. -->
            <enum name="inter_word" value = "1" />
        </attr>
    </declare-styleable>

R.styleable.TextAppearance

<declare-styleable name="TextAppearance">
        <!-- Text color. -->
        <attr name="textColor" />
        <!-- Size of the text. Recommended dimension type for text is "sp" for scaled-pixels (example: 15sp). -->
        <attr name="textSize" />
        <!-- Style (normal, bold, italic, bold|italic) for the text. -->
        <attr name="textStyle" />
        <!-- Weight for the font used in the TextView. -->
        <attr name="textFontWeight" />
        <!-- Typeface (normal, sans, serif, monospace) for the text. -->
        <attr name="typeface" />
        <!-- Font family (named by string or as a font resource reference) for the text. -->
        <attr name="fontFamily" />
        <!-- Color of the text selection highlight. -->
        <attr name="textColorHighlight" />
        <!-- Color of the hint text. -->
        <attr name="textColorHint" />
        <!-- Color of the links. -->
        <attr name="textColorLink" />
        <!-- Present the text in ALL CAPS. This may use a small-caps form when available. -->
        <attr name="textAllCaps" format="boolean" />
        <!-- Place a blurred shadow of text underneath the text, drawn with the
             specified color. The text shadow produced does not interact with
             properties on View that are responsible for real time shadows,
             {@link android.R.styleable#View_elevation elevation} and
             {@link android.R.styleable#View_translationZ translationZ}. -->
        <attr name="shadowColor" format="color" />
        <!-- Horizontal offset of the text shadow. -->
        <attr name="shadowDx" format="float" />
        <!-- Vertical offset of the text shadow. -->
        <attr name="shadowDy" format="float" />
        <!-- Blur radius of the text shadow. -->
        <attr name="shadowRadius" format="float" />
        <!-- Elegant text height, especially for less compacted complex script text. -->
        <attr name="elegantTextHeight" format="boolean" />
        <!-- Whether to respect the ascent and descent of the fallback fonts that are used in
        displaying the text. When true, fallback fonts that end up getting used can increase
        the ascent and descent of the lines that they are used on. -->
        <attr name="fallbackLineSpacing" format="boolean"/>
        <!-- Text letter-spacing. -->
        <attr name="letterSpacing" format="float" />
        <!-- Font feature settings. -->
        <attr name="fontFeatureSettings" format="string" />
    </declare-styleable>

一般Theme对textAppearance的使用:

    <style name="Theme.Dialog">
        <item name="windowFrame">@null</item>
        <item name="windowTitleStyle">@style/DialogWindowTitle</item>
        <item name="windowBackground">@drawable/panel_background</item>
        <item name="windowIsFloating">true</item>
        <item name="windowContentOverlay">@null</item>
        <item name="windowAnimationStyle">@style/Animation.Dialog</item>
        <item name="windowSoftInputMode">stateUnspecified|adjustPan</item>
        <item name="windowCloseOnTouchOutside">@bool/config_closeDialogWhenTouchOutside</item>
        <item name="windowActionModeOverlay">true</item>

        <item name="colorBackgroundCacheHint">@null</item>

        <item name="textAppearance">@style/TextAppearance</item>
...
...
...
<style/>

R.styleable.TextViewAppearance的定义:

    <declare-styleable name="TextViewAppearance">
        <!-- Base text color, typeface, size, and style. -->
        <attr name="textAppearance" />
    </declare-styleable>

 

 

 

下面给出 attrs.xml,styles.xml,themes.xml方便看看Google是怎么定义的

attrs.xml 

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2006 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<!-- Formatting note: terminate all comments with a period, to avoid breaking
     the documentation output. To suppress comment lines from the documentation
     output, insert an eat-comment element after the comment lines.
-->

<resources>
    <!-- These are the standard attributes that make up a complete theme. -->
    <declare-styleable name="Theme">
        <!-- ============== -->
        <!-- Generic styles -->
        <!-- ============== -->
        <eat-comment />

        <!-- Specifies that a theme has a light background with dark text on top.  -->
        <attr name="isLightTheme" format="boolean" />

        <!-- Default color of foreground imagery. -->
        <attr name="colorForeground" format="color" />
        <!-- Default color of foreground imagery on an inverted background. -->
        <attr name="colorForegroundInverse" format="color" />
        <!-- Default color of background imagery, ex. full-screen windows. -->
        <attr name="colorBackground" format="color" />
        <!-- Default color of background imagery for floating components, ex. dialogs, popups, and cards. -->
        <attr name="colorBackgroundFloating" format="color" />
        <!-- This is a hint for a solid color that can be used for caching
             rendered views.  This should be the color of the background when
             there is a solid background color; it should be null when the
             background is a texture or translucent.  When a device is able
             to use accelerated drawing (thus setting state_accelerated), the
             cache hint is ignored and always assumed to be transparent. -->
        <attr name="colorBackgroundCacheHint" format="color" />

        <!-- Default highlight color for items that are pressed. -->
        <attr name="colorPressedHighlight" format="color" />
        <!-- Default highlight color for items that are long-pressed. -->
        <attr name="colorLongPressedHighlight" format="color" />
        <!-- Default highlight color for items that are
             focused. (Focused meaning cursor-based selection.) -->
        <attr name="colorFocusedHighlight" format="color" />
        <!-- Default highlight color for items that are
             activated. (Activated meaning persistent selection.) -->
        <attr name="colorActivatedHighlight" format="color" />
        <!-- Default highlight color for items in multiple selection
             mode. -->
        <attr name="colorMultiSelectHighlight" format="color" />

        <!-- Drawable to be drawn over the view to mark it as autofilled-->
        <attr name="autofilledHighlight" format="reference" />

        <!-- Max width of the autofill data set picker as a fraction of the screen width -->
        <attr name="autofillDatasetPickerMaxWidth" format="reference" />

        <!-- Max height of the autofill data set picker as a fraction of the screen height -->
        <attr name="autofillDatasetPickerMaxHeight" format="reference" />

        <!-- Max height of the the autofill save custom subtitle as a fraction of the screen width/height -->
        <attr name="autofillSaveCustomSubtitleMaxHeight" format="reference" />

        <!-- Default disabled alpha for widgets that set enabled/disabled alpha programmatically. -->
        <attr name="disabledAlpha" format="float" />
        <!-- The alpha applied to the foreground color to create the primary text color. -->
        <attr name="primaryContentAlpha" format="float" />
        <!-- The alpha applied to the foreground color to create the secondary text color. -->
        <attr name="secondaryContentAlpha" format="float" />
        <!-- Color used for error states and things that need to be drawn to
             the users attention.. -->
        <attr name="colorError" format="reference|color" />
        <!-- Default background dim amount when a menu, dialog, or something similar pops up. -->
        <attr name="backgroundDimAmount" format="float" />
        <!-- Control whether dimming behind the window is enabled.  The default
             theme does not set this value, meaning it is based on whether the
             window is floating. -->
        <attr name="backgroundDimEnabled" format="boolean" />

        <!-- =========== -->
        <!-- Text styles -->
        <!-- =========== -->
        <eat-comment />

        <!-- Default appearance of text: color, typeface, size, and style. -->
        <attr name="textAppearance" format="reference" />
        <!-- Default appearance of text against an inverted background:
             color, typeface, size, and style. -->
        <attr name="textAppearanceInverse" format="reference" />

        <!-- The most prominent text color.  -->
        <attr name="textColorPrimary" format="reference|color" />
        <!-- Secondary text color. -->
        <attr name="textColorSecondary" format="reference|color" />
        <!-- Tertiary text color. -->
        <attr name="textColorTertiary" format="reference|color" />

        <!-- Primary inverse text color, useful for inverted backgrounds. -->
        <attr name="textColorPrimaryInverse" format="reference|color" />
        <!-- Secondary inverse text color, useful for inverted backgrounds. -->
        <attr name="textColorSecondaryInverse" format="reference|color" />
        <!-- Tertiary inverse text color, useful for inverted backgrounds. -->
        <attr name="textColorTertiaryInverse" format="reference|color" />

        <!-- Inverse hint text color. -->
        <attr name="textColorHintInverse" format="reference|color" />

        <!-- Bright text color. Only differentiates based on the disabled state. -->
        <attr name="textColorPrimaryDisableOnly" format="reference|color" />

        <!-- Bright inverse text color. Only differentiates based on the disabled state. -->
        <attr name="textColorPrimaryInverseDisableOnly" format="reference|color" />

        <!-- Bright text color. This does not differentiate the disabled state. As an example,
             buttons use this since they display the disabled state via the background and not the
             foreground text color. -->
        <attr name="textColorPrimaryNoDisable" format="reference|color" />
        <!-- Dim text color. This does not differentiate the disabled state. -->
        <attr name="textColorSecondaryNoDisable" format="reference|color" />

        <!-- Bright inverse text color. This does not differentiate the disabled state. -->
        <attr name="textColorPrimaryInverseNoDisable" format="reference|color" />
        <!-- Dim inverse text color. This does not differentiate the disabled state. -->
        <attr name="textColorSecondaryInverseNoDisable" format="reference|color" />

        <!-- Bright text color for use over activated backgrounds. -->
        <attr name="textColorPrimaryActivated" format="reference|color" />
        <!-- Dim text color for use over activated backgrounds. -->
        <attr name="textColorSecondaryActivated" format="reference|color" />

        <!-- Text color for urls in search suggestions, used by things like global search and the browser. @hide -->
        <attr name="textColorSearchUrl" format="reference|color" />

        <!-- Color of highlighted text, when used in a light theme. -->
        <attr name="textColorHighlightInverse" format="reference|color" />
        <!-- Color of link text (URLs), when used in a light theme. -->
        <attr name="textColorLinkInverse" format="reference|color" />

        <!-- Color of list item text in alert dialogs. -->
        <attr name="textColorAlertDialogListItem" format="reference|color" />

        <!-- Search widget more corpus result item background. -->
        <attr name="searchWidgetCorpusItemBackground" format="reference|color" />

        <!-- Text color, typeface, size, and style for "large" text. Defaults to primary text color. -->
        <attr name="textAppearanceLarge" format="reference" />
        <!-- Text color, typeface, size, and style for "medium" text. Defaults to primary text color. -->
        <attr name="textAppearanceMedium" format="reference" />
        <!-- Text color, typeface, size, and style for "small" text. Defaults to secondary text color. -->
        <attr name="textAppearanceSmall" format="reference" />

        <!-- Text color, typeface, size, and style for "large" inverse text. Defaults to primary inverse text color. -->
        <attr name="textAppearanceLargeInverse" format="reference" />
        <!-- Text color, typeface, size, and style for "medium" inverse text. Defaults to primary inverse text color. -->
        <attr name="textAppearanceMediumInverse" format="reference" />
        <!-- Text color, typeface, size, and style for "small" inverse text. Defaults to secondary inverse text color. -->
        <attr name="textAppearanceSmallInverse" format="reference" />

        <!-- Text color, typeface, size, and style for system search result title. Defaults to primary inverse text color. -->
        <attr name="textAppearanceSearchResultTitle" format="reference" />
        <!-- Text color, typeface, size, and style for system search result subtitle. Defaults to primary inverse text color. -->
        <attr name="textAppearanceSearchResultSubtitle" format="reference" />

        <!-- Text color, typeface, size, and style for the text inside of a button. -->
        <attr name="textAppearanceButton" format="reference" />

        <!-- Text color, typeface, size, and style for the text inside of a popup menu. -->
        <attr name="textAppearanceLargePopupMenu" format="reference" />

        <!-- Text color, typeface, size, and style for small text inside of a popup menu. -->
        <attr name="textAppearanceSmallPopupMenu" format="reference" />

        <!-- Text color, typeface, size, and style for header text inside of a popup menu. -->
        <attr name="textAppearancePopupMenuHeader" format="reference" />

        <!-- The underline color and thickness for easy correct suggestion -->
        <attr name="textAppearanceEasyCorrectSuggestion" format="reference" />

        <!-- The underline color and thickness for misspelled suggestion -->
        <attr name="textAppearanceMisspelledSuggestion" format="reference" />

        <!-- The underline color and thickness for auto correction suggestion -->
        <attr name="textAppearanceAutoCorrectionSuggestion" format="reference" />

        <!--  The underline color -->
        <attr name="textUnderlineColor" format="reference|color" />
        <!--  The underline thickness -->
        <attr name="textUnderlineThickness" format="reference|dimension" />

        <!-- EditText text foreground color. -->
        <attr name="editTextColor" format="reference|color" />
        <!-- EditText background drawable. -->
        <attr name="editTextBackground" format="reference" />

        <!-- Popup text displayed in TextView when setError is used. -->
        <attr name="errorMessageBackground" format="reference" />
        <!-- Background used instead of errorMessageBackground when the popup has to be above. -->
        <attr name="errorMessageAboveBackground" format="reference" />

        <!-- A styled string, specifying the style to be used for showing
             inline candidate text when composing with an input method.  The
             text itself will be ignored, but the style spans will be applied
             to the candidate text as it is edited. -->
        <attr name="candidatesTextStyleSpans" format="reference|string" />

        <!-- Drawable to use for check marks. -->
        <attr name="textCheckMark" format="reference" />
        <attr name="textCheckMarkInverse" format="reference" />

        <!-- Drawable to use for multiple choice indicators. -->
        <attr name="listChoiceIndicatorMultiple" format="reference" />

        <!-- Drawable to use for single choice indicators. -->
        <attr name="listChoiceIndicatorSingle" format="reference" />

        <!-- Drawable used as a background for selected list items. -->
        <attr name="listChoiceBackgroundIndicator" format="reference" />

        <!-- Drawable used as a background for activated items. -->
        <attr name="activatedBackgroundIndicator" format="reference" />

        <!-- ============= -->
        <!-- Button styles -->
        <!-- ============= -->
        <eat-comment />

        <!-- Normal Button style. -->
        <attr name="buttonStyle" format="reference" />

        <!-- Small Button style. -->
        <attr name="buttonStyleSmall" format="reference" />

        <!-- Button style to inset into an EditText. -->
        <attr name="buttonStyleInset" format="reference" />

        <!-- ToggleButton style. -->
        <attr name="buttonStyleToggle" format="reference" />

        <!-- ============== -->
        <!-- Gallery styles -->
        <!-- ============== -->
        <eat-comment />

        <!-- The preferred background for gallery items. This should be set
             as the background of any Views you provide from the Adapter. -->
        <attr name="galleryItemBackground" format="reference" />

        <!-- =========== -->
        <!-- List styles -->
        <!-- =========== -->
        <eat-comment />

        <!-- The preferred list item height. -->
        <attr name="listPreferredItemHeight" format="dimension" />
        <!-- A smaller, sleeker list item height. -->
        <attr name="listPreferredItemHeightSmall" format="dimension" />
        <!-- A larger, more robust list item height. -->
        <attr name="listPreferredItemHeightLarge" format="dimension" />
        <!-- The list item height for search results. @hide -->
        <attr name="searchResultListItemHeight" format="dimension" />

        <!-- The preferred padding along the left edge of list items. -->
        <attr name="listPreferredItemPaddingLeft" format="dimension" />
        <!-- The preferred padding along the right edge of list items. -->
        <attr name="listPreferredItemPaddingRight" format="dimension" />

        <!-- The preferred TextAppearance for the primary text of list items. -->
        <attr name="textAppearanceListItem" format="reference" />
        <!-- The preferred TextAppearance for the secondary text of list items. -->
        <attr name="textAppearanceListItemSecondary" format="reference" />
        <!-- The preferred TextAppearance for the primary text of small list items. -->
        <attr name="textAppearanceListItemSmall" format="reference" />

        <!-- The drawable for the list divider. -->
        <attr name="listDivider" format="reference" />
        <!-- The list divider used in alert dialogs. -->
        <attr name="listDividerAlertDialog" format="reference" />
        <!-- TextView style for list separators. -->
        <attr name="listSeparatorTextViewStyle" format="reference" />
        <!-- The preferred left padding for an expandable list item (for child-specific layouts,
             use expandableListPreferredChildPaddingLeft). This takes into account
             the indicator that will be shown to next to the item. -->
        <attr name="expandableListPreferredItemPaddingLeft" format="dimension" />
        <!-- The preferred left padding for an expandable list item that is a child.
             If this is not provided, it defaults to the expandableListPreferredItemPaddingLeft. -->
        <attr name="expandableListPreferredChildPaddingLeft" format="dimension" />
        <!-- The preferred left bound for an expandable list item's indicator. For a child-specific
             indicator, use expandableListPreferredChildIndicatorLeft. -->
        <attr name="expandableListPreferredItemIndicatorLeft" format="dimension" />
        <!-- The preferred right bound for an expandable list item's indicator. For a child-specific
             indicator, use expandableListPreferredChildIndicatorRight. -->
        <attr name="expandableListPreferredItemIndicatorRight" format="dimension" />
        <!-- The preferred left bound for an expandable list child's indicator. -->
        <attr name="expandableListPreferredChildIndicatorLeft" format="dimension" />
        <!-- The preferred right bound for an expandable list child's indicator. -->
        <attr name="expandableListPreferredChildIndicatorRight" format="dimension" />

        <!-- The preferred item height for dropdown lists. -->
        <attr name="dropdownListPreferredItemHeight" format="dimension" />

        <!-- The preferred padding along the start edge of list items. -->
        <attr name="listPreferredItemPaddingStart" format="dimension" />
        <!-- The preferred padding along the end edge of list items. -->
        <attr name="listPreferredItemPaddingEnd" format="dimension" />

        <!-- ============= -->
        <!-- Window styles -->
        <!-- ============= -->
        <eat-comment />

        <!-- Drawable to use as the overall window background.  As of
             {@link android.os.Build.VERSION_CODES#HONEYCOMB}, this may
             be a selector that uses state_accelerated to pick a non-solid
             color when running on devices that can draw such a bitmap
             with complex compositing on top at 60fps.

             <p>There are a few special considerations to use when setting this
             drawable:
             <ul>
             <li> This information will be used to infer the pixel format
                  for your window's surface.  If the drawable has any
                  non-opaque pixels, your window will be translucent
                  (32 bpp).
             <li> If you want to draw the entire background
                  yourself, you should set this drawable to some solid
                  color that closely matches that background (so the
                  system's preview of your window will match), and
                  then in code manually set your window's background to
                  null so it will not be drawn.
             </ul> -->
        <attr name="windowBackground" format="reference" />
        <!-- Drawable to draw selectively within the inset areas when the windowBackground
             has been set to null. This protects against seeing visual garbage in the
             surface when the app has not drawn any content into this area. One example is
             when the user is resizing a window of an activity that has
             {@link android.R.attr#resizeableActivity} set for multi-window mode. -->
        <attr name="windowBackgroundFallback" format="reference" />
        <!-- Drawable to use as a frame around the window. -->
        <attr name="windowFrame" format="reference" />
        <!-- Flag indicating whether there should be no title on this window. -->
        <attr name="windowNoTitle" format="boolean" />
        <!-- Flag indicating whether this window should fill the entire screen.  Corresponds
             to {@link android.view.WindowManager.LayoutParams#FLAG_FULLSCREEN}. -->
        <attr name="windowFullscreen" format="boolean" />
        <!-- Flag indicating whether this window should extend into overscan region.  Corresponds
             to {@link android.view.WindowManager.LayoutParams#FLAG_LAYOUT_IN_OVERSCAN}. -->
        <attr name="windowOverscan" format="boolean" />
        <!-- Flag indicating whether this is a floating window. -->
        <attr name="windowIsFloating" format="boolean" />
        <!-- Flag indicating whether this is a translucent window. If this attribute is unset (but
             not if set to false), the window might still be considered translucent, if
             windowSwipeToDismiss is set to true. -->
        <attr name="windowIsTranslucent" format="boolean" />
        <!-- Flag indicating that this window's background should be the
             user's current wallpaper.  Corresponds
             to {@link android.view.WindowManager.LayoutParams#FLAG_SHOW_WALLPAPER}. -->
        <attr name="windowShowWallpaper" format="boolean" />
        <!-- This Drawable is overlaid over the foreground of the Window's content area, usually
             to place a shadow below the title.  -->
        <attr name="windowContentOverlay" format="reference" />
        <!-- The style resource to use for a window's title bar height. -->
        <attr name="windowTitleSize" format="dimension" />
        <!-- The style resource to use for a window's title text. -->
        <attr name="windowTitleStyle" format="reference" />
        <!-- The style resource to use for a window's title area. -->
        <attr name="windowTitleBackgroundStyle" format="reference" />

        <!-- Reference to a style resource holding
             the set of window animations to use, which can be
             any of the attributes defined by
             {@link android.R.styleable#WindowAnimation}. -->
        <attr name="windowAnimationStyle" format="reference" />

        <!-- Flag indicating whether this window should have an Action Bar
             in place of the usual title bar. -->
        <attr name="windowActionBar" format="boolean" />

        <!-- Flag indicating whether this window's Action Bar should overlay
             application content. Does nothing if the window would not
             have an Action Bar. -->
        <attr name="windowActionBarOverlay" format="boolean" />

        <!-- Flag indicating whether action modes should overlay window content
             when there is not reserved space for their UI (such as an Action Bar). -->
        <attr name="windowActionModeOverlay" format="boolean" />

        <!-- Defines the default soft input state that this window would
             like when it is displayed.  Corresponds
             to {@link android.view.WindowManager.LayoutParams#softInputMode}. -->
        <attr name="windowSoftInputMode">
            <!-- Not specified, use what the system thinks is best.  This
                 is the default. -->
            <flag name="stateUnspecified" value="0" />
            <!-- Leave the soft input window as-is, in whatever state it
                 last was. -->
            <flag name="stateUnchanged" value="1" />
            <!-- Make the soft input area hidden when normally appropriate
                 (when the user is navigating forward to your window). -->
            <flag name="stateHidden" value="2" />
            <!-- Always make the soft input area hidden when this window
                 has input focus. -->
            <flag name="stateAlwaysHidden" value="3" />
            <!-- Make the soft input area visible when normally appropriate
                 (when the user is navigating forward to your window). -->
            <flag name="stateVisible" value="4" />
            <!-- Always make the soft input area visible when this window
                 has input focus. -->
            <flag name="stateAlwaysVisible" value="5" />

            <!-- The window resize/pan adjustment has not been specified,
                 the system will automatically select between resize and pan
                 modes, depending
                 on whether the content of the window has any layout views
                 that can scroll their contents.  If there is such a view,
                 then the window will be resized, with the assumption being
                 that the resizeable area can be reduced to make room for
                 the input UI. -->
            <flag name="adjustUnspecified" value="0x00" />
            <!-- Always resize the window: the content area of the window is
                 reduced to make room for the soft input area. -->
            <flag name="adjustResize" value="0x10" />
            <!-- Don't resize the window to make room for the soft input area;
                 instead pan the contents of the window as focus moves inside
                 of it so that the user can see what they are typing.  This is
                 generally less desireable than panning because the user may
                 need to close the input area to get at and interact with
                 parts of the window. -->
            <flag name="adjustPan" value="0x20" />
            <!-- Don't resize <em>or</em> pan the window to make room for the
                 soft input area; the window is never adjusted for it. -->
            <flag name="adjustNothing" value="0x30" />
        </attr>

        <!-- Flag allowing you to disable the splash screen for a window. The default value is
             false; if set to true, the system can never use the window's theme to show a splash
             screen before your actual instance is shown to the user. -->
        <attr name="windowDisablePreview" format="boolean" />

        <!-- Flag indicating that this window should not be displayed at all.
             The default value is false; if set to true, and this window is
             the main window of an Activity, then it will never actually
             be added to the window manager.  This means that your activity
             must immediately quit without waiting for user interaction,
             because there will be no such interaction coming. -->
        <attr name="windowNoDisplay" format="boolean" />

        <!-- Flag indicating that this window should allow touches to be split
             across other windows that also support split touch.
             The default value is true for applications with a targetSdkVersion
             of Honeycomb or newer; false otherwise.
             When this flag is false, the first pointer that goes down determines
             the window to which all subsequent touches go until all pointers go up.
             When this flag is true, each pointer (not necessarily the first) that
             goes down determines the window to which all subsequent touches of that
             pointer will go until that pointers go up thereby enabling touches
             with multiple pointers to be split across multiple windows. -->
        <attr name="windowEnableSplitTouch" format="boolean" />

        <!-- Control whether a container should automatically close itself if
             the user touches outside of it.  This only applies to activities
             and dialogs.

             <p>Note: this attribute will only be respected for applications
             that are targeting {@link android.os.Build.VERSION_CODES#HONEYCOMB}
             or later. -->
        <attr name="windowCloseOnTouchOutside" format="boolean" />

        <!-- Flag indicating whether this window requests a translucent status bar.  Corresponds
             to {@link android.view.WindowManager.LayoutParams#FLAG_TRANSLUCENT_STATUS}. -->
        <attr name="windowTranslucentStatus" format="boolean" />

        <!-- Flag indicating whether this window requests a translucent navigation bar.  Corresponds
             to {@link android.view.WindowManager.LayoutParams#FLAG_TRANSLUCENT_NAVIGATION}. -->
        <attr name="windowTranslucentNavigation" format="boolean" />

        <!-- Flag to indicate that a window can be swiped away to be dismissed.
             Corresponds to {@link android.view.Window#FEATURE_SWIPE_TO_DISMISS}. It will also
             dynamically change translucency of the window, if the windowIsTranslucent is not set.
             If windowIsTranslucent is set (to either true or false) it will obey that setting. -->
        <attr name="windowSwipeToDismiss" format="boolean" />

        <!-- Flag indicating whether this window requests that content changes be performed
             as scene changes with transitions. Corresponds to
             {@link android.view.Window#FEATURE_CONTENT_TRANSITIONS}. -->
        <attr name="windowContentTransitions" format="boolean" />

        <!-- Reference to a TransitionManager XML resource defining the desired
             transitions between different window content. -->
        <attr name="windowContentTransitionManager" format="reference" />

        <!-- Flag indicating whether this window allows Activity Transitions.
             Corresponds to {@link android.view.Window#FEATURE_ACTIVITY_TRANSITIONS}. -->
        <attr name="windowActivityTransitions" format="boolean" />

        <!-- Reference to a Transition XML resource defining the desired Transition
             used to move Views into the initial Window's content Scene. Corresponds to
             {@link android.view.Window#setEnterTransition(android.transition.Transition)}. -->
        <attr name="windowEnterTransition" format="reference"/>

        <!-- Reference to a Transition XML resource defining the desired Transition
             used to move Views out of the scene when the Window is
             preparing to close. Corresponds to
             {@link android.view.Window#setReturnTransition(android.transition.Transition)}. -->
        <attr name="windowReturnTransition" format="reference"/>

        <!-- Reference to a Transition XML resource defining the desired Transition
             used to move Views out of the Window's content Scene when launching a new Activity.
             Corresponds to
             {@link android.view.Window#setExitTransition(android.transition.Transition)}. -->
        <attr name="windowExitTransition" format="reference"/>

        <!-- Reference to a Transition XML resource defining the desired Transition
             used to move Views in to the scene when returning from a previously-started Activity.
             Corresponds to
             {@link android.view.Window#setReenterTransition(android.transition.Transition)}. -->
        <attr name="windowReenterTransition" format="reference"/>

        <!-- Reference to a Transition XML resource defining the desired Transition
             used to move shared elements transferred into the Window's initial content Scene.
             Corresponds to {@link android.view.Window#setSharedElementEnterTransition(
             android.transition.Transition)}. -->
        <attr name="windowSharedElementEnterTransition" format="reference"/>

        <!-- Reference to a Transition XML resource defining the desired Transition
             used to move shared elements transferred back to a calling Activity.
             Corresponds to {@link android.view.Window#setSharedElementReturnTransition(
             android.transition.Transition)}. -->
        <attr name="windowSharedElementReturnTransition" format="reference"/>

        <!-- Reference to a Transition XML resource defining the desired Transition
             used when starting a new Activity to move shared elements prior to transferring
             to the called Activity.
             Corresponds to {@link android.view.Window#setSharedElementExitTransition(
             android.transition.Transition)}. -->
        <attr name="windowSharedElementExitTransition" format="reference"/>

        <!-- Reference to a Transition XML resource defining the desired Transition
             used for shared elements transferred back to a calling Activity.
             Corresponds to {@link android.view.Window#setSharedElementReenterTransition(
             android.transition.Transition)}. -->
        <attr name="windowSharedElementReenterTransition" format="reference"/>

        <!-- Flag indicating whether this Window's transition should overlap with
             the exiting transition of the calling Activity. Corresponds to
             {@link android.view.Window#setAllowEnterTransitionOverlap(boolean)}.
             The default value is true. -->
        <attr name="windowAllowEnterTransitionOverlap" format="boolean"/>

        <!-- Flag indicating whether this Window's transition should overlap with
             the exiting transition of the called Activity when the called Activity
             finishes. Corresponds to
             {@link android.view.Window#setAllowReturnTransitionOverlap(boolean)}.
             The default value is true. -->
        <attr name="windowAllowReturnTransitionOverlap" format="boolean"/>

        <!-- Indicates whether or not shared elements should use an overlay
             during transitions. The default value is true. -->
        <attr name="windowSharedElementsUseOverlay" format="boolean"/>

        <!-- Internal layout used internally for window decor -->
        <attr name="windowActionBarFullscreenDecorLayout" format="reference" />

        <!-- The duration, in milliseconds, of the window background fade duration
             when transitioning into or away from an Activity when called with an
             Activity Transition. Corresponds to
             {@link android.view.Window#setTransitionBackgroundFadeDuration(long)}. -->
        <attr name="windowTransitionBackgroundFadeDuration" format="integer"/>

        <!-- ============ -->
        <!-- Floating toolbar styles -->
        <!-- ============ -->
       <eat-comment />
       <attr name="floatingToolbarCloseDrawable" format="reference" />
       <attr name="floatingToolbarForegroundColor" format="reference|color" />
       <attr name="floatingToolbarItemBackgroundBorderlessDrawable" format="reference" />
       <attr name="floatingToolbarItemBackgroundDrawable" format="reference" />
       <attr name="floatingToolbarOpenDrawable" format="reference" />
       <attr name="floatingToolbarPopupBackgroundDrawable" format="reference" />
       <attr name="floatingToolbarDividerColor" format="reference" />

        <!-- ============ -->
        <!-- Alert Dialog styles -->
        <!-- ============ -->
        <eat-comment />
        <attr name="alertDialogStyle" format="reference" />
        <attr name="alertDialogButtonGroupStyle" format="reference" />
        <attr name="alertDialogCenterButtons" format="boolean" />

        <!-- ============== -->
        <!-- Image elements -->
        <!-- ============== -->
        <eat-comment />

        <!-- Background that can be used behind parts of a UI that provide
             details on data the user is selecting.  For example, this is
             the background element of PreferenceActivity's embedded
             preference fragment. -->
        <attr name="detailsElementBackground" format="reference" />

        <!-- Icon that should be used to indicate that an app is waiting for a fingerprint scan.
             This should be used whenever an app is requesting the user to place a finger on the
             fingerprint sensor. It can be combined with other drawables such as colored circles, so
             the appearance matches the branding of the app requesting the fingerprint scan.-->
        <attr name="fingerprintAuthDrawable" format="reference" />

        <!-- ============ -->
        <!-- Panel styles -->
        <!-- ============ -->
        <eat-comment />

        <!-- The background of a panel when it is inset from the left and right edges of the screen. -->
        <attr name="panelBackground" format="reference|color" />
        <!-- The background of a panel when it extends to the left and right edges of the screen. -->
        <attr name="panelFullBackground" format="reference|color" />
        <!-- Default color of foreground panel imagery. -->
        <attr name="panelColorForeground" format="reference|color" />
        <!-- Color that matches (as closely as possible) the panel background. -->
        <attr name="panelColorBackground" format="reference|color" />
        <!-- Default appearance of panel text. -->
        <attr name="panelTextAppearance" format="reference" />

        <attr name="panelMenuIsCompact" format="boolean" />
        <attr name="panelMenuListWidth" format="dimension" />
        <attr name="panelMenuListTheme" format="reference" />

        <!-- =================== -->
        <!-- Other widget styles -->
        <!-- =================== -->
        <eat-comment />

        <!-- Default AbsListView style. -->
        <attr name="absListViewStyle" format="reference" />
        <!-- Default AutoCompleteTextView style. -->
        <attr name="autoCompleteTextViewStyle" format="reference" />
        <!-- Default Checkbox style. -->
        <attr name="checkboxStyle" format="reference" />
        <!-- Default CheckedTextView style. -->
        <attr name="checkedTextViewStyle" format="reference" />
        <!-- Default ListView style for drop downs. -->
        <attr name="dropDownListViewStyle" format="reference" />
        <!-- Default EditText style. -->
        <attr name="editTextStyle" format="reference" />
        <!-- Default ExpandableListView style. -->
        <attr name="expandableListViewStyle" format="reference" />
        <!-- ExpandableListView with white background. -->
        <attr name="expandableListViewWhiteStyle" format="reference" />
        <!-- Default Gallery style. -->
        <attr name="galleryStyle" format="reference" />
        <!-- Default GestureOverlayView style. -->
        <attr name="gestureOverlayViewStyle" format="reference" />
        <!-- Default GridView style. -->
        <attr name="gridViewStyle" format="reference" />
        <!-- The style resource to use for an ImageButton. -->
        <attr name="imageButtonStyle" format="reference" />
        <!-- The style resource to use for an ImageButton that is an image well. -->
        <attr name="imageWellStyle" format="reference" />
        <!-- Default menu-style ListView style. -->
        <attr name="listMenuViewStyle" format="reference" />
        <!-- Default ListView style. -->
        <attr name="listViewStyle" format="reference" />
        <!-- ListView with white background. -->
        <attr name="listViewWhiteStyle" format="reference" />
        <!-- Default PopupWindow style. -->
        <attr name="popupWindowStyle" format="reference" />
        <!-- Default ProgressBar style. This is a medium circular progress bar. -->
        <attr name="progressBarStyle" format="reference" />
        <!-- Horizontal ProgressBar style. This is a horizontal progress bar. -->
        <attr name="progressBarStyleHorizontal" format="reference" />
        <!-- Small ProgressBar style. This is a small circular progress bar. -->
        <attr name="progressBarStyleSmall" format="reference" />
        <!-- Small ProgressBar in title style. This is a small circular progress bar that will be placed in title bars. -->
        <attr name="progressBarStyleSmallTitle" format="reference" />
        <!-- Large ProgressBar style. This is a large circular progress bar. -->
        <attr name="progressBarStyleLarge" format="reference" />
        <!-- Inverse ProgressBar style. This is a medium circular progress bar. -->
        <attr name="progressBarStyleInverse" format="reference" />
        <!-- Small inverse ProgressBar style. This is a small circular progress bar. -->
        <attr name="progressBarStyleSmallInverse" format="reference" />
        <!-- Large inverse ProgressBar style. This is a large circular progress bar. -->
        <attr name="progressBarStyleLargeInverse" format="reference" />
        <!-- Default SeekBar style. -->
        <attr name="seekBarStyle" format="reference" />
        <!-- Default RatingBar style. -->
        <attr name="ratingBarStyle" format="reference" />
        <!-- Indicator RatingBar style. -->
        <attr name="ratingBarStyleIndicator" format="reference" />
        <!-- Small indicator RatingBar style. -->
        <attr name="ratingBarStyleSmall" format="reference" />
        <!-- Default RadioButton style. -->
        <attr name="radioButtonStyle" format="reference" />
        <!-- Default ScrollView style. -->
        <attr name="scrollViewStyle" format="reference" />
        <!-- Default HorizontalScrollView style. -->
        <attr name="horizontalScrollViewStyle" format="reference" />
        <!-- Default Spinner style. -->
        <attr name="spinnerStyle" format="reference" />
        <!-- Default dropdown Spinner style. -->
        <attr name="dropDownSpinnerStyle" format="reference" />
        <!-- Default ActionBar dropdown style. -->
        <attr name="actionDropDownStyle" format="reference" />
        <!-- Default action button style. -->
        <attr name="actionButtonStyle" format="reference" />
        <!-- Default Star style. -->
        <attr name="starStyle" format="reference" />
        <!-- Default TabWidget style. -->
        <attr name="tabWidgetStyle" format="reference" />
        <!-- Default TextView style. -->
        <attr name="textViewStyle" format="reference" />
        <!-- Default WebTextView style. -->
        <attr name="webTextViewStyle" format="reference" />
        <!-- Default WebView style. -->
        <attr name="webViewStyle" format="reference" />
        <!-- Default style for drop down items. -->
        <attr name="dropDownItemStyle" format="reference" />
         <!-- Default style for spinner drop down items. -->
        <attr name="spinnerDropDownItemStyle" format="reference" />
        <!-- Default style for drop down hints. -->
        <attr name="dropDownHintAppearance" format="reference" />
        <!-- Default spinner item style. -->
        <attr name="spinnerItemStyle" format="reference" />
        <!-- Default MapView style. -->
        <attr name="mapViewStyle" format="reference" />
        <!-- Drawable used as an overlay on top of quickcontact photos. -->
        <attr name="quickContactBadgeOverlay" format="reference" />
        <!-- Default quickcontact badge style with small quickcontact window. -->
        <attr name="quickContactBadgeStyleWindowSmall" format="reference" />
        <!-- Default quickcontact badge style with medium quickcontact window. -->
        <attr name="quickContactBadgeStyleWindowMedium" format="reference" />
        <!-- Default quickcontact badge style with large quickcontact window. -->
        <attr name="quickContactBadgeStyleWindowLarge" format="reference" />
        <!-- Default quickcontact badge style with small quickcontact window. -->
        <attr name="quickContactBadgeStyleSmallWindowSmall" format="reference" />
        <!-- Default quickcontact badge style with medium quickcontact window. -->
        <attr name="quickContactBadgeStyleSmallWindowMedium" format="reference" />
        <!-- Default quickcontact badge style with large quickcontact window. -->
        <attr name="quickContactBadgeStyleSmallWindowLarge" format="reference" />
        <!-- Reference to a style that will be used for the window containing a text
             selection anchor. -->
        <attr name="textSelectHandleWindowStyle" format="reference" />
        <!-- Reference to a style that will be used for the window containing a list of possible
             text suggestions in an EditText. -->
        <attr name="textSuggestionsWindowStyle" format="reference" />
        <!-- Default ListPopupWindow style. -->
        <attr name="listPopupWindowStyle" format="reference" />
        <!-- Default PopupMenu style. -->
        <attr name="popupMenuStyle" format="reference" />
        <!-- Default context menu PopupMenu style. -->
        <attr name="contextPopupMenuStyle" format="reference" />
        <!-- Default StackView style. -->
        <attr name="stackViewStyle" format="reference" />

        <!-- Default style for the FragmentBreadCrumbs widget. This widget is deprecated
             starting in API level 21 ({@link android.os.Build.VERSION_CODES#.L}). -->
        <attr name="fragmentBreadCrumbsStyle" format="reference" />

        <!-- NumberPicker style. -->
        <attr name="numberPickerStyle" format="reference" />

        <!-- The CalendarView style. -->
        <attr name="calendarViewStyle" format="reference" />

        <!-- The TimePicker style. -->
        <attr name="timePickerStyle" format="reference" />

        <!-- The TimePicker dialog theme. -->
        <attr name="timePickerDialogTheme" format="reference" />

        <!-- The DatePicker style. -->
        <attr name="datePickerStyle" format="reference" />

        <!-- The DatePicker dialog theme. -->
        <attr name="datePickerDialogTheme" format="reference" />

        <!-- Default ActivityChooserView style. -->
        <attr name="activityChooserViewStyle" format="reference" />

        <!-- Default Toolbar style. -->
        <attr name="toolbarStyle" format="reference" />

        <!-- Fast scroller styles -->
        <eat-comment />

        <!-- Drawable to use as the fast scroll thumb. -->
        <attr name="fastScrollThumbDrawable" format="reference" />
        <!-- Drawable to use as the fast scroll index preview window background
             when shown on the right. -->
        <attr name="fastScrollPreviewBackgroundRight" format="reference" />
        <!-- Drawable to use as the fast scroll index preview window background
             when shown on the left. -->
        <attr name="fastScrollPreviewBackgroundLeft" format="reference" />
        <!-- Drawable to use as the track for the fast scroll thumb.
             This may be null. -->
        <attr name="fastScrollTrackDrawable" format="reference" />
        <!-- Position of the fast scroll index overlay window. -->
        <attr name="fastScrollOverlayPosition">
            <enum name="floating" value="0" />
            <enum name="atThumb" value="1" />
            <enum name="aboveThumb" value="2" />
        </attr>
        <!-- Text color for the fast scroll index overlay. Make sure it
             plays nicely with fastScrollPreviewBackground[Left|Right]. -->
        <attr name="fastScrollTextColor" format="color" />

        <!-- =================== -->
        <!-- Action bar styles   -->
        <!-- =================== -->
        <eat-comment />
        <!-- Default style for tabs within an action bar. -->
        <attr name="actionBarTabStyle" format="reference" />
        <!-- Reference to a style for the Action Bar Tab Bar. -->
        <attr name="actionBarTabBarStyle" format="reference" />
        <!-- Reference to a style for the Action Bar Tab text. -->
        <attr name="actionBarTabTextStyle" format="reference" />
        <!-- Reference to a style for Action Bar overflow buttons. -->
        <attr name="actionOverflowButtonStyle" format="reference" />
        <!-- Reference to a style for the Action Bar menu. -->
        <attr name="actionOverflowMenuStyle" format="reference" />
        <!-- Reference to a theme that should be used to inflate popups
             shown by widgets in the action bar. -->
        <attr name="actionBarPopupTheme" format="reference" />
        <!-- Reference to a style for the Action Bar. -->
        <attr name="actionBarStyle" format="reference" />
        <!-- Reference to a style for the split Action Bar. This style
             controls the split component that holds the menu/action
             buttons. actionBarStyle is still used for the primary
             bar. -->
        <attr name="actionBarSplitStyle" format="reference" />
        <!-- Reference to a theme that should be used to inflate the
             action bar. This will be inherited by any widget inflated
             into the action bar. -->
        <attr name="actionBarTheme" format="reference" />
        <!-- Reference to a theme that should be used to inflate widgets
             and layouts destined for the action bar. Most of the time
             this will be a reference to the current theme, but when
             the action bar has a significantly different contrast
             profile than the rest of the activity the difference
             can become important. If this is set to @null the current
             theme will be used.-->
        <attr name="actionBarWidgetTheme" format="reference" />
        <!-- Size of the Action Bar, including the contextual
             bar used to present Action Modes. -->
        <attr name="actionBarSize" format="dimension" >
            <enum name="wrap_content" value="0" />
        </attr>
        <!-- Custom divider drawable to use for elements in the action bar. -->
        <attr name="actionBarDivider" format="reference" />
        <!-- Custom item state list drawable background for action bar items. -->
        <attr name="actionBarItemBackground" format="reference" />
        <!-- TextAppearance style that will be applied to text that
             appears within action menu items. -->
        <attr name="actionMenuTextAppearance" format="reference" />
        <!-- Color for text that appears within action menu items. -->
        <attr name="actionMenuTextColor" format="color|reference" />

        <!-- =================== -->
        <!-- Action mode styles  -->
        <!-- =================== -->
        <eat-comment />
        <!-- Reference to a style for the Action Mode. -->
        <attr name="actionModeStyle" format="reference" />
        <!-- Reference to a style for the Action Mode close button. -->
        <attr name="actionModeCloseButtonStyle" format="reference" />
        <!-- Background drawable to use for action mode UI. -->
        <attr name="actionModeBackground" format="reference" />
        <!-- Background drawable to use for action mode UI in the lower split bar. -->
        <attr name="actionModeSplitBackground" format="reference" />
        <!-- Drawable to use for the close action mode button. -->
        <attr name="actionModeCloseDrawable" format="reference" />

        <!-- Drawable to use for the Cut action button in Contextual Action Bar. -->
        <attr name="actionModeCutDrawable" format="reference" />
        <!-- Drawable to use for the Copy action button in Contextual Action Bar. -->
        <attr name="actionModeCopyDrawable" format="reference" />
        <!-- Drawable to use for the Paste action button in Contextual Action Bar. -->
        <attr name="actionModePasteDrawable" format="reference" />
        <!-- Drawable to use for the Select all action button in Contextual Action Bar. -->
        <attr name="actionModeSelectAllDrawable" format="reference" />
        <!-- Drawable to use for the Share action button in WebView selection action modes. -->
        <attr name="actionModeShareDrawable" format="reference" />
        <!-- Drawable to use for the Find action button in WebView selection action modes. -->
        <attr name="actionModeFindDrawable" format="reference" />
        <!-- Drawable to use for the Web Search action button in WebView selection action modes. -->
        <attr name="actionModeWebSearchDrawable" format="reference" />

        <!-- PopupWindow style to use for action modes when showing as a window overlay. -->
        <attr name="actionModePopupWindowStyle" format="reference" />

        <!-- =================== -->
        <!-- Preference styles   -->
        <!-- =================== -->
        <eat-comment />

        <!-- Default style for PreferenceScreen. -->
        <attr name="preferenceScreenStyle" format="reference" />
        <!-- Default style for the PreferenceActivity. -->
        <attr name="preferenceActivityStyle" format="reference" />
        <!-- Default style for Headers pane in PreferenceActivity. -->
        <attr name="preferenceFragmentStyle" format="reference" />
        <!-- Default style for PreferenceCategory. -->
        <attr name="preferenceCategoryStyle" format="reference" />
        <!-- Default style for Preference. -->
        <attr name="preferenceStyle" format="reference" />
        <!-- Default style for informational Preference. -->
        <attr name="preferenceInformationStyle" format="reference" />
        <!-- Default style for CheckBoxPreference. -->
        <attr name="checkBoxPreferenceStyle" format="reference" />
        <!-- Default style for YesNoPreference. -->
        <attr name="yesNoPreferenceStyle" format="reference" />
        <!-- Default style for DialogPreference. -->
        <attr name="dialogPreferenceStyle" format="reference" />
        <!-- Default style for EditTextPreference. -->
        <attr name="editTextPreferenceStyle" format="reference" />
        <!-- @hide Default style for SeekBarDialogPreference. -->
        <attr name="seekBarDialogPreferenceStyle" format="reference" />
        <!-- Default style for RingtonePreference. -->
        <attr name="ringtonePreferenceStyle" format="reference" />
        <!-- The preference layout that has the child/tabbed effect. -->
        <attr name="preferenceLayoutChild" format="reference" />
        <!-- Preference panel style -->
        <attr name="preferencePanelStyle" format="reference" />
        <!-- Preference headers panel style -->
        <attr name="preferenceHeaderPanelStyle" format="reference" />
        <!-- Preference list style -->
        <attr name="preferenceListStyle" format="reference" />
        <!-- Preference fragment list style -->
        <attr name="preferenceFragmentListStyle" format="reference" />
        <!-- Preference fragment padding side -->
        <attr name="preferenceFragmentPaddingSide" format="dimension" />
        <!-- Default style for switch preferences. -->
        <attr name="switchPreferenceStyle" format="reference" />
        <!-- Default style for seekbar preferences. -->
        <attr name="seekBarPreferenceStyle" format="reference" />

        <!-- ============================ -->
        <!-- Text selection handle styles -->
        <!-- ============================ -->
        <eat-comment />

        <!-- Reference to a drawable that will be used to display a text selection
             anchor on the left side of a selection region. -->
        <attr name="textSelectHandleLeft" format="reference" />
        <!-- Reference to a drawable that will be used to display a text selection
             anchor on the right side of a selection region. -->
        <attr name="textSelectHandleRight" format="reference" />
        <!-- Reference to a drawable that will be used to display a text selection
             anchor for positioning the cursor within text. -->
        <attr name="textSelectHandle" format="reference" />
        <!-- The layout of the view that is displayed on top of the cursor to paste inside a
             TextEdit field. -->
        <attr name="textEditPasteWindowLayout" format="reference" />
        <!-- Variation of textEditPasteWindowLayout displayed when the clipboard is empty. -->
        <attr name="textEditNoPasteWindowLayout" format="reference" />
        <!-- Used instead of textEditPasteWindowLayout when the window is moved on the side of the
             insertion cursor because it would be clipped if it were positioned on top. -->
        <attr name="textEditSidePasteWindowLayout" format="reference" />
        <!-- Variation of textEditSidePasteWindowLayout displayed when the clipboard is empty. -->
        <attr name="textEditSideNoPasteWindowLayout" format="reference" />

        <!-- Layout of the TextView item that will populate the suggestion popup window. -->
        <attr name="textEditSuggestionItemLayout" format="reference" />
        <!-- Layout of the container of the suggestion popup window. -->
        <attr name="textEditSuggestionContainerLayout" format="reference" />
        <!-- Text appearance of the focused words to be replaced by suggested word. -->
        <attr name="textEditSuggestionHighlightStyle" format="reference" />

        <!-- Theme to use for dialogs spawned from this theme. -->
        <attr name="dialogTheme" format="reference" />
        <!-- Window decor layout to use in dialog mode with icons. -->
        <attr name="dialogTitleIconsDecorLayout" format="reference" />
        <!-- Window decor layout to use in dialog mode with custom titles. -->
        <attr name="dialogCustomTitleDecorLayout" format="reference" />
        <!-- Window decor layout to use in dialog mode with title only. -->
        <attr name="dialogTitleDecorLayout" format="reference" />
        <!-- Preferred padding for dialog content. -->
        <attr name="dialogPreferredPadding" format="dimension" />
        <!-- Corner radius of dialogs. -->
        <attr name="dialogCornerRadius" format="dimension" />

        <!-- Theme to use for alert dialogs spawned from this theme. -->
        <attr name="alertDialogTheme" format="reference" />
        <!-- Icon drawable to use for alerts. -->
        <attr name="alertDialogIcon" format="reference" />

        <!-- Theme to use for presentations spawned from this theme. -->
        <attr name="presentationTheme" format="reference" />

        <!-- Drawable to use for generic vertical dividers. -->
        <attr name="dividerVertical" format="reference" />

        <!-- Drawable to use for generic horizontal dividers. -->
        <attr name="dividerHorizontal" format="reference" />

        <!-- Style for button bars. -->
        <attr name="buttonBarStyle" format="reference" />

        <!-- Style for buttons within button bars. -->
        <attr name="buttonBarButtonStyle" format="reference" />

        <!-- Style for the "positive" buttons within button bars. -->
        <attr name="buttonBarPositiveButtonStyle" format="reference" />

        <!-- Style for the "negative" buttons within button bars. -->
        <attr name="buttonBarNegativeButtonStyle" format="reference" />

        <!-- Style for the "neutral" buttons within button bars. -->
        <attr name="buttonBarNeutralButtonStyle" format="reference" />

        <!-- Corner radius of buttons. -->
        <attr name="buttonCornerRadius" format="dimension" />

        <!-- Corner radius of progress bars. -->
        <attr name="progressBarCornerRadius" format="dimension" />

        <!-- Style for the search query widget. -->
        <attr name="searchViewStyle" format="reference" />

        <!-- Style for segmented buttons - a container that houses several buttons
             with the appearance of a singel button broken into segments. -->
        <attr name="segmentedButtonStyle" format="reference" />

        <!-- Background drawable for bordered standalone items that need focus/pressed states. -->
        <attr name="selectableItemBackground" format="reference" />

        <!-- Background drawable for borderless standalone items that need focus/pressed states. -->
        <attr name="selectableItemBackgroundBorderless" format="reference" />

        <!-- Style for buttons without an explicit border, often used in groups. -->
        <attr name="borderlessButtonStyle" format="reference" />

        <!-- Background to use for toasts. -->
        <attr name="toastFrameBackground" format="reference" />

        <!-- Background to use for tooltip popups. -->
        <attr name="tooltipFrameBackground" format="reference" />

        <!-- Foreground color to use for tooltip popups. -->
        <attr name="tooltipForegroundColor" format="reference|color" />

        <!-- Background color to use for tooltip popups. -->
        <attr name="tooltipBackgroundColor" format="reference|color" />

        <!-- Theme to use for Search Dialogs. -->
        <attr name="searchDialogTheme" format="reference" />

        <!-- Specifies a drawable to use for the 'home as up' indicator. -->
        <attr name="homeAsUpIndicator" format="reference" />

        <!-- Preference frame layout styles. -->
        <attr name="preferenceFrameLayoutStyle" format="reference" />

        <!-- Default style for the Switch widget. -->
        <attr name="switchStyle" format="reference" />

        <!-- Default style for the MediaRouteButton widget. -->
        <attr name="mediaRouteButtonStyle" format="reference" />

        <!-- ============== -->
        <!-- Pointer styles -->
        <!-- ============== -->
        <eat-comment />

        <!-- The drawable for accessibility focused views. -->
        <attr name="accessibilityFocusedDrawable" format="reference" />

        <!-- Drawable for WebView find-on-page dialogue's "next" button. @hide -->
        <attr name="findOnPageNextDrawable" format="reference" />

        <!-- Drawable for WebView find-on-page dialogue's "previous" button. @hide -->
        <attr name="findOnPagePreviousDrawable" format="reference" />

        <!-- ============= -->
        <!-- Color palette -->
        <!-- ============= -->
        <eat-comment />

        <!-- The primary branding color for the app. By default, this is the color applied to the
             action bar background. -->
        <attr name="colorPrimary" format="color" />

        <!-- Dark variant of the primary branding color. By default, this is the color applied to
             the status bar (via statusBarColor) and navigation bar (via navigationBarColor). -->
        <attr name="colorPrimaryDark" format="color" />

        <!-- The secondary branding color for the app. -->
        <attr name="colorSecondary" format="color" />

        <!-- Bright complement to the primary branding color. By default, this is the color applied
             to framework controls (via colorControlActivated). -->
        <attr name="colorAccent" format="color" />

        <!-- The color applied to framework controls in their normal state. -->
        <attr name="colorControlNormal" format="color" />

        <!-- The color applied to framework controls in their activated (ex. checked) state. -->
        <attr name="colorControlActivated" format="color" />

        <!-- The color applied to framework control highlights (ex. ripples, list selectors). -->
        <attr name="colorControlHighlight" format="color" />

        <!-- The color applied to framework buttons in their normal state. -->
        <attr name="colorButtonNormal" format="color" />

        <!-- The color applied to framework switch thumbs in their normal state. -->
        <attr name="colorSwitchThumbNormal" format="color" />

        <!-- The color applied to framework progress and seek bar backgrounds in their normal state. -->
        <attr name="colorProgressBackgroundNormal" format="color" />

        <!-- The color applied to the edge effect on scrolling containers. -->
        <attr name="colorEdgeEffect" format="color" />

        <!-- =================== -->
        <!-- Lighting properties -->
        <!-- =================== -->
        <eat-comment />

        <!-- @hide The default Y position of the light used to project view shadows. -->
        <attr name="lightY" format="dimension" />

        <!-- @hide The default Z position of the light used to project view shadows. -->
        <attr name="lightZ" format="dimension" />

        <!-- @hide The default radius of the light used to project view shadows. -->
        <attr name="lightRadius" format="dimension" />

        <!-- Alpha value of the ambient shadow projected by elevated views, between 0 and 1. -->
        <attr name="ambientShadowAlpha" format="float" />

        <!-- Alpha value of the spot shadow projected by elevated views, between 0 and 1. -->
        <attr name="spotShadowAlpha" format="float" />
    </declare-styleable>

    <!-- **************************************************************** -->
    <!-- Other non-theme attributes. -->
    <!-- **************************************************************** -->
    <eat-comment />

    <!-- Size of text. Recommended dimension type for text is "sp" for scaled-pixels (example: 15sp).
         Supported values include the following:<p/>
    <ul>
        <li><b>px</b> Pixels</li>
        <li><b>sp</b> Scaled pixels (scaled to relative pixel size on screen). See {@link android.util.DisplayMetrics} for more information.</li>
        <li><b>pt</b> Points</li>
        <li><b>dip</b> Device independent pixels. See {@link android.util.DisplayMetrics} for more information.</li>
    </ul>
        -->
    <attr name="textSize" format="dimension" />

    <!-- Default font family. -->
    <attr name="fontFamily" format="string" />

    <!-- Default text typeface. -->
    <attr name="typeface">
        <enum name="normal" value="0" />
        <enum name="sans" value="1" />
        <enum name="serif" value="2" />
        <enum name="monospace" value="3" />
    </attr>

    <!-- Default text typeface style. -->
    <attr name="textStyle">
        <flag name="normal" value="0" />
        <flag name="bold" value="1" />
        <flag name="italic" value="2" />
    </attr>

    <!-- Color of text (usually same as colorForeground). -->
    <attr name="textColor" format="reference|color" />

    <!-- Color of highlighted text. -->
    <attr name="textColorHighlight" format="reference|color" />

    <!-- Color of hint text (displayed when the field is empty). -->
    <attr name="textColorHint" format="reference|color" />

    <!-- Color of link text (URLs). -->
    <attr name="textColorLink" format="reference|color" />

    <!-- Reference to a drawable that will be drawn under the insertion cursor. -->
    <attr name="textCursorDrawable" format="reference" />

    <!-- Indicates that the content of a non-editable TextView can be selected.
     Default value is false. EditText content is always selectable. -->
    <attr name="textIsSelectable" format="boolean" />

    <!-- Where to ellipsize text. -->
    <attr name="ellipsize">
        <enum name="none" value="0" />
        <enum name="start" value="1" />
        <enum name="middle" value="2" />
        <enum name="end" value="3" />
        <enum name="marquee" value="4" />
    </attr>

    <!-- The type of data being placed in a text field, used to help an
         input method decide how to let the user enter text.  The constants
         here correspond to those defined by
         {@link android.text.InputType}.  Generally you can select
         a single value, though some can be combined together as
         indicated.  Setting this attribute to anything besides
         <var>none</var> also implies that the text is editable. -->
    <attr name="inputType">
        <!-- There is no content type.  The text is not editable. -->
        <flag name="none" value="0x00000000" />
        <!-- Just plain old text.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_TEXT} |
             {@link android.text.InputType#TYPE_TEXT_VARIATION_NORMAL}. -->
        <flag name="text" value="0x00000001" />
        <!-- Can be combined with <var>text</var> and its variations to
             request capitalization of all characters.  Corresponds to
             {@link android.text.InputType#TYPE_TEXT_FLAG_CAP_CHARACTERS}. -->
        <flag name="textCapCharacters" value="0x00001001" />
        <!-- Can be combined with <var>text</var> and its variations to
             request capitalization of the first character of every word.  Corresponds to
             {@link android.text.InputType#TYPE_TEXT_FLAG_CAP_WORDS}. -->
        <flag name="textCapWords" value="0x00002001" />
        <!-- Can be combined with <var>text</var> and its variations to
             request capitalization of the first character of every sentence.  Corresponds to
             {@link android.text.InputType#TYPE_TEXT_FLAG_CAP_SENTENCES}. -->
        <flag name="textCapSentences" value="0x00004001" />
        <!-- Can be combined with <var>text</var> and its variations to
             request auto-correction of text being input.  Corresponds to
             {@link android.text.InputType#TYPE_TEXT_FLAG_AUTO_CORRECT}. -->
        <flag name="textAutoCorrect" value="0x00008001" />
        <!-- Can be combined with <var>text</var> and its variations to
             specify that this field will be doing its own auto-completion and
             talking with the input method appropriately.  Corresponds to
             {@link android.text.InputType#TYPE_TEXT_FLAG_AUTO_COMPLETE}. -->
        <flag name="textAutoComplete" value="0x00010001" />
        <!-- Can be combined with <var>text</var> and its variations to
             allow multiple lines of text in the field.  If this flag is not set,
             the text field will be constrained to a single line.  Corresponds to
             {@link android.text.InputType#TYPE_TEXT_FLAG_MULTI_LINE}. -->
        <flag name="textMultiLine" value="0x00020001" />
        <!-- Can be combined with <var>text</var> and its variations to
             indicate that though the regular text view should not be multiple
             lines, the IME should provide multiple lines if it can.  Corresponds to
             {@link android.text.InputType#TYPE_TEXT_FLAG_IME_MULTI_LINE}. -->
        <flag name="textImeMultiLine" value="0x00040001" />
        <!-- Can be combined with <var>text</var> and its variations to
             indicate that the IME should not show any
             dictionary-based word suggestions.  Corresponds to
             {@link android.text.InputType#TYPE_TEXT_FLAG_NO_SUGGESTIONS}. -->
        <flag name="textNoSuggestions" value="0x00080001" />
        <!-- Text that will be used as a URI.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_TEXT} |
             {@link android.text.InputType#TYPE_TEXT_VARIATION_URI}. -->
        <flag name="textUri" value="0x00000011" />
        <!-- Text that will be used as an e-mail address.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_TEXT} |
             {@link android.text.InputType#TYPE_TEXT_VARIATION_EMAIL_ADDRESS}. -->
        <flag name="textEmailAddress" value="0x00000021" />
        <!-- Text that is being supplied as the subject of an e-mail.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_TEXT} |
             {@link android.text.InputType#TYPE_TEXT_VARIATION_EMAIL_SUBJECT}. -->
        <flag name="textEmailSubject" value="0x00000031" />
        <!-- Text that is the content of a short message.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_TEXT} |
             {@link android.text.InputType#TYPE_TEXT_VARIATION_SHORT_MESSAGE}. -->
        <flag name="textShortMessage" value="0x00000041" />
        <!-- Text that is the content of a long message.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_TEXT} |
             {@link android.text.InputType#TYPE_TEXT_VARIATION_LONG_MESSAGE}. -->
        <flag name="textLongMessage" value="0x00000051" />
        <!-- Text that is the name of a person.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_TEXT} |
             {@link android.text.InputType#TYPE_TEXT_VARIATION_PERSON_NAME}. -->
        <flag name="textPersonName" value="0x00000061" />
        <!-- Text that is being supplied as a postal mailing address.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_TEXT} |
             {@link android.text.InputType#TYPE_TEXT_VARIATION_POSTAL_ADDRESS}. -->
        <flag name="textPostalAddress" value="0x00000071" />
        <!-- Text that is a password.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_TEXT} |
             {@link android.text.InputType#TYPE_TEXT_VARIATION_PASSWORD}. -->
        <flag name="textPassword" value="0x00000081" />
        <!-- Text that is a password that should be visible.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_TEXT} |
             {@link android.text.InputType#TYPE_TEXT_VARIATION_VISIBLE_PASSWORD}. -->
        <flag name="textVisiblePassword" value="0x00000091" />
        <!-- Text that is being supplied as text in a web form.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_TEXT} |
             {@link android.text.InputType#TYPE_TEXT_VARIATION_WEB_EDIT_TEXT}. -->
        <flag name="textWebEditText" value="0x000000a1" />
        <!-- Text that is filtering some other data.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_TEXT} |
             {@link android.text.InputType#TYPE_TEXT_VARIATION_FILTER}. -->
        <flag name="textFilter" value="0x000000b1" />
        <!-- Text that is for phonetic pronunciation, such as a phonetic name
             field in a contact entry.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_TEXT} |
             {@link android.text.InputType#TYPE_TEXT_VARIATION_PHONETIC}. -->
        <flag name="textPhonetic" value="0x000000c1" />
        <!-- Text that will be used as an e-mail address on a web form.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_TEXT} |
             {@link android.text.InputType#TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS}. -->
        <flag name="textWebEmailAddress" value="0x000000d1" />
        <!-- Text that will be used as a password on a web form.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_TEXT} |
             {@link android.text.InputType#TYPE_TEXT_VARIATION_WEB_PASSWORD}. -->
        <flag name="textWebPassword" value="0x000000e1" />
        <!-- A numeric only field.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_NUMBER} |
             {@link android.text.InputType#TYPE_NUMBER_VARIATION_NORMAL}. -->
        <flag name="number" value="0x00000002" />
        <!-- Can be combined with <var>number</var> and its other options to
             allow a signed number.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_NUMBER} |
             {@link android.text.InputType#TYPE_NUMBER_FLAG_SIGNED}. -->
        <flag name="numberSigned" value="0x00001002" />
        <!-- Can be combined with <var>number</var> and its other options to
             allow a decimal (fractional) number.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_NUMBER} |
             {@link android.text.InputType#TYPE_NUMBER_FLAG_DECIMAL}. -->
        <flag name="numberDecimal" value="0x00002002" />
        <!-- A numeric password field.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_NUMBER} |
             {@link android.text.InputType#TYPE_NUMBER_VARIATION_PASSWORD}. -->
        <flag name="numberPassword" value="0x00000012" />
        <!-- For entering a phone number.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_PHONE}. -->
        <flag name="phone" value="0x00000003" />
        <!-- For entering a date and time.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_DATETIME} |
             {@link android.text.InputType#TYPE_DATETIME_VARIATION_NORMAL}. -->
        <flag name="datetime" value="0x00000004" />
        <!-- For entering a date.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_DATETIME} |
             {@link android.text.InputType#TYPE_DATETIME_VARIATION_DATE}. -->
        <flag name="date" value="0x00000014" />
        <!-- For entering a time.  Corresponds to
             {@link android.text.InputType#TYPE_CLASS_DATETIME} |
             {@link android.text.InputType#TYPE_DATETIME_VARIATION_TIME}. -->
        <flag name="time" value="0x00000024" />
    </attr>

    <!-- Additional features you can enable in an IME associated with an editor
         to improve the integration with your application.  The constants
         here correspond to those defined by
         {@link android.view.inputmethod.EditorInfo#imeOptions}. -->
    <attr name="imeOptions">
        <!-- There are no special semantics associated with this editor. -->
        <flag name="normal" value="0x00000000" />
        <!-- There is no specific action associated with this editor, let the
             editor come up with its own if it can.
             Corresponds to
             {@link android.view.inputmethod.EditorInfo#IME_NULL}. -->
        <flag name="actionUnspecified" value="0x00000000" />
        <!-- This editor has no action associated with it.
             Corresponds to
             {@link android.view.inputmethod.EditorInfo#IME_ACTION_NONE}. -->
        <flag name="actionNone" value="0x00000001" />
        <!-- The action key performs a "go"
             operation to take the user to the target of the text they typed.
             Typically used, for example, when entering a URL.
             Corresponds to
             {@link android.view.inputmethod.EditorInfo#IME_ACTION_GO}. -->
        <flag name="actionGo" value="0x00000002" />
        <!-- The action key performs a "search"
             operation, taking the user to the results of searching for the text
             the have typed (in whatever context is appropriate).
             Corresponds to
             {@link android.view.inputmethod.EditorInfo#IME_ACTION_SEARCH}. -->
        <flag name="actionSearch" value="0x00000003" />
        <!-- The action key performs a "send"
             operation, delivering the text to its target.  This is typically used
             when composing a message.
             Corresponds to
             {@link android.view.inputmethod.EditorInfo#IME_ACTION_SEND}. -->
        <flag name="actionSend" value="0x00000004" />
        <!-- The action key performs a "next"
             operation, taking the user to the next field that will accept text.
             Corresponds to
             {@link android.view.inputmethod.EditorInfo#IME_ACTION_NEXT}. -->
        <flag name="actionNext" value="0x00000005" />
        <!-- The action key performs a "done"
             operation, closing the soft input method.
             Corresponds to
             {@link android.view.inputmethod.EditorInfo#IME_ACTION_DONE}. -->
        <flag name="actionDone" value="0x00000006" />
        <!-- The action key performs a "previous"
             operation, taking the user to the previous field that will accept text.
             Corresponds to
             {@link android.view.inputmethod.EditorInfo#IME_ACTION_PREVIOUS}. -->
        <flag name="actionPrevious" value="0x00000007" />
        <!-- Used to request that the IME should not update any personalized data such as typing
             history and personalized language model based on what the user typed on this text
             editing object. Typical use cases are:
             <ul>
                 <li>When the application is in a special mode, where user's activities are expected
                 to be not recorded in the application's history. Some web browsers and chat
                 applications may have this kind of modes.</li>
                 <li>When storing typing history does not make much sense.  Specifying this flag in
                 typing games may help to avoid typing history from being filled up with words that
                 the user is less likely to type in their daily life.  Another example is that when
                 the application already knows that the expected input is not a valid word (e.g. a
                 promotion code that is not a valid word in any natural language).</li>
             </ul>
             <p>Applications need to be aware that the flag is not a guarantee, and some IMEs may
             not respect it.</p> -->
        <flag name="flagNoPersonalizedLearning" value="0x1000000" />
        <!-- Used to request that the IME never go
             into fullscreen mode.  Applications need to be aware that the flag is not
             a guarantee, and not all IMEs will respect it.
             <p>Corresponds to
             {@link android.view.inputmethod.EditorInfo#IME_FLAG_NO_FULLSCREEN}. -->
        <flag name="flagNoFullscreen" value="0x2000000" />
        <!-- Like flagNavigateNext, but
             specifies there is something interesting that a backward navigation
             can focus on.  If the user selects the IME's facility to backward
             navigate, this will show up in the application as an actionPrevious
             at {@link android.view.inputmethod.InputConnection#performEditorAction(int)
             InputConnection.performEditorAction(int)}.
             <p>Corresponds to
             {@link android.view.inputmethod.EditorInfo#IME_FLAG_NO_FULLSCREEN}. -->
        <flag name="flagNavigatePrevious" value="0x4000000" />
        <!-- Used to specify that there is something
             interesting that a forward navigation can focus on. This is like using
             actionNext, except allows the IME to be multiline (with
             an enter key) as well as provide forward navigation.  Note that some
             IMEs may not be able to do this, especially when running on a small
             screen where there is little space.  In that case it does not need to
             present a UI for this option.  Like actionNext, if the
             user selects the IME's facility to forward navigate, this will show up
             in the application at
             {@link android.view.inputmethod.InputConnection#performEditorAction(int)
             InputConnection.performEditorAction(int)}.
             <p>Corresponds to
             {@link android.view.inputmethod.EditorInfo#IME_FLAG_NAVIGATE_NEXT}. -->
        <flag name="flagNavigateNext" value="0x8000000" />
        <!-- Used to specify that the IME does not need
             to show its extracted text UI.  For input methods that may be fullscreen,
             often when in landscape mode, this allows them to be smaller and let part
             of the application be shown behind.  Though there will likely be limited
             access to the application available from the user, it can make the
             experience of a (mostly) fullscreen IME less jarring.  Note that when
             this flag is specified the IME may <em>not</em> be set up to be able
             to display text, so it should only be used in situations where this is
             not needed.
             <p>Corresponds to
             {@link android.view.inputmethod.EditorInfo#IME_FLAG_NO_EXTRACT_UI}. -->
        <flag name="flagNoExtractUi" value="0x10000000" />
        <!-- Used in conjunction with a custom action, this indicates that the
             action should not be available as an accessory button when the
             input method is full-screen.
             Note that by setting this flag, there can be cases where the action
             is simply never available to the user.  Setting this generally means
             that you think showing text being edited is more important than the
             action you have supplied.
             <p>Corresponds to
             {@link android.view.inputmethod.EditorInfo#IME_FLAG_NO_ACCESSORY_ACTION}. -->
        <flag name="flagNoAccessoryAction" value="0x20000000" />
        <!-- Used in conjunction with a custom action,
             this indicates that the action should not be available in-line as
             a replacement for the "enter" key.  Typically this is
             because the action has such a significant impact or is not recoverable
             enough that accidentally hitting it should be avoided, such as sending
             a message.    Note that {@link android.widget.TextView} will
             automatically set this flag for you on multi-line text views.
             <p>Corresponds to
             {@link android.view.inputmethod.EditorInfo#IME_FLAG_NO_ENTER_ACTION}. -->
        <flag name="flagNoEnterAction" value="0x40000000" />
        <!-- Used to request that the IME should be capable of inputting ASCII
             characters.  The intention of this flag is to ensure that the user
             can type Roman alphabet characters in a {@link android.widget.TextView}
             used for, typically, account ID or password input.  It is expected that IMEs
             normally are able to input ASCII even without being told so (such IMEs
             already respect this flag in a sense), but there could be some cases they
             aren't when, for instance, only non-ASCII input languagaes like Arabic,
             Greek, Hebrew, Russian are enabled in the IME.  Applications need to be
             aware that the flag is not a guarantee, and not all IMEs will respect it.
             However, it is strongly recommended for IME authors to respect this flag
             especially when their IME could end up with a state that has only non-ASCII
             input languages enabled.
             <p>Corresponds to
             {@link android.view.inputmethod.EditorInfo#IME_FLAG_FORCE_ASCII}. -->
        <flag name="flagForceAscii" value="0x80000000" />
    </attr>

    <!-- A coordinate in the X dimension. -->
    <attr name="x" format="dimension" />
    <!-- A coordinate in the Y dimension. -->
    <attr name="y" format="dimension" />

    <!-- Specifies how an object should position its content, on both the X and Y axes,
         within its own bounds.  -->
    <attr name="gravity">
        <!-- Push object to the top of its container, not changing its size. -->
        <flag name="top" value="0x30" />
        <!-- Push object to the bottom of its container, not changing its size. -->
        <flag name="bottom" value="0x50" />
        <!-- Push object to the left of its container, not changing its size. -->
        <flag name="left" value="0x03" />
        <!-- Push object to the right of its container, not changing its size. -->
        <flag name="right" value="0x05" />
        <!-- Place object in the vertical center of its container, not changing its size. -->
        <flag name="center_vertical" value="0x10" />
        <!-- Grow the vertical size of the object if needed so it completely fills its container. -->
        <flag name="fill_vertical" value="0x70" />
        <!-- Place object in the horizontal center of its container, not changing its size. -->
        <flag name="center_horizontal" value="0x01" />
        <!-- Grow the horizontal size of the object if needed so it completely fills its container. -->
        <flag name="fill_horizontal" value="0x07" />
        <!-- Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. -->
        <flag name="center" value="0x11" />
        <!-- Grow the horizontal and vertical size of the object if needed so it completely fills its container. -->
        <flag name="fill" value="0x77" />
        <!-- Additional option that can be set to have the top and
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值