summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Miranda <jonmiranda@google.com>2017-08-02 19:41:58 +0000
committerJonathan Miranda <jonmiranda@google.com>2017-08-02 19:41:58 +0000
commit00abdaca619d3a91aad9f9cc2c192650705c6b98 (patch)
treee249c696a8b64e8ac05f0311984d2b1671edaeb1
parent95de553bcb319610cca04c6106281d691fbb156d (diff)
parent7f522a25c39ceb35aa009f029abe74497f03c403 (diff)
downloadandroid_packages_apps_Trebuchet-00abdaca619d3a91aad9f9cc2c192650705c6b98.zip
android_packages_apps_Trebuchet-00abdaca619d3a91aad9f9cc2c192650705c6b98.tar.gz
android_packages_apps_Trebuchet-00abdaca619d3a91aad9f9cc2c192650705c6b98.tar.bz2
[automerger] Optimizations to reduce all apps jank. am: 7f522a25c3
Change-Id: Ia2f5fd2f8be050b32fa6b25fef9f3f54b1501c2b
-rw-r--r--src/com/android/launcher3/BubbleTextView.java3
-rw-r--r--src/com/android/launcher3/LauncherStateTransitionAnimation.java6
-rw-r--r--src/com/android/launcher3/WorkspaceStateTransitionAnimation.java36
3 files changed, 29 insertions, 16 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index aeb82b3..a63767c 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -592,6 +592,9 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver {
mIconLoadRequest = null;
mDisableRelayout = true;
+ // Optimization: Starting in N, pre-uploads the bitmap to RenderThread.
+ info.iconBitmap.prepareToDraw();
+
if (info instanceof AppInfo) {
applyFromApplicationInfo((AppInfo) info);
} else if (info instanceof ShortcutInfo) {
diff --git a/src/com/android/launcher3/LauncherStateTransitionAnimation.java b/src/com/android/launcher3/LauncherStateTransitionAnimation.java
index 44b9704..9ff61ec 100644
--- a/src/com/android/launcher3/LauncherStateTransitionAnimation.java
+++ b/src/com/android/launcher3/LauncherStateTransitionAnimation.java
@@ -338,8 +338,10 @@ public class LauncherStateTransitionAnimation {
toView.post(new StartAnimRunnable(animation, toView));
mCurrentAnimation = animation;
} else if (animType == PULLUP) {
- // We are animating the content view alpha, so ensure we have a layer for it
- layerViews.addView(contentView);
+ if (!FeatureFlags.LAUNCHER3_PHYSICS) {
+ // We are animating the content view alpha, so ensure we have a layer for it.
+ layerViews.addView(contentView);
+ }
animation.addListener(new AnimatorListenerAdapter() {
@Override
diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
index 32deaf2..76772dc 100644
--- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
+++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
@@ -274,7 +274,6 @@ public class WorkspaceStateTransitionAnimation {
1.0f : 0f;
float finalHotseatAlpha = (states.stateIsNormal || states.stateIsSpringLoaded ||
(FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && states.stateIsNormalHidden)) ? 1f : 0f;
- float finalOverviewPanelAlpha = states.stateIsOverview ? 1f : 0f;
float finalQsbAlpha = (states.stateIsNormal ||
(FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && states.stateIsNormalHidden)) ? 1f : 0f;
@@ -359,38 +358,47 @@ public class WorkspaceStateTransitionAnimation {
final ViewGroup overviewPanel = mLauncher.getOverviewPanel();
+ float finalOverviewPanelAlpha = states.stateIsOverview ? 1f : 0f;
if (animated) {
+ // This is true when transitioning between:
+ // - Overview <-> Workspace
+ // - Overview <-> Widget Tray
+ if (finalOverviewPanelAlpha != overviewPanel.getAlpha()) {
+ Animator overviewPanelAlpha = ObjectAnimator.ofFloat(
+ overviewPanel, View.ALPHA, finalOverviewPanelAlpha);
+ overviewPanelAlpha.addListener(new AlphaUpdateListener(overviewPanel,
+ accessibilityEnabled));
+ layerViews.addView(overviewPanel);
+
+ if (states.overviewToWorkspace) {
+ overviewPanelAlpha.setInterpolator(new DecelerateInterpolator(2));
+ } else if (states.workspaceToOverview) {
+ overviewPanelAlpha.setInterpolator(null);
+ }
+
+ overviewPanelAlpha.setDuration(duration);
+ mStateAnimator.play(overviewPanelAlpha);
+ }
+
Animator scale = LauncherAnimUtils.ofPropertyValuesHolder(mWorkspace,
new PropertyListBuilder().scale(mNewScale)
.translationY(finalWorkspaceTranslationY).build())
.setDuration(duration);
scale.setInterpolator(mZoomInInterpolator);
mStateAnimator.play(scale);
- Animator hotseatAlpha = mWorkspace.createHotseatAlphaAnimator(finalHotseatAlpha);
-
- Animator overviewPanelAlpha = ObjectAnimator.ofFloat(
- overviewPanel, View.ALPHA, finalOverviewPanelAlpha);
- overviewPanelAlpha.addListener(new AlphaUpdateListener(overviewPanel,
- accessibilityEnabled));
// For animation optimization, we may need to provide the Launcher transition
// with a set of views on which to force build and manage layers in certain scenarios.
- layerViews.addView(overviewPanel);
layerViews.addView(mLauncher.getHotseat());
layerViews.addView(mWorkspace.getPageIndicator());
+ Animator hotseatAlpha = mWorkspace.createHotseatAlphaAnimator(finalHotseatAlpha);
if (states.workspaceToOverview) {
hotseatAlpha.setInterpolator(new DecelerateInterpolator(2));
- overviewPanelAlpha.setInterpolator(null);
} else if (states.overviewToWorkspace) {
hotseatAlpha.setInterpolator(null);
- overviewPanelAlpha.setInterpolator(new DecelerateInterpolator(2));
}
-
- overviewPanelAlpha.setDuration(duration);
hotseatAlpha.setDuration(duration);
-
- mStateAnimator.play(overviewPanelAlpha);
mStateAnimator.play(hotseatAlpha);
mStateAnimator.addListener(new AnimatorListenerAdapter() {
boolean canceled = false;