Merge "Fix textStyle being ignored for Font resources in TextView"

This commit is contained in:
Clara Bayarri
2017-03-24 11:11:16 +00:00
committed by Android (Google) Code Review

View File

@@ -2031,6 +2031,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
Typeface tf = fontTypeface;
if (tf == null && familyName != null) {
tf = Typeface.create(familyName, styleIndex);
} else if (tf != null && tf.getStyle() != styleIndex) {
tf = Typeface.create(tf, styleIndex);
}
if (tf != null) {
setTypeface(tf);