Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +23 −1 Original line number Diff line number Diff line Loading @@ -412,6 +412,23 @@ public class BubbleExpandedView extends LinearLayout { setLayoutDirection(LAYOUT_DIRECTION_LOCALE); } /** Updates the width of the task view if it changed. */ void updateTaskViewContentWidth() { if (mTaskView != null) { int width = getContentWidth(); if (mTaskView.getWidth() != width) { FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(width, MATCH_PARENT); mTaskView.setLayoutParams(lp); } } } private int getContentWidth() { boolean isStackOnLeft = mPositioner.isStackOnLeft(mStackView.getStackPosition()); return mPositioner.getTaskViewContentWidth(isStackOnLeft); } /** * Initialize {@link BubbleController} and {@link BubbleStackView} here, this method must need * to be called after view inflate. Loading @@ -438,7 +455,12 @@ public class BubbleExpandedView extends LinearLayout { mController.getTaskViewTransitions(), mController.getSyncTransactionQueue()); mTaskView = new TaskView(mContext, mTaskViewTaskController); mTaskView.setListener(mController.getMainExecutor(), mTaskViewListener); mExpandedViewContainer.addView(mTaskView); // set a fixed width so it is not recalculated as part of a rotation. the width will be // updated manually after the rotation. FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(getContentWidth(), MATCH_PARENT); mExpandedViewContainer.addView(mTaskView, lp); bringChildToFront(mTaskView); } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java +7 −0 Original line number Diff line number Diff line Loading @@ -375,6 +375,13 @@ public class BubblePositioner { } } /** Returns the width of the task view content. */ public int getTaskViewContentWidth(boolean onLeft) { int[] paddings = getExpandedViewContainerPadding(onLeft, /* isOverflow = */ false); int pointerOffset = showBubblesVertically() ? getPointerSize() : 0; return mPositionRect.width() - paddings[0] - paddings[2] - pointerOffset; } /** Gets the y position of the expanded view if it was top-aligned. */ public float getExpandedViewYTopAligned() { final int top = getAvailableRect().top; Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +1 −0 Original line number Diff line number Diff line Loading @@ -3288,6 +3288,7 @@ public class BubbleStackView extends FrameLayout mExpandedViewContainer.setTranslationY(mPositioner.getExpandedViewY(mExpandedBubble, mPositioner.showBubblesVertically() ? p.y : p.x)); mExpandedViewContainer.setTranslationX(0f); mExpandedBubble.getExpandedView().updateTaskViewContentWidth(); mExpandedBubble.getExpandedView().updateView( mExpandedViewContainer.getLocationOnScreen()); updatePointerPosition(false /* forIme */); Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +23 −1 Original line number Diff line number Diff line Loading @@ -412,6 +412,23 @@ public class BubbleExpandedView extends LinearLayout { setLayoutDirection(LAYOUT_DIRECTION_LOCALE); } /** Updates the width of the task view if it changed. */ void updateTaskViewContentWidth() { if (mTaskView != null) { int width = getContentWidth(); if (mTaskView.getWidth() != width) { FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(width, MATCH_PARENT); mTaskView.setLayoutParams(lp); } } } private int getContentWidth() { boolean isStackOnLeft = mPositioner.isStackOnLeft(mStackView.getStackPosition()); return mPositioner.getTaskViewContentWidth(isStackOnLeft); } /** * Initialize {@link BubbleController} and {@link BubbleStackView} here, this method must need * to be called after view inflate. Loading @@ -438,7 +455,12 @@ public class BubbleExpandedView extends LinearLayout { mController.getTaskViewTransitions(), mController.getSyncTransactionQueue()); mTaskView = new TaskView(mContext, mTaskViewTaskController); mTaskView.setListener(mController.getMainExecutor(), mTaskViewListener); mExpandedViewContainer.addView(mTaskView); // set a fixed width so it is not recalculated as part of a rotation. the width will be // updated manually after the rotation. FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(getContentWidth(), MATCH_PARENT); mExpandedViewContainer.addView(mTaskView, lp); bringChildToFront(mTaskView); } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java +7 −0 Original line number Diff line number Diff line Loading @@ -375,6 +375,13 @@ public class BubblePositioner { } } /** Returns the width of the task view content. */ public int getTaskViewContentWidth(boolean onLeft) { int[] paddings = getExpandedViewContainerPadding(onLeft, /* isOverflow = */ false); int pointerOffset = showBubblesVertically() ? getPointerSize() : 0; return mPositionRect.width() - paddings[0] - paddings[2] - pointerOffset; } /** Gets the y position of the expanded view if it was top-aligned. */ public float getExpandedViewYTopAligned() { final int top = getAvailableRect().top; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +1 −0 Original line number Diff line number Diff line Loading @@ -3288,6 +3288,7 @@ public class BubbleStackView extends FrameLayout mExpandedViewContainer.setTranslationY(mPositioner.getExpandedViewY(mExpandedBubble, mPositioner.showBubblesVertically() ? p.y : p.x)); mExpandedViewContainer.setTranslationX(0f); mExpandedBubble.getExpandedView().updateTaskViewContentWidth(); mExpandedBubble.getExpandedView().updateView( mExpandedViewContainer.getLocationOnScreen()); updatePointerPosition(false /* forIme */); Loading