diff options
| author | Jin Cao <jinyan@google.com> | 2014-09-12 18:48:45 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-12 18:48:45 +0000 |
| commit | 066a2608a922e1fc67a24589bf2c7dc61fe56eb5 (patch) | |
| tree | cecdc0302bd3afe7518eaac00dc3e7017cef9406 | |
| parent | 6c14173cdd14c5ceca9c5f6511f516c0597829b2 (diff) | |
| parent | e3267bcc4f39498ddb25f4014edf3c3b3725eae8 (diff) | |
| download | android_frameworks_opt_chips-066a2608a922e1fc67a24589bf2c7dc61fe56eb5.tar.gz android_frameworks_opt_chips-066a2608a922e1fc67a24589bf2c7dc61fe56eb5.tar.bz2 android_frameworks_opt_chips-066a2608a922e1fc67a24589bf2c7dc61fe56eb5.zip | |
am e3267bcc: Merge "Change workpaint to protected static so child classes can use it" into ub-chips-cranbrook
* commit 'e3267bcc4f39498ddb25f4014edf3c3b3725eae8':
Change workpaint to protected static so child classes can use it
| -rw-r--r-- | src/com/android/ex/chips/recipientchip/ReplacementDrawableSpan.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/ex/chips/recipientchip/ReplacementDrawableSpan.java b/src/com/android/ex/chips/recipientchip/ReplacementDrawableSpan.java index f99b25b..5ef445d 100644 --- a/src/com/android/ex/chips/recipientchip/ReplacementDrawableSpan.java +++ b/src/com/android/ex/chips/recipientchip/ReplacementDrawableSpan.java @@ -11,8 +11,9 @@ import android.text.style.ReplacementSpan; * without changing the default text size or layout. */ public class ReplacementDrawableSpan extends ReplacementSpan { + protected static final Paint sWorkPaint = new Paint(); + protected Drawable mDrawable; - private final Paint mWorkPaint = new Paint(); private float mExtraMargin; public ReplacementDrawableSpan(Drawable drawable) { @@ -25,9 +26,9 @@ public class ReplacementDrawableSpan extends ReplacementSpan { } private void setupFontMetrics(Paint.FontMetricsInt fm, Paint paint) { - mWorkPaint.set(paint); + sWorkPaint.set(paint); if (fm != null) { - mWorkPaint.getFontMetricsInt(fm); + sWorkPaint.getFontMetricsInt(fm); final Rect bounds = getBounds(); final int textHeight = fm.descent - fm.ascent; |
