Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +8 −1 Original line number Diff line number Diff line Loading @@ -780,7 +780,7 @@ public class BubbleController implements ConfigurationChangeListener, try { mAddedToWindowManager = true; registerBroadcastReceiver(); mBubbleData.getOverflow().initialize(this); mBubbleData.getOverflow().initialize(this, isShowingAsBubbleBar()); // (TODO: b/273314541) some duplication in the inset listener if (isShowingAsBubbleBar()) { mWindowManager.addView(mLayerView, mWmLayoutParams); Loading Loading @@ -1077,6 +1077,13 @@ public class BubbleController implements ConfigurationChangeListener, @VisibleForTesting public void expandStackAndSelectBubbleFromLauncher(String key, boolean onLauncherHome) { mBubblePositioner.setShowingInBubbleBar(onLauncherHome); if (BubbleOverflow.KEY.equals(key)) { mBubbleData.setSelectedBubbleFromLauncher(mBubbleData.getOverflow()); mLayerView.showExpandedView(mBubbleData.getOverflow()); return; } Bubble b = mBubbleData.getAnyBubbleWithkey(key); if (b == null) { return; Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +3 −3 Original line number Diff line number Diff line Loading @@ -948,9 +948,9 @@ public class BubbleExpandedView extends LinearLayout { mTaskView.onLocationChanged(); } if (mIsOverflow) { post(() -> { mOverflowView.show(); }); // post this to the looper so that the view has a chance to be laid out before it can // calculate row and column sizes correctly. post(() -> mOverflowView.show()); } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt +30 −9 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ class BubbleOverflow(private val context: Context, private val positioner: Bubbl private val inflater: LayoutInflater = LayoutInflater.from(context) private var expandedView: BubbleExpandedView? private var bubbleBarExpandedView: BubbleBarExpandedView? = null private var overflowBtn: BadgedImageView? init { Loading @@ -53,19 +54,26 @@ class BubbleOverflow(private val context: Context, private val positioner: Bubbl } /** Call before use and again if cleanUpExpandedState was called. */ fun initialize(controller: BubbleController) { fun initialize(controller: BubbleController, forBubbleBar: Boolean) { if (forBubbleBar) { createBubbleBarExpandedView().initialize(controller, true /* isOverflow */) } else { createExpandedView() getExpandedView()?.initialize(controller, controller.stackView, true /* isOverflow */) .initialize(controller, controller.stackView, true /* isOverflow */) } } fun cleanUpExpandedState() { expandedView?.cleanUpExpandedState() expandedView = null bubbleBarExpandedView?.cleanUpExpandedState() bubbleBarExpandedView = null } fun update() { updateResources() getExpandedView()?.applyThemeAttrs() getBubbleBarExpandedView()?.applyThemeAttrs() // Apply inset and new style to fresh icon drawable. getIconView()?.setIconImageResource(R.drawable.bubble_ic_overflow_button) updateBtnTheme() Loading Loading @@ -151,26 +159,39 @@ class BubbleOverflow(private val context: Context, private val positioner: Bubbl overflowBtn?.updateDotVisibility(true /* animate */) } fun createExpandedView(): BubbleExpandedView? { expandedView = /** Creates the expanded view for bubbles showing in the stack view. */ private fun createExpandedView(): BubbleExpandedView { val view = inflater.inflate( R.layout.bubble_expanded_view, null /* root */, false /* attachToRoot */ ) as BubbleExpandedView expandedView?.applyThemeAttrs() view.applyThemeAttrs() expandedView = view updateResources() return expandedView return view } override fun getExpandedView(): BubbleExpandedView? { return expandedView } override fun getBubbleBarExpandedView(): BubbleBarExpandedView? { return null /** Creates the expanded view for bubbles showing in the bubble bar. */ private fun createBubbleBarExpandedView(): BubbleBarExpandedView { val view = inflater.inflate( R.layout.bubble_bar_expanded_view, null, /* root */ false /* attachToRoot*/ ) as BubbleBarExpandedView view.applyThemeAttrs() bubbleBarExpandedView = view return view } override fun getBubbleBarExpandedView(): BubbleBarExpandedView? = bubbleBarExpandedView override fun getDotColor(): Int { return dotColor } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java +12 −4 Original line number Diff line number Diff line Loading @@ -732,17 +732,25 @@ public class BubblePositioner { /** * How wide the expanded view should be when showing from the bubble bar. */ public int getExpandedViewWidthForBubbleBar() { return mExpandedViewLargeScreenWidth; public int getExpandedViewWidthForBubbleBar(boolean isOverflow) { return isOverflow ? mOverflowWidth : mExpandedViewLargeScreenWidth; } /** * How tall the expanded view should be when showing from the bubble bar. */ public int getExpandedViewHeightForBubbleBar() { public int getExpandedViewHeightForBubbleBar(boolean isOverflow) { return isOverflow ? mOverflowHeight : getExpandedViewBottomForBubbleBar() - mInsets.top - mExpandedViewPadding; } /** The bottom position of the expanded view when showing above the bubble bar. */ public int getExpandedViewBottomForBubbleBar() { return getAvailableRect().height() + mInsets.top - mBubbleBarSize - mExpandedViewPadding * 2 - mExpandedViewPadding - getBubbleBarHomeAdjustment(); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +0 −3 Original line number Diff line number Diff line Loading @@ -1500,9 +1500,6 @@ public class BubbleStackView extends FrameLayout getViewTreeObserver().removeOnPreDrawListener(mViewUpdater); getViewTreeObserver().removeOnDrawListener(mSystemGestureExcludeUpdater); getViewTreeObserver().removeOnComputeInternalInsetsListener(this); if (mBubbleOverflow != null) { mBubbleOverflow.cleanUpExpandedState(); } } @Override Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +8 −1 Original line number Diff line number Diff line Loading @@ -780,7 +780,7 @@ public class BubbleController implements ConfigurationChangeListener, try { mAddedToWindowManager = true; registerBroadcastReceiver(); mBubbleData.getOverflow().initialize(this); mBubbleData.getOverflow().initialize(this, isShowingAsBubbleBar()); // (TODO: b/273314541) some duplication in the inset listener if (isShowingAsBubbleBar()) { mWindowManager.addView(mLayerView, mWmLayoutParams); Loading Loading @@ -1077,6 +1077,13 @@ public class BubbleController implements ConfigurationChangeListener, @VisibleForTesting public void expandStackAndSelectBubbleFromLauncher(String key, boolean onLauncherHome) { mBubblePositioner.setShowingInBubbleBar(onLauncherHome); if (BubbleOverflow.KEY.equals(key)) { mBubbleData.setSelectedBubbleFromLauncher(mBubbleData.getOverflow()); mLayerView.showExpandedView(mBubbleData.getOverflow()); return; } Bubble b = mBubbleData.getAnyBubbleWithkey(key); if (b == null) { return; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +3 −3 Original line number Diff line number Diff line Loading @@ -948,9 +948,9 @@ public class BubbleExpandedView extends LinearLayout { mTaskView.onLocationChanged(); } if (mIsOverflow) { post(() -> { mOverflowView.show(); }); // post this to the looper so that the view has a chance to be laid out before it can // calculate row and column sizes correctly. post(() -> mOverflowView.show()); } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt +30 −9 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ class BubbleOverflow(private val context: Context, private val positioner: Bubbl private val inflater: LayoutInflater = LayoutInflater.from(context) private var expandedView: BubbleExpandedView? private var bubbleBarExpandedView: BubbleBarExpandedView? = null private var overflowBtn: BadgedImageView? init { Loading @@ -53,19 +54,26 @@ class BubbleOverflow(private val context: Context, private val positioner: Bubbl } /** Call before use and again if cleanUpExpandedState was called. */ fun initialize(controller: BubbleController) { fun initialize(controller: BubbleController, forBubbleBar: Boolean) { if (forBubbleBar) { createBubbleBarExpandedView().initialize(controller, true /* isOverflow */) } else { createExpandedView() getExpandedView()?.initialize(controller, controller.stackView, true /* isOverflow */) .initialize(controller, controller.stackView, true /* isOverflow */) } } fun cleanUpExpandedState() { expandedView?.cleanUpExpandedState() expandedView = null bubbleBarExpandedView?.cleanUpExpandedState() bubbleBarExpandedView = null } fun update() { updateResources() getExpandedView()?.applyThemeAttrs() getBubbleBarExpandedView()?.applyThemeAttrs() // Apply inset and new style to fresh icon drawable. getIconView()?.setIconImageResource(R.drawable.bubble_ic_overflow_button) updateBtnTheme() Loading Loading @@ -151,26 +159,39 @@ class BubbleOverflow(private val context: Context, private val positioner: Bubbl overflowBtn?.updateDotVisibility(true /* animate */) } fun createExpandedView(): BubbleExpandedView? { expandedView = /** Creates the expanded view for bubbles showing in the stack view. */ private fun createExpandedView(): BubbleExpandedView { val view = inflater.inflate( R.layout.bubble_expanded_view, null /* root */, false /* attachToRoot */ ) as BubbleExpandedView expandedView?.applyThemeAttrs() view.applyThemeAttrs() expandedView = view updateResources() return expandedView return view } override fun getExpandedView(): BubbleExpandedView? { return expandedView } override fun getBubbleBarExpandedView(): BubbleBarExpandedView? { return null /** Creates the expanded view for bubbles showing in the bubble bar. */ private fun createBubbleBarExpandedView(): BubbleBarExpandedView { val view = inflater.inflate( R.layout.bubble_bar_expanded_view, null, /* root */ false /* attachToRoot*/ ) as BubbleBarExpandedView view.applyThemeAttrs() bubbleBarExpandedView = view return view } override fun getBubbleBarExpandedView(): BubbleBarExpandedView? = bubbleBarExpandedView override fun getDotColor(): Int { return dotColor } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java +12 −4 Original line number Diff line number Diff line Loading @@ -732,17 +732,25 @@ public class BubblePositioner { /** * How wide the expanded view should be when showing from the bubble bar. */ public int getExpandedViewWidthForBubbleBar() { return mExpandedViewLargeScreenWidth; public int getExpandedViewWidthForBubbleBar(boolean isOverflow) { return isOverflow ? mOverflowWidth : mExpandedViewLargeScreenWidth; } /** * How tall the expanded view should be when showing from the bubble bar. */ public int getExpandedViewHeightForBubbleBar() { public int getExpandedViewHeightForBubbleBar(boolean isOverflow) { return isOverflow ? mOverflowHeight : getExpandedViewBottomForBubbleBar() - mInsets.top - mExpandedViewPadding; } /** The bottom position of the expanded view when showing above the bubble bar. */ public int getExpandedViewBottomForBubbleBar() { return getAvailableRect().height() + mInsets.top - mBubbleBarSize - mExpandedViewPadding * 2 - mExpandedViewPadding - getBubbleBarHomeAdjustment(); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +0 −3 Original line number Diff line number Diff line Loading @@ -1500,9 +1500,6 @@ public class BubbleStackView extends FrameLayout getViewTreeObserver().removeOnPreDrawListener(mViewUpdater); getViewTreeObserver().removeOnDrawListener(mSystemGestureExcludeUpdater); getViewTreeObserver().removeOnComputeInternalInsetsListener(this); if (mBubbleOverflow != null) { mBubbleOverflow.cleanUpExpandedState(); } } @Override Loading