Lazily instantiate LauncherAppState.

The application context for LauncherAppState is supplied by
the application whenever it starts; don't ask for an
instance before that.

Change-Id: I1ca8ea04238a357a682f79250f08813ead7ae532
This commit is contained in:
Daniel Sandler
2013-06-25 15:13:26 -04:00
parent fe7750b5d6
commit e4f9891f01
23 changed files with 170 additions and 215 deletions

View File

@@ -45,7 +45,7 @@ public class BubbleTextView extends TextView {
private int mPrevAlpha = -1;
private final HolographicOutlineHelper mOutlineHelper = HolographicOutlineHelper.obtain();
private HolographicOutlineHelper mOutlineHelper;
private final Canvas mTempCanvas = new Canvas();
private final Rect mTempRect = new Rect();
private boolean mDidInvalidateForPressedState;
@@ -80,6 +80,8 @@ public class BubbleTextView extends TextView {
mLongPressHelper = new CheckLongPressHelper(this);
mBackground = getBackground();
mOutlineHelper = HolographicOutlineHelper.obtain(getContext());
final Resources res = getContext().getResources();
mFocusedOutlineColor = mFocusedGlowColor = mPressedOutlineColor = mPressedGlowColor =
res.getColor(android.R.color.holo_blue_light);
@@ -189,7 +191,7 @@ public class BubbleTextView extends TextView {
* Responsibility for the bitmap is transferred to the caller.
*/
private Bitmap createGlowingOutline(Canvas canvas, int outlineColor, int glowColor) {
final int padding = HolographicOutlineHelper.MAX_OUTER_BLUR_RADIUS;
final int padding = mOutlineHelper.mMaxOuterBlurRadius;
final Bitmap b = Bitmap.createBitmap(
getWidth() + padding, getHeight() + padding, Bitmap.Config.ARGB_8888);
@@ -269,7 +271,7 @@ public class BubbleTextView extends TextView {
}
int getPressedOrFocusedBackgroundPadding() {
return HolographicOutlineHelper.MAX_OUTER_BLUR_RADIUS / 2;
return mOutlineHelper.mMaxOuterBlurRadius / 2;
}
@Override