Loading quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +10 −6 Original line number Original line Diff line number Diff line Loading @@ -607,6 +607,8 @@ public class BubbleBarView extends FrameLayout { final float ty = (mBubbleBarBounds.height() - mIconSize) / 2f; final float ty = (mBubbleBarBounds.height() - mIconSize) / 2f; final boolean animate = getVisibility() == VISIBLE; final boolean animate = getVisibility() == VISIBLE; final boolean onLeft = mBubbleBarLocation.isOnLeft(isLayoutRtl()); final boolean onLeft = mBubbleBarLocation.isOnLeft(isLayoutRtl()); // elevation state is opposite to widthState - when expanded all icons are flat float elevationState = (1 - widthState); for (int i = 0; i < bubbleCount; i++) { for (int i = 0; i < bubbleCount; i++) { BubbleView bv = (BubbleView) getChildAt(i); BubbleView bv = (BubbleView) getChildAt(i); bv.setTranslationY(ty); bv.setTranslationY(ty); Loading @@ -625,17 +627,20 @@ public class BubbleBarView extends FrameLayout { expandedX = i * (mIconSize + mExpandedBarIconsSpacing); expandedX = i * (mIconSize + mExpandedBarIconsSpacing); collapsedX = i == 0 ? 0 : mIconOverlapAmount; collapsedX = i == 0 ? 0 : mIconOverlapAmount; } } if (bv == mDraggedBubbleView) { // if bubble is dragged set the elevation to bubble drag elevation bv.setZ(mDragElevation); } else { // otherwise slowly animate elevation while keeping correct Z ordering float fullElevationForChild = (MAX_BUBBLES * mBubbleElevation) - i; bv.setZ(fullElevationForChild * elevationState); } if (mIsBarExpanded) { if (mIsBarExpanded) { // If bar is on the right, account for bubble bar expanding and shifting left // If bar is on the right, account for bubble bar expanding and shifting left final float expandedBarShift = onLeft ? 0 : currentWidth - expandedWidth; final float expandedBarShift = onLeft ? 0 : currentWidth - expandedWidth; // where the bubble will end up when the animation ends // where the bubble will end up when the animation ends final float targetX = expandedX + expandedBarShift; final float targetX = expandedX + expandedBarShift; bv.setTranslationX(widthState * (targetX - collapsedX) + collapsedX); bv.setTranslationX(widthState * (targetX - collapsedX) + collapsedX); // if we're fully expanded, set the z level to 0 or to bubble elevation if dragged if (widthState == 1f) { bv.setZ(bv == mDraggedBubbleView ? mBubbleElevation : 0); } // When we're expanded, we're not stacked so we're not behind the stack // When we're expanded, we're not stacked so we're not behind the stack bv.setBehindStack(false, animate); bv.setBehindStack(false, animate); bv.setAlpha(1); bv.setAlpha(1); Loading @@ -644,7 +649,6 @@ public class BubbleBarView extends FrameLayout { final float collapsedBarShift = onLeft ? 0 : currentWidth - collapsedWidth; final float collapsedBarShift = onLeft ? 0 : currentWidth - collapsedWidth; final float targetX = collapsedX + collapsedBarShift; final float targetX = collapsedX + collapsedBarShift; bv.setTranslationX(widthState * (expandedX - targetX) + targetX); bv.setTranslationX(widthState * (expandedX - targetX) + targetX); bv.setZ((MAX_BUBBLES * mBubbleElevation) - i); // If we're not the first bubble we're behind the stack // If we're not the first bubble we're behind the stack bv.setBehindStack(i > 0, animate); bv.setBehindStack(i > 0, animate); // If we're fully collapsed, hide all bubbles except for the first 2. If there are // If we're fully collapsed, hide all bubbles except for the first 2. If there are Loading Loading
quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +10 −6 Original line number Original line Diff line number Diff line Loading @@ -607,6 +607,8 @@ public class BubbleBarView extends FrameLayout { final float ty = (mBubbleBarBounds.height() - mIconSize) / 2f; final float ty = (mBubbleBarBounds.height() - mIconSize) / 2f; final boolean animate = getVisibility() == VISIBLE; final boolean animate = getVisibility() == VISIBLE; final boolean onLeft = mBubbleBarLocation.isOnLeft(isLayoutRtl()); final boolean onLeft = mBubbleBarLocation.isOnLeft(isLayoutRtl()); // elevation state is opposite to widthState - when expanded all icons are flat float elevationState = (1 - widthState); for (int i = 0; i < bubbleCount; i++) { for (int i = 0; i < bubbleCount; i++) { BubbleView bv = (BubbleView) getChildAt(i); BubbleView bv = (BubbleView) getChildAt(i); bv.setTranslationY(ty); bv.setTranslationY(ty); Loading @@ -625,17 +627,20 @@ public class BubbleBarView extends FrameLayout { expandedX = i * (mIconSize + mExpandedBarIconsSpacing); expandedX = i * (mIconSize + mExpandedBarIconsSpacing); collapsedX = i == 0 ? 0 : mIconOverlapAmount; collapsedX = i == 0 ? 0 : mIconOverlapAmount; } } if (bv == mDraggedBubbleView) { // if bubble is dragged set the elevation to bubble drag elevation bv.setZ(mDragElevation); } else { // otherwise slowly animate elevation while keeping correct Z ordering float fullElevationForChild = (MAX_BUBBLES * mBubbleElevation) - i; bv.setZ(fullElevationForChild * elevationState); } if (mIsBarExpanded) { if (mIsBarExpanded) { // If bar is on the right, account for bubble bar expanding and shifting left // If bar is on the right, account for bubble bar expanding and shifting left final float expandedBarShift = onLeft ? 0 : currentWidth - expandedWidth; final float expandedBarShift = onLeft ? 0 : currentWidth - expandedWidth; // where the bubble will end up when the animation ends // where the bubble will end up when the animation ends final float targetX = expandedX + expandedBarShift; final float targetX = expandedX + expandedBarShift; bv.setTranslationX(widthState * (targetX - collapsedX) + collapsedX); bv.setTranslationX(widthState * (targetX - collapsedX) + collapsedX); // if we're fully expanded, set the z level to 0 or to bubble elevation if dragged if (widthState == 1f) { bv.setZ(bv == mDraggedBubbleView ? mBubbleElevation : 0); } // When we're expanded, we're not stacked so we're not behind the stack // When we're expanded, we're not stacked so we're not behind the stack bv.setBehindStack(false, animate); bv.setBehindStack(false, animate); bv.setAlpha(1); bv.setAlpha(1); Loading @@ -644,7 +649,6 @@ public class BubbleBarView extends FrameLayout { final float collapsedBarShift = onLeft ? 0 : currentWidth - collapsedWidth; final float collapsedBarShift = onLeft ? 0 : currentWidth - collapsedWidth; final float targetX = collapsedX + collapsedBarShift; final float targetX = collapsedX + collapsedBarShift; bv.setTranslationX(widthState * (expandedX - targetX) + targetX); bv.setTranslationX(widthState * (expandedX - targetX) + targetX); bv.setZ((MAX_BUBBLES * mBubbleElevation) - i); // If we're not the first bubble we're behind the stack // If we're not the first bubble we're behind the stack bv.setBehindStack(i > 0, animate); bv.setBehindStack(i > 0, animate); // If we're fully collapsed, hide all bubbles except for the first 2. If there are // If we're fully collapsed, hide all bubbles except for the first 2. If there are Loading