diff options
author | Winson Chung <winsonc@google.com> | 2011-11-21 12:31:42 -0800 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-11-21 12:35:41 -0800 |
commit | bb185bdd57fcdb2c8ff9eee00347b116bab7db23 (patch) | |
tree | c5e9154177a0665c5578e42ed0af3832204210e7 /src/com/android/launcher2/HolographicViewHelper.java | |
parent | 601cac2f3e2f3ce13d8e2e07dbe51945686044eb (diff) | |
download | android_packages_apps_Trebuchet-bb185bdd57fcdb2c8ff9eee00347b116bab7db23.tar.gz android_packages_apps_Trebuchet-bb185bdd57fcdb2c8ff9eee00347b116bab7db23.tar.bz2 android_packages_apps_Trebuchet-bb185bdd57fcdb2c8ff9eee00347b116bab7db23.zip |
Fixing an issue where qsb press states could be out of sync. (Bug 5627327)
- Adding haptic feedback to qsb button clicks (Bug 5652304)
Change-Id: I93d7c7a737f167d7ddf2b426d87e3a062feccac3
Diffstat (limited to 'src/com/android/launcher2/HolographicViewHelper.java')
-rw-r--r-- | src/com/android/launcher2/HolographicViewHelper.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/com/android/launcher2/HolographicViewHelper.java b/src/com/android/launcher2/HolographicViewHelper.java index 11e81b4d3..fd499082f 100644 --- a/src/com/android/launcher2/HolographicViewHelper.java +++ b/src/com/android/launcher2/HolographicViewHelper.java @@ -42,7 +42,7 @@ public class HolographicViewHelper { void generatePressedFocusedStates(ImageView v) { if (!mStatesUpdated && v != null) { mStatesUpdated = true; - Bitmap outline = createGlowingOutline(v, mTempCanvas); + Bitmap outline = createPressImage(v, mTempCanvas); FastBitmapDrawable d = new FastBitmapDrawable(outline); StateListDrawable states = new StateListDrawable(); @@ -54,10 +54,20 @@ public class HolographicViewHelper { } /** - * Returns a new bitmap to be used as the object outline, e.g. to visualize the drop location. + * Invalidates the pressed/focused states. + */ + void invalidatePressedFocusedStates(ImageView v) { + mStatesUpdated = false; + if (v != null) { + v.invalidate(); + } + } + + /** + * Creates a new press state image which is the old image with a blue overlay. * Responsibility for the bitmap is transferred to the caller. */ - private Bitmap createGlowingOutline(ImageView v, Canvas canvas) { + private Bitmap createPressImage(ImageView v, Canvas canvas) { final int padding = HolographicOutlineHelper.MAX_OUTER_BLUR_RADIUS; final Bitmap b = Bitmap.createBitmap( v.getWidth() + padding, v.getHeight() + padding, Bitmap.Config.ARGB_8888); |