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

Commit a25dc428 authored by Jon Miranda's avatar Jon Miranda Committed by Jonathan Miranda
Browse files

Exposes more properties to assist in evaluating contrast ratios.

Change-Id: I43468df4d842e03001ab33e139095afadaeacd20
parent 633f0e87
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