diff options
author | Deepanshu Gupta <deepanshu@google.com> | 2014-02-19 11:05:02 -0800 |
---|---|---|
committer | Deepanshu Gupta <deepanshu@google.com> | 2014-05-02 11:46:42 -0700 |
commit | bcbeaf83ca75e4a819377938fdf3ec1e07fa30a7 (patch) | |
tree | 1062ca1ac714a593d27f7c2fdd0124320a8c9275 | |
parent | 5be65fda15c6f66067da3cc623811427e9d541e4 (diff) | |
download | frameworks_base-bcbeaf83ca75e4a819377938fdf3ec1e07fa30a7.zip frameworks_base-bcbeaf83ca75e4a819377938fdf3ec1e07fa30a7.tar.gz frameworks_base-bcbeaf83ca75e4a819377938fdf3ec1e07fa30a7.tar.bz2 |
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 c63e87d53deb24c4286036313db11719173419b3)
-rw-r--r-- | tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java index 2414d70..9b291cf 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java @@ -103,6 +103,9 @@ public final class Typeface_Delegate { if (familyName == null) { familyName = DEFAULT_FAMILY; } + if (style < 0) { + style = Typeface.NORMAL; + } Typeface_Delegate newDelegate = new Typeface_Delegate(familyName, style); if (sFontLoader != null) { |