From 2a48e87b2d4e8a17ccd733d6a576b74b08085383 Mon Sep 17 00:00:00 2001 From: Jin Cao Date: Fri, 12 Sep 2014 11:27:50 -0700 Subject: Change workpaint to protected static so child classes can use it b/17471973 Change-Id: I8804b429477b2d606ec760b9617eed5b4c0c0c17 --- .../android/ex/chips/recipientchip/ReplacementDrawableSpan.java | 7 ++++--- 1 file 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; -- cgit v1.2.3