Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +6 −1 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.protolog.common.ProtoLog; import com.android.internal.statusbar.IStatusBarService; import com.android.launcher3.icons.BubbleIconFactory; import com.android.wm.shell.Flags; import com.android.wm.shell.R; import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.WindowManagerShellWrapper; Loading Loading @@ -1866,7 +1867,11 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void bubbleOverflowChanged(boolean hasBubbles) { // TODO (b/334175587): tell stack view to hide / show the overflow if (Flags.enableOptionalBubbleOverflow()) { if (mStackView != null) { mStackView.showOverflow(hasBubbles); } } } }; Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java +4 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.android.internal.protolog.common.ProtoLog; import com.android.internal.util.ContrastColorUtil; import com.android.wm.shell.Flags; import com.android.wm.shell.R; import java.util.ArrayList; Loading Loading @@ -195,7 +196,9 @@ public class BubbleOverflowContainerView extends LinearLayout { } void updateEmptyStateVisibility() { mEmptyState.setVisibility(mOverflowBubbles.isEmpty() ? View.VISIBLE : View.GONE); boolean showEmptyState = mOverflowBubbles.isEmpty() && !Flags.enableOptionalBubbleOverflow(); mEmptyState.setVisibility(showEmptyState ? View.VISIBLE : View.GONE); mRecyclerView.setVisibility(mOverflowBubbles.isEmpty() ? View.GONE : View.VISIBLE); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +67 −35 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.policy.ScreenDecorationsUtils; import com.android.internal.protolog.common.ProtoLog; import com.android.internal.util.FrameworkStatsLog; import com.android.wm.shell.Flags; import com.android.wm.shell.R; import com.android.wm.shell.animation.Interpolators; import com.android.wm.shell.bubbles.BubblesNavBarMotionEventHandler.MotionEventListener; Loading Loading @@ -863,6 +864,7 @@ public class BubbleStackView extends FrameLayout } }; private boolean mShowingOverflow; private BubbleOverflow mBubbleOverflow; private StackEducationView mStackEduView; private StackEducationView.Manager mStackEducationViewManager; Loading Loading @@ -992,18 +994,12 @@ public class BubbleStackView extends FrameLayout mBubbleOverflow = mBubbleData.getOverflow(); resetOverflowView(); mBubbleContainer.addView(mBubbleOverflow.getIconView(), mBubbleContainer.getChildCount() /* index */, new FrameLayout.LayoutParams(mPositioner.getBubbleSize(), mPositioner.getBubbleSize())); updateOverflow(); mBubbleOverflow.getIconView().setOnClickListener((View v) -> { mBubbleData.setShowingOverflow(true); mBubbleData.setSelectedBubble(mBubbleOverflow); mBubbleData.setExpanded(true); }); if (Flags.enableOptionalBubbleOverflow()) { showOverflow(mBubbleData.hasOverflowBubbles()); } else { mShowingOverflow = true; // if the flags not on this is always true setUpOverflow(); } mScrim = new View(getContext()); mScrim.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); mScrim.setBackgroundDrawable(new ColorDrawable( Loading Loading @@ -1220,6 +1216,19 @@ public class BubbleStackView extends FrameLayout } }; private void setUpOverflow() { resetOverflowView(); mBubbleContainer.addView(mBubbleOverflow.getIconView(), mBubbleContainer.getChildCount() /* index */, new FrameLayout.LayoutParams(mBubbleSize, mBubbleSize)); updateOverflow(); mBubbleOverflow.getIconView().setOnClickListener((View v) -> { mBubbleData.setShowingOverflow(true); mBubbleData.setSelectedBubble(mBubbleOverflow); mBubbleData.setExpanded(true); }); } private void setUpDismissView() { if (mDismissView != null) { removeView(mDismissView); Loading Loading @@ -1458,24 +1467,56 @@ public class BubbleStackView extends FrameLayout b.getExpandedView().updateFontSize(); } } if (mBubbleOverflow != null && mBubbleOverflow.getExpandedView() != null) { if (mShowingOverflow && mBubbleOverflow != null && mBubbleOverflow.getExpandedView() != null) { mBubbleOverflow.getExpandedView().updateFontSize(); } } void updateLocale() { if (mBubbleOverflow != null && mBubbleOverflow.getExpandedView() != null) { if (mShowingOverflow && mBubbleOverflow != null && mBubbleOverflow.getExpandedView() != null) { mBubbleOverflow.getExpandedView().updateLocale(); } } private void updateOverflow() { mBubbleOverflow.update(); if (mShowingOverflow) { mBubbleContainer.reorderView(mBubbleOverflow.getIconView(), mBubbleContainer.getChildCount() - 1 /* index */); } updateOverflowVisibility(); } private void updateOverflowVisibility() { mBubbleOverflow.setVisible(mShowingOverflow && (mIsExpanded || mBubbleData.isShowingOverflow()) ? VISIBLE : GONE); } private void updateOverflowDotVisibility(boolean expanding) { if (mShowingOverflow && mBubbleOverflow.showDot()) { mBubbleOverflow.getIconView().animateDotScale(expanding ? 1 : 0f, () -> { mBubbleOverflow.setVisible(expanding ? VISIBLE : GONE); }); } } /** Sets whether the overflow should be visible or not. */ public void showOverflow(boolean showOverflow) { if (!Flags.enableOptionalBubbleOverflow()) return; if (mShowingOverflow != showOverflow) { mShowingOverflow = showOverflow; if (showOverflow) { setUpOverflow(); } else if (mBubbleOverflow != null) { resetOverflowView(); } } } /** * Handle theme changes. */ Loading Loading @@ -1535,7 +1576,10 @@ public class BubbleStackView extends FrameLayout b.getExpandedView().updateDimensions(); } } mBubbleOverflow.getIconView().setLayoutParams(new LayoutParams(mBubbleSize, mBubbleSize)); if (mShowingOverflow) { mBubbleOverflow.getIconView().setLayoutParams( new LayoutParams(mBubbleSize, mBubbleSize)); } mExpandedAnimationController.updateResources(); mStackAnimationController.updateResources(); mDismissView.updateResources(); Loading Loading @@ -1699,7 +1743,7 @@ public class BubbleStackView extends FrameLayout bubble.getIconView().setContentDescription(getResources().getString( R.string.bubble_content_description_single, titleStr, appName)); } else { final int moreCount = mBubbleContainer.getChildCount() - 1; final int moreCount = getBubbleCount(); bubble.getIconView().setContentDescription(getResources().getString( R.string.bubble_content_description_stack, titleStr, appName, moreCount)); Loading Loading @@ -1752,7 +1796,8 @@ public class BubbleStackView extends FrameLayout View bubbleOverflowIconView = mBubbleOverflow != null ? mBubbleOverflow.getIconView() : null; if (bubbleOverflowIconView != null && !mBubbleData.getBubbles().isEmpty()) { if (mShowingOverflow && bubbleOverflowIconView != null && !mBubbleData.getBubbles().isEmpty()) { Bubble lastBubble = mBubbleData.getBubbles().get(mBubbleData.getBubbles().size() - 1); View lastBubbleIconView = lastBubble.getIconView(); Loading Loading @@ -1928,20 +1973,6 @@ public class BubbleStackView extends FrameLayout } } private void updateOverflowVisibility() { mBubbleOverflow.setVisible((mIsExpanded || mBubbleData.isShowingOverflow()) ? VISIBLE : GONE); } private void updateOverflowDotVisibility(boolean expanding) { if (mBubbleOverflow.showDot()) { mBubbleOverflow.getIconView().animateDotScale(expanding ? 1 : 0f, () -> { mBubbleOverflow.setVisible(expanding ? VISIBLE : GONE); }); } } // via BubbleData.Listener void updateBubble(Bubble bubble) { animateInFlyoutForBubble(bubble); Loading Loading @@ -3428,8 +3459,9 @@ public class BubbleStackView extends FrameLayout * @return the number of bubbles in the stack view. */ public int getBubbleCount() { // Subtract 1 for the overflow button that is always in the bubble container. return mBubbleContainer.getChildCount() - 1; final int childCount = mBubbleContainer.getChildCount(); // Subtract 1 for the overflow button if it's showing. return mShowingOverflow ? childCount - 1 : childCount; } /** Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +6 −1 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.protolog.common.ProtoLog; import com.android.internal.statusbar.IStatusBarService; import com.android.launcher3.icons.BubbleIconFactory; import com.android.wm.shell.Flags; import com.android.wm.shell.R; import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.WindowManagerShellWrapper; Loading Loading @@ -1866,7 +1867,11 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void bubbleOverflowChanged(boolean hasBubbles) { // TODO (b/334175587): tell stack view to hide / show the overflow if (Flags.enableOptionalBubbleOverflow()) { if (mStackView != null) { mStackView.showOverflow(hasBubbles); } } } }; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java +4 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.android.internal.protolog.common.ProtoLog; import com.android.internal.util.ContrastColorUtil; import com.android.wm.shell.Flags; import com.android.wm.shell.R; import java.util.ArrayList; Loading Loading @@ -195,7 +196,9 @@ public class BubbleOverflowContainerView extends LinearLayout { } void updateEmptyStateVisibility() { mEmptyState.setVisibility(mOverflowBubbles.isEmpty() ? View.VISIBLE : View.GONE); boolean showEmptyState = mOverflowBubbles.isEmpty() && !Flags.enableOptionalBubbleOverflow(); mEmptyState.setVisibility(showEmptyState ? View.VISIBLE : View.GONE); mRecyclerView.setVisibility(mOverflowBubbles.isEmpty() ? View.GONE : View.VISIBLE); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +67 −35 Original line number Diff line number Diff line Loading @@ -80,6 +80,7 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.policy.ScreenDecorationsUtils; import com.android.internal.protolog.common.ProtoLog; import com.android.internal.util.FrameworkStatsLog; import com.android.wm.shell.Flags; import com.android.wm.shell.R; import com.android.wm.shell.animation.Interpolators; import com.android.wm.shell.bubbles.BubblesNavBarMotionEventHandler.MotionEventListener; Loading Loading @@ -863,6 +864,7 @@ public class BubbleStackView extends FrameLayout } }; private boolean mShowingOverflow; private BubbleOverflow mBubbleOverflow; private StackEducationView mStackEduView; private StackEducationView.Manager mStackEducationViewManager; Loading Loading @@ -992,18 +994,12 @@ public class BubbleStackView extends FrameLayout mBubbleOverflow = mBubbleData.getOverflow(); resetOverflowView(); mBubbleContainer.addView(mBubbleOverflow.getIconView(), mBubbleContainer.getChildCount() /* index */, new FrameLayout.LayoutParams(mPositioner.getBubbleSize(), mPositioner.getBubbleSize())); updateOverflow(); mBubbleOverflow.getIconView().setOnClickListener((View v) -> { mBubbleData.setShowingOverflow(true); mBubbleData.setSelectedBubble(mBubbleOverflow); mBubbleData.setExpanded(true); }); if (Flags.enableOptionalBubbleOverflow()) { showOverflow(mBubbleData.hasOverflowBubbles()); } else { mShowingOverflow = true; // if the flags not on this is always true setUpOverflow(); } mScrim = new View(getContext()); mScrim.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); mScrim.setBackgroundDrawable(new ColorDrawable( Loading Loading @@ -1220,6 +1216,19 @@ public class BubbleStackView extends FrameLayout } }; private void setUpOverflow() { resetOverflowView(); mBubbleContainer.addView(mBubbleOverflow.getIconView(), mBubbleContainer.getChildCount() /* index */, new FrameLayout.LayoutParams(mBubbleSize, mBubbleSize)); updateOverflow(); mBubbleOverflow.getIconView().setOnClickListener((View v) -> { mBubbleData.setShowingOverflow(true); mBubbleData.setSelectedBubble(mBubbleOverflow); mBubbleData.setExpanded(true); }); } private void setUpDismissView() { if (mDismissView != null) { removeView(mDismissView); Loading Loading @@ -1458,24 +1467,56 @@ public class BubbleStackView extends FrameLayout b.getExpandedView().updateFontSize(); } } if (mBubbleOverflow != null && mBubbleOverflow.getExpandedView() != null) { if (mShowingOverflow && mBubbleOverflow != null && mBubbleOverflow.getExpandedView() != null) { mBubbleOverflow.getExpandedView().updateFontSize(); } } void updateLocale() { if (mBubbleOverflow != null && mBubbleOverflow.getExpandedView() != null) { if (mShowingOverflow && mBubbleOverflow != null && mBubbleOverflow.getExpandedView() != null) { mBubbleOverflow.getExpandedView().updateLocale(); } } private void updateOverflow() { mBubbleOverflow.update(); if (mShowingOverflow) { mBubbleContainer.reorderView(mBubbleOverflow.getIconView(), mBubbleContainer.getChildCount() - 1 /* index */); } updateOverflowVisibility(); } private void updateOverflowVisibility() { mBubbleOverflow.setVisible(mShowingOverflow && (mIsExpanded || mBubbleData.isShowingOverflow()) ? VISIBLE : GONE); } private void updateOverflowDotVisibility(boolean expanding) { if (mShowingOverflow && mBubbleOverflow.showDot()) { mBubbleOverflow.getIconView().animateDotScale(expanding ? 1 : 0f, () -> { mBubbleOverflow.setVisible(expanding ? VISIBLE : GONE); }); } } /** Sets whether the overflow should be visible or not. */ public void showOverflow(boolean showOverflow) { if (!Flags.enableOptionalBubbleOverflow()) return; if (mShowingOverflow != showOverflow) { mShowingOverflow = showOverflow; if (showOverflow) { setUpOverflow(); } else if (mBubbleOverflow != null) { resetOverflowView(); } } } /** * Handle theme changes. */ Loading Loading @@ -1535,7 +1576,10 @@ public class BubbleStackView extends FrameLayout b.getExpandedView().updateDimensions(); } } mBubbleOverflow.getIconView().setLayoutParams(new LayoutParams(mBubbleSize, mBubbleSize)); if (mShowingOverflow) { mBubbleOverflow.getIconView().setLayoutParams( new LayoutParams(mBubbleSize, mBubbleSize)); } mExpandedAnimationController.updateResources(); mStackAnimationController.updateResources(); mDismissView.updateResources(); Loading Loading @@ -1699,7 +1743,7 @@ public class BubbleStackView extends FrameLayout bubble.getIconView().setContentDescription(getResources().getString( R.string.bubble_content_description_single, titleStr, appName)); } else { final int moreCount = mBubbleContainer.getChildCount() - 1; final int moreCount = getBubbleCount(); bubble.getIconView().setContentDescription(getResources().getString( R.string.bubble_content_description_stack, titleStr, appName, moreCount)); Loading Loading @@ -1752,7 +1796,8 @@ public class BubbleStackView extends FrameLayout View bubbleOverflowIconView = mBubbleOverflow != null ? mBubbleOverflow.getIconView() : null; if (bubbleOverflowIconView != null && !mBubbleData.getBubbles().isEmpty()) { if (mShowingOverflow && bubbleOverflowIconView != null && !mBubbleData.getBubbles().isEmpty()) { Bubble lastBubble = mBubbleData.getBubbles().get(mBubbleData.getBubbles().size() - 1); View lastBubbleIconView = lastBubble.getIconView(); Loading Loading @@ -1928,20 +1973,6 @@ public class BubbleStackView extends FrameLayout } } private void updateOverflowVisibility() { mBubbleOverflow.setVisible((mIsExpanded || mBubbleData.isShowingOverflow()) ? VISIBLE : GONE); } private void updateOverflowDotVisibility(boolean expanding) { if (mBubbleOverflow.showDot()) { mBubbleOverflow.getIconView().animateDotScale(expanding ? 1 : 0f, () -> { mBubbleOverflow.setVisible(expanding ? VISIBLE : GONE); }); } } // via BubbleData.Listener void updateBubble(Bubble bubble) { animateInFlyoutForBubble(bubble); Loading Loading @@ -3428,8 +3459,9 @@ public class BubbleStackView extends FrameLayout * @return the number of bubbles in the stack view. */ public int getBubbleCount() { // Subtract 1 for the overflow button that is always in the bubble container. return mBubbleContainer.getChildCount() - 1; final int childCount = mBubbleContainer.getChildCount(); // Subtract 1 for the overflow button if it's showing. return mShowingOverflow ? childCount - 1 : childCount; } /** Loading