diff options
author | Daniel Sandler <dsandler@android.com> | 2013-06-25 15:13:26 -0400 |
---|---|---|
committer | Daniel Sandler <dsandler@android.com> | 2013-06-27 15:17:11 -0400 |
commit | e4f9891f01bdc10d8f96e4e2429e2f4d0558238b (patch) | |
tree | 3de05f7433f52bfcade535ab4aa5176675588d56 /src/com/android/launcher3/BubbleTextView.java | |
parent | fe7750b5d6cb76a3aa7b1b479e4cc243653fa0c1 (diff) | |
download | android_packages_apps_Trebuchet-e4f9891f01bdc10d8f96e4e2429e2f4d0558238b.tar.gz android_packages_apps_Trebuchet-e4f9891f01bdc10d8f96e4e2429e2f4d0558238b.tar.bz2 android_packages_apps_Trebuchet-e4f9891f01bdc10d8f96e4e2429e2f4d0558238b.zip |
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
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r-- | src/com/android/launcher3/BubbleTextView.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 7c7d93e4d..868e3acad 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -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 |