diff options
| -rw-r--r-- | src/com/android/ex/chips/BaseRecipientAdapter.java | 4 | ||||
| -rw-r--r-- | src/com/android/ex/chips/recipientchip/ReplacementDrawableSpan.java | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/com/android/ex/chips/BaseRecipientAdapter.java b/src/com/android/ex/chips/BaseRecipientAdapter.java index b3474bb..151bdcd 100644 --- a/src/com/android/ex/chips/BaseRecipientAdapter.java +++ b/src/com/android/ex/chips/BaseRecipientAdapter.java @@ -256,7 +256,7 @@ public class BaseRecipientAdapter extends BaseAdapter implements Filterable, Acc results.values = new DefaultFilterResult( entries, entryMap, nonAggregatedEntries, existingDestinations, paramsList); - results.count = 1; + results.count = entries.size(); } } finally { if (defaultDirectoryCursor != null) { @@ -382,7 +382,7 @@ public class BaseRecipientAdapter extends BaseAdapter implements Filterable, Acc } if (!tempEntries.isEmpty()) { results.values = tempEntries; - results.count = 1; + results.count = tempEntries.size(); } } 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; |
