Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a37c9fda authored by Lyn Han's avatar Lyn Han Committed by android-build-merger
Browse files

Merge "Move bubbles top, manage button below" into qt-dev am: c8a97db0

am: 94a3028a

Change-Id: I34b9ad8e910570ec813bf3647f72afb53fdf1011
parents 6b52eb8b 94a3028a
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -30,11 +30,12 @@
    <com.android.systemui.statusbar.AlphaOptimizedButton
    <com.android.systemui.statusbar.AlphaOptimizedButton
        style="@android:style/Widget.Material.Button.Borderless"
        style="@android:style/Widget.Material.Button.Borderless"
        android:id="@+id/settings_button"
        android:id="@+id/settings_button"
        android:layout_gravity="end"
        android:layout_gravity="start"
        android:layout_width="wrap_content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_height="wrap_content"
        android:focusable="true"
        android:focusable="true"
        android:text="@string/manage_bubbles_text"
        android:text="@string/manage_bubbles_text"
        android:textColor="?attr/wallpaperTextColor"/>
        android:textColor="?attr/wallpaperTextColor"
    />


</com.android.systemui.bubbles.BubbleExpandedView>
</com.android.systemui.bubbles.BubbleExpandedView>
+9 −3
Original line number Original line Diff line number Diff line
@@ -174,7 +174,7 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList




        mPointerDrawable = new ShapeDrawable(TriangleShape.create(
        mPointerDrawable = new ShapeDrawable(TriangleShape.create(
                mPointerWidth, mPointerHeight, false /* pointUp */));
                mPointerWidth, mPointerHeight, true /* pointUp */));
        mPointerView.setBackground(mPointerDrawable);
        mPointerView.setBackground(mPointerDrawable);


        mSettingsIconHeight = getContext().getResources().getDimensionPixelSize(
        mSettingsIconHeight = getContext().getResources().getDimensionPixelSize(
@@ -186,8 +186,14 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
                true /* singleTaskInstance */);
                true /* singleTaskInstance */);
        addView(mActivityView);
        addView(mActivityView);


        // Make sure pointer is below activity view
        // Expanded stack layout, top to bottom:
        bringChildToFront(mPointerView);
        // Expanded view container
        // ==> bubble row
        // ==> expanded view
        //   ==> activity view
        //   ==> manage button
        bringChildToFront(mActivityView);
        bringChildToFront(mSettingsIcon);


        applyThemeAttrs();
        applyThemeAttrs();


+7 −3
Original line number Original line Diff line number Diff line
@@ -176,6 +176,7 @@ public class BubbleStackView extends FrameLayout {
    private int mExpandedViewPadding;
    private int mExpandedViewPadding;
    private int mExpandedAnimateXDistance;
    private int mExpandedAnimateXDistance;
    private int mExpandedAnimateYDistance;
    private int mExpandedAnimateYDistance;
    private int mPointerHeight;
    private int mStatusBarHeight;
    private int mStatusBarHeight;
    private int mPipDismissHeight;
    private int mPipDismissHeight;
    private int mImeOffset;
    private int mImeOffset;
@@ -303,6 +304,8 @@ public class BubbleStackView extends FrameLayout {
                res.getDimensionPixelSize(R.dimen.bubble_expanded_animate_x_distance);
                res.getDimensionPixelSize(R.dimen.bubble_expanded_animate_x_distance);
        mExpandedAnimateYDistance =
        mExpandedAnimateYDistance =
                res.getDimensionPixelSize(R.dimen.bubble_expanded_animate_y_distance);
                res.getDimensionPixelSize(R.dimen.bubble_expanded_animate_y_distance);
        mPointerHeight = res.getDimensionPixelSize(R.dimen.bubble_pointer_height);

        mStatusBarHeight =
        mStatusBarHeight =
                res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height);
                res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height);
        mPipDismissHeight = mContext.getResources().getDimensionPixelSize(
        mPipDismissHeight = mContext.getResources().getDimensionPixelSize(
@@ -1282,15 +1285,16 @@ public class BubbleStackView extends FrameLayout {
     */
     */
    int getMaxExpandedHeight() {
    int getMaxExpandedHeight() {
        int expandedY = (int) mExpandedAnimationController.getExpandedY();
        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.
     * Calculates the y position of the expanded view when it is expanded.
     */
     */
    float getYPositionForExpandedView() {
    float getYPositionForExpandedView() {
        return mExpandedAnimationController.getExpandedY()
        return getStatusBarHeight() + mBubbleSize + mBubblePadding + mPointerHeight;
                - mExpandedBubble.expandedView.getExpandedSize() - mBubblePadding;
    }
    }


    /**
    /**
+5 −7
Original line number Original line Diff line number Diff line
@@ -301,13 +301,11 @@ public class ExpandedAnimationController
            return 0;
            return 0;
        }
        }
        final WindowInsets insets = mLayout.getRootWindowInsets();
        final WindowInsets insets = mLayout.getRootWindowInsets();
        int keyboardHeight = insets.getSystemWindowInsetBottom()
        return mBubblePaddingPx + Math.max(
                - insets.getStableInsetBottom();
            mStatusBarHeight,
        float bottomInset = keyboardHeight > 0
            insets.getDisplayCutout() != null
                ? keyboardHeight
                ? insets.getDisplayCutout().getSafeInsetTop()
                : (mPipDismissHeight - insets.getStableInsetBottom());
                : 0);
        // Stable insets are excluded from display size, so we must subtract it
        return mDisplaySize.y - mBubbleSizePx - mBubblePaddingPx - bottomInset;
    }
    }


    @Override
    @Override