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

Commit f93199cb authored by Liran Binyamin's avatar Liran Binyamin Committed by Android (Google) Code Review
Browse files

Merge "Fix squished hotseat due to bubbles" into main

parents b4d185e3 2a47a4a6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -814,6 +814,11 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
     */
    public void setUIController(@NonNull TaskbarUIController uiController) {
        mControllers.setUiController(uiController);
        if (BubbleBarController.isBubbleBarEnabled() && mControllers.bubbleControllers.isEmpty()) {
            // if the bubble bar was visible in a previous configuration of taskbar and is being
            // recreated now without bubbles, clean up any bubble bar adjustments from hotseat
            bubbleBarVisibilityChanged(/* isVisible= */ false);
        }
    }

    /**
+7 −7
Original line number Diff line number Diff line
@@ -162,14 +162,14 @@ public class Hotseat extends CellLayout implements Insettable {
                animatorSet.play(ObjectAnimator.ofFloat(child, VIEW_TRANSLATE_X, tx));
            }
        }
        if (mQsb instanceof HorizontalInsettableView) {
            HorizontalInsettableView horizontalInsettableQsb = (HorizontalInsettableView) mQsb;
            ValueAnimator qsbAnimator = ValueAnimator.ofFloat(0f, 1f);
        if (mQsb instanceof HorizontalInsettableView horizontalInsettableQsb) {
            final float currentInsetFraction = horizontalInsettableQsb.getHorizontalInsets();
            final float targetInsetFraction =
                    isBubbleBarVisible ? (float) dp.iconSizePx / dp.hotseatQsbWidth : 0;
            ValueAnimator qsbAnimator =
                    ValueAnimator.ofFloat(currentInsetFraction, targetInsetFraction);
            qsbAnimator.addUpdateListener(animation -> {
                float fraction = qsbAnimator.getAnimatedFraction();
                float insetFraction = isBubbleBarVisible
                        ? (float) dp.iconSizePx * fraction / dp.hotseatQsbWidth
                        : (float) dp.iconSizePx * (1 - fraction) / dp.hotseatQsbWidth;
                float insetFraction = (float) animation.getAnimatedValue();
                horizontalInsettableQsb.setHorizontalInsets(insetFraction);
            });
            animatorSet.play(qsbAnimator);