Fix textStyle being ignored for Font resources in TextView
When a font resource is set via fontFamily, the textStyle attribute was being ignored. Bug: 36505747 Test: cts attached in topic Change-Id: I6418297d9a289460a3b36c6883441ac48ea33b22
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user