Merge "Move bubbles top, manage button below" into qt-dev
diff --git a/packages/SystemUI/res/layout/bubble_expanded_view.xml b/packages/SystemUI/res/layout/bubble_expanded_view.xml
index 5b93edd..db40c4f 100644
--- a/packages/SystemUI/res/layout/bubble_expanded_view.xml
+++ b/packages/SystemUI/res/layout/bubble_expanded_view.xml
@@ -30,11 +30,12 @@
<com.android.systemui.statusbar.AlphaOptimizedButton
style="@android:style/Widget.Material.Button.Borderless"
android:id="@+id/settings_button"
- android:layout_gravity="end"
+ android:layout_gravity="start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true"
android:text="@string/manage_bubbles_text"
- android:textColor="?attr/wallpaperTextColor"/>
+ android:textColor="?attr/wallpaperTextColor"
+ />
</com.android.systemui.bubbles.BubbleExpandedView>
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java
index 3b652b7..4c17f2a 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java
@@ -174,7 +174,7 @@
mPointerDrawable = new ShapeDrawable(TriangleShape.create(
- mPointerWidth, mPointerHeight, false /* pointUp */));
+ mPointerWidth, mPointerHeight, true /* pointUp */));
mPointerView.setBackground(mPointerDrawable);
mSettingsIconHeight = getContext().getResources().getDimensionPixelSize(
@@ -186,8 +186,14 @@
true /* singleTaskInstance */);
addView(mActivityView);
- // Make sure pointer is below activity view
- bringChildToFront(mPointerView);
+ // Expanded stack layout, top to bottom:
+ // Expanded view container
+ // ==> bubble row
+ // ==> expanded view
+ // ==> activity view
+ // ==> manage button
+ bringChildToFront(mActivityView);
+ bringChildToFront(mSettingsIcon);
applyThemeAttrs();
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
index 50419b9..bec90d2 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
@@ -176,6 +176,7 @@
private int mExpandedViewPadding;
private int mExpandedAnimateXDistance;
private int mExpandedAnimateYDistance;
+ private int mPointerHeight;
private int mStatusBarHeight;
private int mPipDismissHeight;
private int mImeOffset;
@@ -303,6 +304,8 @@
res.getDimensionPixelSize(R.dimen.bubble_expanded_animate_x_distance);
mExpandedAnimateYDistance =
res.getDimensionPixelSize(R.dimen.bubble_expanded_animate_y_distance);
+ mPointerHeight = res.getDimensionPixelSize(R.dimen.bubble_pointer_height);
+
mStatusBarHeight =
res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height);
mPipDismissHeight = mContext.getResources().getDimensionPixelSize(
@@ -1282,15 +1285,16 @@
*/
int getMaxExpandedHeight() {
int expandedY = (int) mExpandedAnimationController.getExpandedY();
- return expandedY - getStatusBarHeight();
+ // PIP dismiss view uses FLAG_LAYOUT_IN_SCREEN so we need to subtract the bottom inset
+ int pipDismissHeight = mPipDismissHeight - getBottomInset();
+ return mDisplaySize.y - expandedY - mBubbleSize - pipDismissHeight;
}
/**
* Calculates the y position of the expanded view when it is expanded.
*/
float getYPositionForExpandedView() {
- return mExpandedAnimationController.getExpandedY()
- - mExpandedBubble.expandedView.getExpandedSize() - mBubblePadding;
+ return getStatusBarHeight() + mBubbleSize + mBubblePadding + mPointerHeight;
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java b/packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java
index 4674a1f..ae8043f 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java
@@ -301,13 +301,11 @@
return 0;
}
final WindowInsets insets = mLayout.getRootWindowInsets();
- int keyboardHeight = insets.getSystemWindowInsetBottom()
- - insets.getStableInsetBottom();
- float bottomInset = keyboardHeight > 0
- ? keyboardHeight
- : (mPipDismissHeight - insets.getStableInsetBottom());
- // Stable insets are excluded from display size, so we must subtract it
- return mDisplaySize.y - mBubbleSizePx - mBubblePaddingPx - bottomInset;
+ return mBubblePaddingPx + Math.max(
+ mStatusBarHeight,
+ insets.getDisplayCutout() != null
+ ? insets.getDisplayCutout().getSafeInsetTop()
+ : 0);
}
@Override