Reuse Paint in MediaView

This commit is contained in:
Christopher Eby 2010-04-10 16:09:41 -05:00
parent 5a08592a92
commit f17661f161

View File

@ -200,6 +200,7 @@ public class MediaAdapter extends CursorAdapter implements FilterQueryProvider {
static int mTextSize = -1; static int mTextSize = -1;
static Bitmap mExpander = null; static Bitmap mExpander = null;
static Paint mPaint;
int mViewHeight = -1; int mViewHeight = -1;
@ -251,9 +252,13 @@ public class MediaAdapter extends CursorAdapter implements FilterQueryProvider {
int height = getHeight(); int height = getHeight();
int padding = mTextSize / 2; int padding = mTextSize / 2;
Paint paint = new Paint(); if (mPaint == null) {
paint.setTextSize(mTextSize); mPaint = new Paint();
paint.setAntiAlias(true); mPaint.setTextSize(mTextSize);
mPaint.setAntiAlias(true);
}
Paint paint = mPaint;
if (mExpandable) { if (mExpandable) {
width -= padding * 3 + mExpander.getWidth(); width -= padding * 3 + mExpander.getWidth();