From 789e9c04bf4942b1674fac21932561dbb4f93779 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Mon, 28 Mar 2016 16:00:09 -0400 Subject: [PATCH] QS Anim tweaks Change-Id: Ic1c3b3c9554dea2b608edfd1b11d255eee38b1ef --- .../com/android/systemui/qs/QSAnimator.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java b/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java index 815c6797e0dd3..0b6eabaf6e573 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java @@ -41,7 +41,7 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha private static final String MOVE_FULL_ROWS = "sysui_qs_move_whole_rows"; public static final float EXPANDED_TILE_DELAY = .7f; - private static final float LAST_ROW_EXPANDED_DELAY = .84f; + private static final float LAST_ROW_EXPANDED_DELAY = .86f; private final ArrayList mAllViews = new ArrayList<>(); private final ArrayList mTopFiveQs = new ArrayList<>(); @@ -139,7 +139,9 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha int count = 0; int[] loc1 = new int[2]; int[] loc2 = new int[2]; + int lastXDiff = 0; int lastYDiff = 0; + int lastX = 0; clearAnimationState(); mAllViews.clear(); @@ -155,10 +157,12 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha // Quick tiles. QSTileBaseView quickTileView = mQuickQsPanel.getTileView(tile); + lastX = loc1[0]; getRelativePosition(loc1, quickTileView.getIcon(), mQsContainer); getRelativePosition(loc2, tileIcon, mQsContainer); final int xDiff = loc2[0] - loc1[0]; final int yDiff = loc2[1] - loc1[1]; + lastXDiff = loc1[0] - lastX; lastYDiff = yDiff; // Move the quick tile right from its location to the new one. translationXBuilder.addFloat(quickTileView, "translationX", 0, xDiff); @@ -177,9 +181,20 @@ public class QSAnimator implements Callback, PageListener, Listener, OnLayoutCha mAllViews.add(tileIcon); mAllViews.add(quickTileView); } else if (mFullRows && isIconInAnimatedRow(count)) { + // TODO: Refactor some of this, it shares a lot with the above block. + // Move the last tile position over by the last difference between quick tiles. + // This makes the extra icons seems as if they are coming from positions in the + // quick panel. + loc1[0] += lastXDiff; + getRelativePosition(loc2, tileIcon, mQsContainer); + final int xDiff = loc2[0] - loc1[0]; + final int yDiff = loc2[1] - loc1[1]; + firstPageBuilder.addFloat(tileView, "translationY", mQsPanel.getHeight(), 0); - translationYBuilder.addFloat(label, "translationY", -lastYDiff, 0); - translationYBuilder.addFloat(tileIcon, "translationY", -lastYDiff, 0); + translationXBuilder.addFloat(tileView, "translationX", -xDiff, 0); + translationYBuilder.addFloat(label, "translationY", -yDiff, 0); + translationYBuilder.addFloat(tileIcon, "translationY", -yDiff, 0); + mAllViews.add(tileIcon); } else { lastRowBuilder.addFloat(tileView, "alpha", 0, 1);