Loading core/java/android/widget/TextView.java +21 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading Loading
core/java/android/widget/TextView.java +21 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading