Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb6e3b3b authored by Raph Levien's avatar Raph Levien Committed by Android (Google) Code Review
Browse files

Merge "resolved conflicts for merge of a9cc30ce to master"

parents 1b953b8f 2ab65680
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -485,6 +485,7 @@ package android {
    field public static final int focusable = 16842970; // 0x10100da
    field public static final int focusableInTouchMode = 16842971; // 0x10100db
    field public static final int focusedMonthDateColor = 16843587; // 0x1010343
    field public static final int fontFamily = 16843692; // 0x10103ac
    field public static final int footerDividersEnabled = 16843311; // 0x101022f
    field public static final int foreground = 16843017; // 0x1010109
    field public static final int foregroundGravity = 16843264; // 0x1010200
@@ -620,7 +621,7 @@ package android {
    field public static final int layerType = 16843604; // 0x1010354
    field public static final int layout = 16842994; // 0x10100f2
    field public static final int layoutAnimation = 16842988; // 0x10100ec
    field public static final int layoutDirection = 16843695; // 0x10103af
    field public static final int layoutDirection = 16843696; // 0x10103b0
    field public static final int layout_above = 16843140; // 0x1010184
    field public static final int layout_alignBaseline = 16843142; // 0x1010186
    field public static final int layout_alignBottom = 16843146; // 0x101018a
@@ -642,10 +643,10 @@ package android {
    field public static final int layout_height = 16842997; // 0x10100f5
    field public static final int layout_margin = 16842998; // 0x10100f6
    field public static final int layout_marginBottom = 16843002; // 0x10100fa
    field public static final int layout_marginEnd = 16843699; // 0x10103b3
    field public static final int layout_marginEnd = 16843700; // 0x10103b4
    field public static final int layout_marginLeft = 16842999; // 0x10100f7
    field public static final int layout_marginRight = 16843001; // 0x10100f9
    field public static final int layout_marginStart = 16843698; // 0x10103b2
    field public static final int layout_marginStart = 16843699; // 0x10103b3
    field public static final int layout_marginTop = 16843000; // 0x10100f8
    field public static final int layout_row = 16843643; // 0x101037b
    field public static final int layout_rowSpan = 16843644; // 0x101037c
@@ -741,10 +742,10 @@ package android {
    field public static final int packageNames = 16843649; // 0x1010381
    field public static final int padding = 16842965; // 0x10100d5
    field public static final int paddingBottom = 16842969; // 0x10100d9
    field public static final int paddingEnd = 16843697; // 0x10103b1
    field public static final int paddingEnd = 16843698; // 0x10103b2
    field public static final int paddingLeft = 16842966; // 0x10100d6
    field public static final int paddingRight = 16842968; // 0x10100d8
    field public static final int paddingStart = 16843696; // 0x10103b0
    field public static final int paddingStart = 16843697; // 0x10103b1
    field public static final int paddingTop = 16842967; // 0x10100d7
    field public static final int panelBackground = 16842846; // 0x101005e
    field public static final int panelColorBackground = 16842849; // 0x1010061
@@ -957,7 +958,7 @@ package android {
    field public static final int summaryColumn = 16843426; // 0x10102a2
    field public static final int summaryOff = 16843248; // 0x10101f0
    field public static final int summaryOn = 16843247; // 0x10101ef
    field public static final int supportsRtl = 16843692; // 0x10103ac
    field public static final int supportsRtl = 16843693; // 0x10103ad
    field public static final int supportsUploading = 16843419; // 0x101029b
    field public static final int switchMinWidth = 16843632; // 0x1010370
    field public static final int switchPadding = 16843633; // 0x1010371
@@ -988,7 +989,7 @@ package android {
    field public static final int tension = 16843370; // 0x101026a
    field public static final int testOnly = 16843378; // 0x1010272
    field public static final int text = 16843087; // 0x101014f
    field public static final int textAlignment = 16843694; // 0x10103ae
    field public static final int textAlignment = 16843695; // 0x10103af
    field public static final int textAllCaps = 16843660; // 0x101038c
    field public static final int textAppearance = 16842804; // 0x1010034
    field public static final int textAppearanceButton = 16843271; // 0x1010207
@@ -1028,7 +1029,7 @@ package android {
    field public static final int textColorTertiary = 16843282; // 0x1010212
    field public static final int textColorTertiaryInverse = 16843283; // 0x1010213
    field public static final int textCursorDrawable = 16843618; // 0x1010362
    field public static final int textDirection = 16843693; // 0x10103ad
    field public static final int textDirection = 16843694; // 0x10103ae
    field public static final int textEditNoPasteWindowLayout = 16843541; // 0x1010315
    field public static final int textEditPasteWindowLayout = 16843540; // 0x1010314
    field public static final int textEditSideNoPasteWindowLayout = 16843615; // 0x101035f
+23 −18
Original line number Diff line number Diff line
@@ -68,6 +68,10 @@ public class TextAppearanceSpan extends MetricAffectingSpan implements Parcelabl
                                        TextAppearance_textSize, -1);

        mStyle = a.getInt(com.android.internal.R.styleable.TextAppearance_textStyle, 0);
        String family = a.getString(com.android.internal.R.styleable.TextAppearance_fontFamily);
        if (family != null) {
            mTypeface = family;
        } else {
            int tf = a.getInt(com.android.internal.R.styleable.TextAppearance_typeface, 0);

            switch (tf) {
@@ -87,6 +91,7 @@ public class TextAppearanceSpan extends MetricAffectingSpan implements Parcelabl
                    mTypeface = null;
                    break;
            }
        }

        a.recycle();

+28 −6
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ import java.util.Locale;
 * @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
@@ -464,6 +465,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        ColorStateList textColorHint = null;
        ColorStateList textColorLink = null;
        int textSize = 15;
        String fontFamily = null;
        int typefaceIndex = -1;
        int styleIndex = -1;
        boolean allCaps = false;
@@ -516,6 +518,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                    typefaceIndex = appearance.getInt(attr, -1);
                    break;

                case com.android.internal.R.styleable.TextAppearance_fontFamily:
                    fontFamily = appearance.getString(attr);
                    break;

                case com.android.internal.R.styleable.TextAppearance_textStyle:
                    styleIndex = appearance.getInt(attr, -1);
                    break;
@@ -781,6 +787,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                styleIndex = a.getInt(attr, styleIndex);
                break;

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

            case com.android.internal.R.styleable.TextView_password:
                password = a.getBoolean(attr, password);
                break;
@@ -1051,7 +1061,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            typefaceIndex = MONOSPACE;
        }

        setTypefaceByIndex(typefaceIndex, styleIndex);
        setTypefaceFromAttrs(fontFamily, typefaceIndex, styleIndex);

        if (shadowcolor != 0) {
            setShadowLayer(r, dx, dy, shadowcolor);
@@ -1111,8 +1121,15 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        }
    }

    private void setTypefaceByIndex(int typefaceIndex, int styleIndex) {
    private void setTypefaceFromAttrs(String familyName, int typefaceIndex, int styleIndex) {
        Typeface tf = null;
        if (familyName != null) {
            tf = Typeface.create(familyName, styleIndex);
            if (tf != null) {
                setTypeface(tf);
                return;
            }
        }
        switch (typefaceIndex) {
            case SANS:
                tf = Typeface.SANS_SERIF;
@@ -2152,14 +2169,17 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            setLinkTextColor(colors);
        }

        String familyName;
        int typefaceIndex, styleIndex;

        familyName = appearance.getString(com.android.internal.R.styleable.
                                          TextAppearance_fontFamily);
        typefaceIndex = appearance.getInt(com.android.internal.R.styleable.
                                          TextAppearance_typeface, -1);
        styleIndex = appearance.getInt(com.android.internal.R.styleable.
                                       TextAppearance_textStyle, -1);

        setTypefaceByIndex(typefaceIndex, styleIndex);
        setTypefaceFromAttrs(familyName, typefaceIndex, styleIndex);

        if (appearance.getBoolean(com.android.internal.R.styleable.TextAppearance_textAllCaps,
                false)) {
@@ -2261,6 +2281,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
     *
     * @see #getTypeface()
     *
     * @attr ref android.R.styleable#TextView_fontFamily
     * @attr ref android.R.styleable#TextView_typeface
     * @attr ref android.R.styleable#TextView_textStyle
     */
@@ -2282,6 +2303,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
     *
     * @see #setTypeface(Typeface)
     *
     * @attr ref android.R.styleable#TextView_fontFamily
     * @attr ref android.R.styleable#TextView_typeface
     * @attr ref android.R.styleable#TextView_textStyle
     */
@@ -3682,15 +3704,15 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        boolean forceUpdate = false;
        if (isPassword) {
            setTransformationMethod(PasswordTransformationMethod.getInstance());
            setTypefaceByIndex(MONOSPACE, 0);
            setTypefaceFromAttrs(null /* fontFamily */, MONOSPACE, 0);
        } else if (isVisiblePassword) {
            if (mTransformation == PasswordTransformationMethod.getInstance()) {
                forceUpdate = true;
            }
            setTypefaceByIndex(MONOSPACE, 0);
            setTypefaceFromAttrs(null /* fontFamily */, MONOSPACE, 0);
        } else if (wasPassword || wasVisiblePassword) {
            // not in password mode, clean up typeface and transformation
            setTypefaceByIndex(-1, -1);
            setTypefaceFromAttrs(null /* fontFamily */, -1, -1);
            if (mTransformation == PasswordTransformationMethod.getInstance()) {
                forceUpdate = true;
            }
+7 −0
Original line number Diff line number Diff line
@@ -857,6 +857,9 @@
        -->
    <attr name="textSize" format="dimension" />

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

    <!-- Default text typeface. -->
    <attr name="typeface">
        <enum name="normal" value="0" />
@@ -2999,6 +3002,8 @@
        <attr name="textStyle" />
        <!-- Typeface (normal, sans, serif, monospace) for the text. -->
        <attr name="typeface" />
        <!-- Font family (named by string) for the text. -->
        <attr name="fontFamily" />
        <!-- Color of the text selection highlight. -->
        <attr name="textColorHighlight" />
        <!-- Color of the hint text. -->
@@ -3044,6 +3049,8 @@
        <attr name="typeface" />
        <!-- Style (bold, italic, bolditalic) for the text. -->
        <attr name="textStyle" />
        <!-- Font family (named by string) for the text. -->
        <attr name="fontFamily" />
        <!-- Text color for links. -->
        <attr name="textColorLink" />
        <!-- Makes the cursor visible (the default) or invisible. -->
+2 −1
Original line number Diff line number Diff line
@@ -3605,11 +3605,12 @@
  <public type="attr" name="isolatedProcess" id="0x010103a9" />
  <public type="attr" name="importantForAccessibility" id="0x010103aa" />
  <public type="attr" name="kcm" id="0x010103ab" />
  <public type="attr" name="fontFamily" id="0x010103ac" />

<!-- ===============================================================
     Resources added in version 17 of the platform (Jelly Bean MRx?)
     =============================================================== -->
  <public type="attr" name="supportsRtl" id="0x010103ac" />
  <public type="attr" name="supportsRtl" id="0x010103ad" />
  <public type="attr" name="textDirection"/>
  <public type="attr" name="textAlignment"/>
  <public type="attr" name="layoutDirection" />