Set default text style in layoutlib as NORMAL [DO NOT MERGE]

If a style doesn't specify text style (normal/bold/italic/bold-italic)
then default to normal instead of throwing an error.

Bug: http://b.android.com/61358
Change-Id: I0138c73807a5ff6e4d938a99ece3044333110aa1
(cherry-picked from c63e87d53d)
This commit is contained in:
Deepanshu Gupta
2014-02-19 11:05:02 -08:00
parent 5be65fda15
commit bcbeaf83ca

View File

@@ -103,6 +103,9 @@ public final class Typeface_Delegate {
if (familyName == null) { if (familyName == null) {
familyName = DEFAULT_FAMILY; familyName = DEFAULT_FAMILY;
} }
if (style < 0) {
style = Typeface.NORMAL;
}
Typeface_Delegate newDelegate = new Typeface_Delegate(familyName, style); Typeface_Delegate newDelegate = new Typeface_Delegate(familyName, style);
if (sFontLoader != null) { if (sFontLoader != null) {