Reuse Paint in MediaView
This commit is contained in:
parent
5a08592a92
commit
f17661f161
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user