summaryrefslogtreecommitdiff
path: root/core/java/android/widget/Switch.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/widget/Switch.java')
-rw-r--r--core/java/android/widget/Switch.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java
index 471f259cc954..39bc7c2fc1f3 100644
--- a/core/java/android/widget/Switch.java
+++ b/core/java/android/widget/Switch.java
@@ -259,10 +259,12 @@ public class Switch extends CompoundButton {
// now compute what (if any) algorithmic styling is needed
int typefaceStyle = tf != null ? tf.getStyle() : 0;
int need = style & ~typefaceStyle;
+ need |= typefaceStyle & Typeface.BOLD;
mTextPaint.setFakeBoldText((need & Typeface.BOLD) != 0);
mTextPaint.setTextSkewX((need & Typeface.ITALIC) != 0 ? -0.25f : 0);
} else {
- mTextPaint.setFakeBoldText(false);
+ int typefaceStyle = tf != null ? tf.getStyle() : 0;
+ mTextPaint.setFakeBoldText((typefaceStyle & Typeface.BOLD) != 0);
mTextPaint.setTextSkewX(0);
setSwitchTypeface(tf);
}