Loading quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java +25 −8 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.Matrix; import android.graphics.Path; import android.graphics.Point; import android.graphics.Rect; import android.graphics.drawable.AdaptiveIconDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; Loading @@ -66,6 +68,7 @@ import com.android.launcher3.icons.BitmapInfo; import com.android.launcher3.icons.BubbleIconFactory; import com.android.launcher3.shortcuts.ShortcutRequest; import com.android.launcher3.taskbar.TaskbarControllers; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.Executors.SimpleThreadFactory; import com.android.quickstep.SystemUiProxy; import com.android.wm.shell.bubbles.IBubblesListener; Loading Loading @@ -408,8 +411,7 @@ public class BubbleBarController extends IBubblesListener.Stub { info.getFlags() | Notification.BubbleMetadata.FLAG_SUPPRESS_NOTIFICATION); mSelectedBubble.getView().updateDotVisibility(true /* animate */); } mSystemUiProxy.showBubble(getSelectedBubbleKey(), getBubbleBarOffsetX(), getBubbleBarOffsetY()); mSystemUiProxy.showBubble(getSelectedBubbleKey(), getExpandedBubbleBarDisplayBounds()); } else { Log.w(TAG, "Trying to show the selected bubble but it's null"); } Loading Loading @@ -577,12 +579,27 @@ public class BubbleBarController extends IBubblesListener.Stub { return mIconFactory.createBadgedIconBitmap(drawable).icon; } private int getBubbleBarOffsetY() { final int translation = (int) abs(mBubbleStashController.getBubbleBarTranslationY()); return translation + mBarView.getHeight(); /** * Get bounds of the bubble bar as if it would be expanded. * Calculates the bounds instead of retrieving current view location as the view may be * animating. */ private Rect getExpandedBubbleBarDisplayBounds() { Point displaySize = DisplayController.INSTANCE.get(mContext).getInfo().currentSize; Rect currentBarBounds = mBarView.getBubbleBarBounds(); Rect location = new Rect(); // currentBarBounds is only useful for distance from left or right edge. // It contains the current bounds, calculate the expanded bounds. if (mBarView.isOnLeft()) { location.left = currentBarBounds.left; location.right = (int) (currentBarBounds.left + mBarView.expandedWidth()); } else { location.left = (int) (currentBarBounds.right - mBarView.expandedWidth()); location.right = currentBarBounds.right; } private int getBubbleBarOffsetX() { return mBarView.getWidth() + mBarView.getHorizontalMargin(); final int translation = (int) abs(mBubbleStashController.getBubbleBarTranslationY()); location.top = displaySize.y - mBarView.getHeight() - translation; location.bottom = displaySize.y - translation; return location; } } quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +10 −2 Original line number Diff line number Diff line Loading @@ -205,7 +205,10 @@ public class BubbleBarView extends FrameLayout { mRelativePivotX = onLeft ? 0f : 1f; } private boolean isOnLeft() { /** * @return <code>true</code> when bar is pinned to the left edge of the screen */ public boolean isOnLeft() { return getLayoutDirection() == LAYOUT_DIRECTION_RTL; } Loading Loading @@ -509,7 +512,12 @@ public class BubbleBarView extends FrameLayout { return mIsBarExpanded; } private float expandedWidth() { /** * Get width of the bubble bar as if it would be expanded. * * @return width of the bubble bar in its expanded state, regardless of current width */ public float expandedWidth() { final int childCount = getChildCount(); final int horizontalPadding = getPaddingStart() + getPaddingEnd(); return childCount * (mIconSize + mIconSpacing) + horizontalPadding; Loading quickstep/src/com/android/quickstep/SystemUiProxy.java +3 −6 Original line number Diff line number Diff line Loading @@ -731,15 +731,12 @@ public class SystemUiProxy implements ISystemUiProxy, NavHandle { /** * Tells SysUI to show the bubble with the provided key. * @param key the key of the bubble to show. * @param bubbleBarOffsetX the offset of the bubble bar from the edge of the screen on the X * axis. * @param bubbleBarOffsetY the offset of the bubble bar from the edge of the screen on the Y * axis. * @param bubbleBarBounds bounds of the bubble bar in display coordinates */ public void showBubble(String key, int bubbleBarOffsetX, int bubbleBarOffsetY) { public void showBubble(String key, Rect bubbleBarBounds) { if (mBubbles != null) { try { mBubbles.showBubble(key, bubbleBarOffsetX, bubbleBarOffsetY); mBubbles.showBubble(key, bubbleBarBounds); } catch (RemoteException e) { Log.w(TAG, "Failed call showBubble"); } Loading Loading
quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java +25 −8 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.Matrix; import android.graphics.Path; import android.graphics.Point; import android.graphics.Rect; import android.graphics.drawable.AdaptiveIconDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; Loading @@ -66,6 +68,7 @@ import com.android.launcher3.icons.BitmapInfo; import com.android.launcher3.icons.BubbleIconFactory; import com.android.launcher3.shortcuts.ShortcutRequest; import com.android.launcher3.taskbar.TaskbarControllers; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.Executors.SimpleThreadFactory; import com.android.quickstep.SystemUiProxy; import com.android.wm.shell.bubbles.IBubblesListener; Loading Loading @@ -408,8 +411,7 @@ public class BubbleBarController extends IBubblesListener.Stub { info.getFlags() | Notification.BubbleMetadata.FLAG_SUPPRESS_NOTIFICATION); mSelectedBubble.getView().updateDotVisibility(true /* animate */); } mSystemUiProxy.showBubble(getSelectedBubbleKey(), getBubbleBarOffsetX(), getBubbleBarOffsetY()); mSystemUiProxy.showBubble(getSelectedBubbleKey(), getExpandedBubbleBarDisplayBounds()); } else { Log.w(TAG, "Trying to show the selected bubble but it's null"); } Loading Loading @@ -577,12 +579,27 @@ public class BubbleBarController extends IBubblesListener.Stub { return mIconFactory.createBadgedIconBitmap(drawable).icon; } private int getBubbleBarOffsetY() { final int translation = (int) abs(mBubbleStashController.getBubbleBarTranslationY()); return translation + mBarView.getHeight(); /** * Get bounds of the bubble bar as if it would be expanded. * Calculates the bounds instead of retrieving current view location as the view may be * animating. */ private Rect getExpandedBubbleBarDisplayBounds() { Point displaySize = DisplayController.INSTANCE.get(mContext).getInfo().currentSize; Rect currentBarBounds = mBarView.getBubbleBarBounds(); Rect location = new Rect(); // currentBarBounds is only useful for distance from left or right edge. // It contains the current bounds, calculate the expanded bounds. if (mBarView.isOnLeft()) { location.left = currentBarBounds.left; location.right = (int) (currentBarBounds.left + mBarView.expandedWidth()); } else { location.left = (int) (currentBarBounds.right - mBarView.expandedWidth()); location.right = currentBarBounds.right; } private int getBubbleBarOffsetX() { return mBarView.getWidth() + mBarView.getHorizontalMargin(); final int translation = (int) abs(mBubbleStashController.getBubbleBarTranslationY()); location.top = displaySize.y - mBarView.getHeight() - translation; location.bottom = displaySize.y - translation; return location; } }
quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +10 −2 Original line number Diff line number Diff line Loading @@ -205,7 +205,10 @@ public class BubbleBarView extends FrameLayout { mRelativePivotX = onLeft ? 0f : 1f; } private boolean isOnLeft() { /** * @return <code>true</code> when bar is pinned to the left edge of the screen */ public boolean isOnLeft() { return getLayoutDirection() == LAYOUT_DIRECTION_RTL; } Loading Loading @@ -509,7 +512,12 @@ public class BubbleBarView extends FrameLayout { return mIsBarExpanded; } private float expandedWidth() { /** * Get width of the bubble bar as if it would be expanded. * * @return width of the bubble bar in its expanded state, regardless of current width */ public float expandedWidth() { final int childCount = getChildCount(); final int horizontalPadding = getPaddingStart() + getPaddingEnd(); return childCount * (mIconSize + mIconSpacing) + horizontalPadding; Loading
quickstep/src/com/android/quickstep/SystemUiProxy.java +3 −6 Original line number Diff line number Diff line Loading @@ -731,15 +731,12 @@ public class SystemUiProxy implements ISystemUiProxy, NavHandle { /** * Tells SysUI to show the bubble with the provided key. * @param key the key of the bubble to show. * @param bubbleBarOffsetX the offset of the bubble bar from the edge of the screen on the X * axis. * @param bubbleBarOffsetY the offset of the bubble bar from the edge of the screen on the Y * axis. * @param bubbleBarBounds bounds of the bubble bar in display coordinates */ public void showBubble(String key, int bubbleBarOffsetX, int bubbleBarOffsetY) { public void showBubble(String key, Rect bubbleBarBounds) { if (mBubbles != null) { try { mBubbles.showBubble(key, bubbleBarOffsetX, bubbleBarOffsetY); mBubbles.showBubble(key, bubbleBarBounds); } catch (RemoteException e) { Log.w(TAG, "Failed call showBubble"); } Loading