summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/View.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-09-12 16:59:06 -0700
committerDianne Hackborn <hackbod@google.com>2011-09-12 17:04:32 -0700
commitab0f485e64418eb22f0a1d89d7064902b381e9c2 (patch)
tree7bef4b7465521764e51c3bfc38ebd8d41721852d /core/java/android/view/View.java
parentbd5c9768c4432c6cb2bfa5f521d49ff03c087ff8 (diff)
downloadframeworks_base-ab0f485e64418eb22f0a1d89d7064902b381e9c2.zip
frameworks_base-ab0f485e64418eb22f0a1d89d7064902b381e9c2.tar.gz
frameworks_base-ab0f485e64418eb22f0a1d89d7064902b381e9c2.tar.bz2
Fix problems where we were allocating TypedArray when not needed.
Fixes up some recycling of TypedArray objects to reduce the number we need to allocate during inflation etc. Change-Id: I948dccc052997779001eaa99db2a710b04be01ae
Diffstat (limited to 'core/java/android/view/View.java')
-rw-r--r--core/java/android/view/View.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 1463e09..1cc428b 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -27,7 +27,6 @@ import android.graphics.Canvas;
import android.graphics.Interpolator;
import android.graphics.LinearGradient;
import android.graphics.Matrix;
-import android.graphics.Matrix.ScaleToFit;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Point;
@@ -2272,8 +2271,6 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
*/
int mOldHeightMeasureSpec = Integer.MIN_VALUE;
- private Resources mResources = null;
-
private Drawable mBGDrawable;
private int mBackgroundResource;
@@ -2336,6 +2333,8 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
*/
protected Context mContext;
+ private final Resources mResources;
+
private ScrollabilityCache mScrollCache;
private int[] mDrawableState = null;
@@ -3017,6 +3016,8 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
}
}
+ a.recycle();
+
setOverScrollMode(overScrollMode);
if (background != null) {
@@ -3074,14 +3075,13 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
}
computeOpaqueFlags();
-
- a.recycle();
}
/**
* Non-public constructor for use in testing
*/
View() {
+ mResources = null;
}
/**