diff options
| author | Dianne Hackborn <hackbod@google.com> | 2009-09-28 17:33:54 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2009-09-28 17:33:54 -0700 |
| commit | afa78967b8553443aa32579d78970a076d7581f6 (patch) | |
| tree | 5ba752438ef737e3b2a140b6fb42bd0bd6661091 /core/java/android/widget/TextView.java | |
| parent | ebd45e5ca9690110ecb50c26b0b791054ee4c0ef (diff) | |
Hack to fix issue #2125365: Sports Trivia compatability with Eclair
Adds a mechanism to tell Paint the scaling factor its target
canvas will have, for it to compute font metrics based on the
correct font size. Only TextView uses this, but that is enough
for the large majority of apps.
Change-Id: I6cacaa0dd26d40ee3ad959bed0028678d6e9016e
Diffstat (limited to 'core/java/android/widget/TextView.java')
| -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 37ef15377b5c..bf3d26e075ed 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -328,11 +328,16 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG); mTextPaint.density = getResources().getDisplayMetrics().density; + mTextPaint.setCompatibilityScaling( + getResources().getCompatibilityInfo().applicationScale); + // If we get the paint from the skin, we should set it to left, since // the layout always wants it to be left. // mTextPaint.setTextAlign(Paint.Align.LEFT); mHighlightPaint = new Paint(Paint.ANTI_ALIAS_FLAG); + mHighlightPaint.setCompatibilityScaling( + getResources().getCompatibilityInfo().applicationScale); mMovement = getDefaultMovementMethod(); mTransformation = null; |
