diff options
author | Raph Levien <raph@google.com> | 2015-01-29 22:10:59 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-01-29 22:11:00 +0000 |
commit | af461e12a12dba8fc544fa373831368ba2c18096 (patch) | |
tree | 077aec20524b56684df78ed40fcb33068ba0dfc1 /core/java/android/widget | |
parent | 5df10e1842606f9a9a829a4779bf8f610b2d7bd9 (diff) | |
parent | 42b3024efdec647266c1ae54a2a7c2c46915b380 (diff) | |
download | frameworks_base-af461e12a12dba8fc544fa373831368ba2c18096.zip frameworks_base-af461e12a12dba8fc544fa373831368ba2c18096.tar.gz frameworks_base-af461e12a12dba8fc544fa373831368ba2c18096.tar.bz2 |
Merge "Refine resolution order for typeface and fontFamily" into lmp-mr1-dev
Diffstat (limited to 'core/java/android/widget')
-rw-r--r-- | core/java/android/widget/TextView.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index cc5d457..7dc64bd 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -658,6 +658,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener ColorStateList textColorLink = null; int textSize = 15; String fontFamily = null; + boolean fontFamilyExplicit = false; int typefaceIndex = -1; int styleIndex = -1; boolean allCaps = false; @@ -1012,6 +1013,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener case com.android.internal.R.styleable.TextView_fontFamily: fontFamily = a.getString(attr); + fontFamilyExplicit = true; break; case com.android.internal.R.styleable.TextView_password: @@ -1300,6 +1302,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener typefaceIndex = MONOSPACE; } + if (typefaceIndex != -1 && !fontFamilyExplicit) { + fontFamily = null; + } setTypefaceFromAttrs(fontFamily, typefaceIndex, styleIndex); if (shadowcolor != 0) { |