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

Commit a008ea67 authored by Jon Miranda's avatar Jon Miranda Committed by Android (Google) Code Review
Browse files

Merge "Exposes more properties to assist in evaluating contrast ratios."

parents ef6a8cc0 a25dc428
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -279,6 +279,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    private ColorStateList mTextColor;
    private ColorStateList mHintTextColor;
    private ColorStateList mLinkTextColor;
    @ViewDebug.ExportedProperty(category = "text")
    private int mCurTextColor;
    private int mCurHintTextColor;
    private boolean mFreezesText;
@@ -2518,6 +2519,26 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        return mTextPaint.getTextSize();
    }

    /**
     * @return the size (in scaled pixels) of thee default text size in this TextView.
     * @hide
     */
    @ViewDebug.ExportedProperty(category = "text")
    public float getScaledTextSize() {
        return mTextPaint.getTextSize() / mTextPaint.density;
    }

    /** @hide */
    @ViewDebug.ExportedProperty(category = "text", mapping = {
            @ViewDebug.IntToString(from = Typeface.NORMAL, to = "NORMAL"),
            @ViewDebug.IntToString(from = Typeface.BOLD, to = "BOLD"),
            @ViewDebug.IntToString(from = Typeface.ITALIC, to = "ITALIC"),
            @ViewDebug.IntToString(from = Typeface.BOLD_ITALIC, to = "BOLD_ITALIC")
    })
    public int getTypefaceStyle() {
        return mTextPaint.getTypeface().getStyle();
    }

    /**
     * Set the default text size to the given value, interpreted as "scaled
     * pixel" units.  This size is adjusted based on the current density and