summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2015-02-13 11:54:58 -0800
committerRajesh Yengisetty <rajesh@cyngn.com>2015-02-19 19:15:21 +0000
commit4c3b2364453fb21dc3f3f8a70e1bcc64e500d83d (patch)
tree425a457a4b246502ca16b66ae81e79954345dbb5 /src
parent53dafb80e1773cfaba8c82961c0c3b6de8530c9f (diff)
downloadandroid_packages_apps_Trebuchet-4c3b2364453fb21dc3f3f8a70e1bcc64e500d83d.tar.gz
android_packages_apps_Trebuchet-4c3b2364453fb21dc3f3f8a70e1bcc64e500d83d.tar.bz2
android_packages_apps_Trebuchet-4c3b2364453fb21dc3f3f8a70e1bcc64e500d83d.zip
Performance improvement for launch latency
Change-Id: I8487f4e0a1a4a57f684454fd0492134602c01057
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/BubbleTextView.java9
-rw-r--r--src/com/android/launcher3/FastBitmapDrawable.java2
2 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index a368796bd..5bc17b674 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -51,6 +51,7 @@ public class BubbleTextView extends TextView {
private HolographicOutlineHelper mOutlineHelper;
private Bitmap mPressedBackground;
+ private boolean mUseFullClickAnimation = false;
private float mSlop;
@@ -109,6 +110,8 @@ public class BubbleTextView extends TextView {
if (mCustomShadowsEnabled) {
setShadowLayer(SHADOW_LARGE_RADIUS, 0.0f, SHADOW_Y_OFFSET, SHADOW_LARGE_COLOUR);
}
+ mUseFullClickAnimation = getResources().getBoolean(
+ R.bool.preferences_interface_general_app_icon_animation);
}
public void applyFromShortcutInfo(ShortcutInfo info, IconCache iconCache,
@@ -204,7 +207,7 @@ public class BubbleTextView extends TextView {
// So that the pressed outline is visible immediately on setStayPressed(),
// we pre-create it on ACTION_DOWN (it takes a small but perceptible amount of time
// to create it)
- if (mPressedBackground == null) {
+ if (mUseFullClickAnimation && mPressedBackground == null) {
mPressedBackground = mOutlineHelper.createMediumDropShadow(this);
}
@@ -236,7 +239,7 @@ public class BubbleTextView extends TextView {
}
// Only show the shadow effect when persistent pressed state is set.
- if (getParent() instanceof ShortcutAndWidgetContainer) {
+ if (mUseFullClickAnimation && getParent() instanceof ShortcutAndWidgetContainer) {
CellLayout layout = (CellLayout) getParent().getParent();
layout.setPressedIcon(this, mPressedBackground, mOutlineHelper.shadowBitmapPadding);
}
@@ -253,7 +256,7 @@ public class BubbleTextView extends TextView {
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (super.onKeyDown(keyCode, event)) {
// Pre-create shadow so show immediately on click.
- if (mPressedBackground == null) {
+ if (mUseFullClickAnimation && mPressedBackground == null) {
mPressedBackground = mOutlineHelper.createMediumDropShadow(this);
}
return true;
diff --git a/src/com/android/launcher3/FastBitmapDrawable.java b/src/com/android/launcher3/FastBitmapDrawable.java
index d13f66a7c..e9c7a045a 100644
--- a/src/com/android/launcher3/FastBitmapDrawable.java
+++ b/src/com/android/launcher3/FastBitmapDrawable.java
@@ -47,7 +47,7 @@ class FastBitmapDrawable extends Drawable {
}
}
};
- static final long CLICK_FEEDBACK_DURATION = 2000;
+ static final long CLICK_FEEDBACK_DURATION = 150;
private static final int PRESSED_BRIGHTNESS = 100;
private static ColorMatrix sGhostModeMatrix;