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