mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 18:06:48 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user