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

Commit 818eef04 authored by Mady Mellor's avatar Mady Mellor
Browse files

Update statusBarHeight & bubblePaddingTop on config change

* Status bar height can change and we're not accounting for it
* Introduces landscape value of bubblePaddingTop that is smaller so
  that there is more space for app content in landscape

Bug: 135487618
Test: manual - requires changes in other CL's in stack, but then:
             - have bubbles, expand stack
             - rotate device
             => notice that spacing between status bar + expanded view
                is smaller in landscape & larger in portrait
Change-Id: Ib6e98c7ee51408fb8bb51ecb3b4875fc618de8b3
parent c76d88b1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -36,4 +36,8 @@

    <dimen name="volume_tool_tip_right_margin">136dp</dimen>
    <dimen name="volume_tool_tip_top_margin">12dp</dimen>

    <!-- Padding between status bar and bubbles when displayed in expanded state, smaller
         value in landscape since we have limited vertical space-->
    <dimen name="bubble_padding_top">4dp</dimen>
</resources>
+2 −6
Original line number Diff line number Diff line
@@ -1135,10 +1135,8 @@
    <dimen name="bubble_pointer_width">6dp</dimen>
    <!-- Extra padding around the dismiss target for bubbles -->
    <dimen name="bubble_dismiss_slop">16dp</dimen>
    <!-- Height of the header within the expanded view. -->
    <dimen name="bubble_expanded_header_height">48dp</dimen>
    <!-- Left and right padding applied to the header. -->
    <dimen name="bubble_expanded_header_horizontal_padding">24dp</dimen>
    <!-- Height of button allowing users to adjust settings for bubbles. -->
    <dimen name="bubble_settings_size">48dp</dimen>
    <!-- How far, horizontally, to animate the expanded view over when animating in/out. -->
    <dimen name="bubble_expanded_animate_x_distance">100dp</dimen>
    <!-- How far, vertically, to animate the expanded view over when animating in/out. -->
@@ -1155,8 +1153,6 @@
    <dimen name="bubble_stack_offscreen">9dp</dimen>
    <!-- How far down the screen the stack starts. -->
    <dimen name="bubble_stack_starting_offset_y">96dp</dimen>
    <!-- Size of image buttons in the bubble header -->
    <dimen name="bubble_header_icon_size">48dp</dimen>
    <!-- Space between the pointer triangle and the bubble expanded view -->
    <dimen name="bubble_pointer_margin">8dp</dimen>
    <!-- Height of the permission prompt shown with bubbles -->
+1 −1
Original line number Diff line number Diff line
@@ -230,7 +230,7 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
        mPointerView.setVisibility(INVISIBLE);

        mSettingsIconHeight = getContext().getResources().getDimensionPixelSize(
                R.dimen.bubble_expanded_header_height);
                R.dimen.bubble_settings_size);
        mSettingsIcon = findViewById(R.id.settings_button);
        mSettingsIcon.setOnClickListener(this);

+6 −0
Original line number Diff line number Diff line
@@ -488,6 +488,12 @@ public class BubbleStackView extends FrameLayout {
    public void onOrientationChanged(int orientation) {
        mOrientation = orientation;

        // Some resources change depending on orientation
        Resources res = getContext().getResources();
        mStatusBarHeight = res.getDimensionPixelSize(
                com.android.internal.R.dimen.status_bar_height);
        mBubblePaddingTop = res.getDimensionPixelSize(R.dimen.bubble_padding_top);

        final RectF allowablePos = mStackAnimationController.getAllowableStackPositionRegion();
        mWasOnLeftBeforeRotation = mStackAnimationController.isStackOnLeftSide();
        mVerticalPosPercentBeforeRotation =
+8 −2
Original line number Diff line number Diff line
@@ -140,10 +140,16 @@ public class ExpandedAnimationController
    public void updateOrientation(int orientation) {
        if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
            mScreenWidth = mDisplaySize.y;
            return;
        }
        } else {
            mScreenWidth = mDisplaySize.x;
        }
        if (mLayout != null) {
            Resources res = mLayout.getContext().getResources();
            mStatusBarHeight = res.getDimensionPixelSize(
                    com.android.internal.R.dimen.status_bar_height);
            mBubblePaddingTop = res.getDimensionPixelSize(R.dimen.bubble_padding_top);
        }
    }

    /**
     * Animates the bubbles along a curved path, either to expand them along the top or collapse
Loading