Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +5 −2 Original line number Diff line number Diff line Loading @@ -595,7 +595,10 @@ public class BubbleController implements ConfigurationChangeListener, * <p>If bubble bar is supported, bubble views will be updated to switch to bar mode. */ public void registerBubbleStateListener(Bubbles.BubbleStateListener listener) { if (Flags.enableBubbleBar() && mBubblePositioner.isLargeScreen() && listener != null) { final boolean bubbleBarAllowed = Flags.enableBubbleBar() && (mBubblePositioner.isLargeScreen() || Flags.enableBubbleBarOnPhones()) && listener != null; if (bubbleBarAllowed) { // Only set the listener if we can show the bubble bar. mBubbleStateListener = listener; setUpBubbleViewsForMode(); Loading Loading @@ -772,7 +775,7 @@ public class BubbleController implements ConfigurationChangeListener, /** Whether bubbles would be shown with the bubble bar UI. */ public boolean isShowingAsBubbleBar() { return Flags.enableBubbleBar() && mBubblePositioner.isLargeScreen() && (mBubblePositioner.isLargeScreen() || Flags.enableBubbleBarOnPhones()) && mBubbleStateListener != null; } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java +11 −5 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import androidx.annotation.VisibleForTesting; import com.android.internal.protolog.ProtoLog; import com.android.launcher3.icons.IconNormalizer; import com.android.wm.shell.Flags; import com.android.wm.shell.R; import com.android.wm.shell.shared.bubbles.BubbleBarLocation; import com.android.wm.shell.shared.bubbles.BubbleDropTargetBoundsProvider; Loading Loading @@ -906,7 +907,7 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { if (isOverflow) { return mOverflowHeight; } else { return getBubbleBarExpandedViewHeightForLandscape(); return getBubbleBarExpandedViewHeight(); } } Loading @@ -927,18 +928,23 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { * | bottom inset ↕ | ↓ * |----------------------| --- mScreenRect.bottom */ private int getBubbleBarExpandedViewHeightForLandscape() { private int getBubbleBarExpandedViewHeight() { int heightOfBubbleBarContainer = mScreenRect.height() - getExpandedViewBottomForBubbleBar(); int expandedViewHeight; if (Flags.enableBubbleBarOnPhones() && !mDeviceConfig.isLargeScreen()) { // we're on a phone, use the max / height expandedViewHeight = Math.max(mScreenRect.width(), mScreenRect.height()); } else { // getting landscape height from screen rect int expandedViewHeight = Math.min(mScreenRect.width(), mScreenRect.height()); expandedViewHeight = Math.min(mScreenRect.width(), mScreenRect.height()); } expandedViewHeight -= heightOfBubbleBarContainer; /* removing bubble container height */ expandedViewHeight -= mInsets.top; /* removing top inset */ expandedViewHeight -= mExpandedViewPadding; /* removing spacing */ return expandedViewHeight; } /** The bottom position of the expanded view when showing above the bubble bar. */ public int getExpandedViewBottomForBubbleBar() { return mBubbleBarTopOnScreen - mExpandedViewPadding; Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +5 −2 Original line number Diff line number Diff line Loading @@ -595,7 +595,10 @@ public class BubbleController implements ConfigurationChangeListener, * <p>If bubble bar is supported, bubble views will be updated to switch to bar mode. */ public void registerBubbleStateListener(Bubbles.BubbleStateListener listener) { if (Flags.enableBubbleBar() && mBubblePositioner.isLargeScreen() && listener != null) { final boolean bubbleBarAllowed = Flags.enableBubbleBar() && (mBubblePositioner.isLargeScreen() || Flags.enableBubbleBarOnPhones()) && listener != null; if (bubbleBarAllowed) { // Only set the listener if we can show the bubble bar. mBubbleStateListener = listener; setUpBubbleViewsForMode(); Loading Loading @@ -772,7 +775,7 @@ public class BubbleController implements ConfigurationChangeListener, /** Whether bubbles would be shown with the bubble bar UI. */ public boolean isShowingAsBubbleBar() { return Flags.enableBubbleBar() && mBubblePositioner.isLargeScreen() && (mBubblePositioner.isLargeScreen() || Flags.enableBubbleBarOnPhones()) && mBubbleStateListener != null; } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java +11 −5 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import androidx.annotation.VisibleForTesting; import com.android.internal.protolog.ProtoLog; import com.android.launcher3.icons.IconNormalizer; import com.android.wm.shell.Flags; import com.android.wm.shell.R; import com.android.wm.shell.shared.bubbles.BubbleBarLocation; import com.android.wm.shell.shared.bubbles.BubbleDropTargetBoundsProvider; Loading Loading @@ -906,7 +907,7 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { if (isOverflow) { return mOverflowHeight; } else { return getBubbleBarExpandedViewHeightForLandscape(); return getBubbleBarExpandedViewHeight(); } } Loading @@ -927,18 +928,23 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { * | bottom inset ↕ | ↓ * |----------------------| --- mScreenRect.bottom */ private int getBubbleBarExpandedViewHeightForLandscape() { private int getBubbleBarExpandedViewHeight() { int heightOfBubbleBarContainer = mScreenRect.height() - getExpandedViewBottomForBubbleBar(); int expandedViewHeight; if (Flags.enableBubbleBarOnPhones() && !mDeviceConfig.isLargeScreen()) { // we're on a phone, use the max / height expandedViewHeight = Math.max(mScreenRect.width(), mScreenRect.height()); } else { // getting landscape height from screen rect int expandedViewHeight = Math.min(mScreenRect.width(), mScreenRect.height()); expandedViewHeight = Math.min(mScreenRect.width(), mScreenRect.height()); } expandedViewHeight -= heightOfBubbleBarContainer; /* removing bubble container height */ expandedViewHeight -= mInsets.top; /* removing top inset */ expandedViewHeight -= mExpandedViewPadding; /* removing spacing */ return expandedViewHeight; } /** The bottom position of the expanded view when showing above the bubble bar. */ public int getExpandedViewBottomForBubbleBar() { return mBubbleBarTopOnScreen - mExpandedViewPadding; Loading