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

Commit b293c025 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Hide call strength slot when QSBH expands" into sc-dev am: f31b6ef0

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14250442

Change-Id: Id3df0ac9c2dd9883332154ce24974f71cbe6c266
parents ab3a3e07 f31b6ef0
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -85,10 +85,13 @@ public class QuickStatusBarHeader extends FrameLayout {
    private int mTopViewMeasureHeight;

    private final String mMobileSlotName;
    private final String mCallStrengthSlotName;

    public QuickStatusBarHeader(Context context, AttributeSet attrs) {
        super(context, attrs);
        mMobileSlotName = context.getString(com.android.internal.R.string.status_bar_no_calling);
        mCallStrengthSlotName =
                context.getString(com.android.internal.R.string.status_bar_call_strength);
    }

    /**
@@ -218,28 +221,38 @@ public class QuickStatusBarHeader extends FrameLayout {
    }

    private void updateAlphaAnimator() {
        StatusBarIconView icon =
        StatusBarIconView noCallingIcon =
                ((StatusBarIconView) mIconContainer.getViewForSlot(mMobileSlotName));
        StatusBarIconView callStrengthIcon =
                ((StatusBarIconView) mIconContainer.getViewForSlot(mCallStrengthSlotName));
        TouchAnimator.Builder builder = new TouchAnimator.Builder()
                .addFloat(mQSCarriers, "alpha", 0, 1)
                .addFloat(mDatePrivacyView, "alpha", 0, mDatePrivacyAlpha);
        if (icon != null) {
            builder.addFloat(icon, "alpha", 1, 0);
        if (noCallingIcon != null || callStrengthIcon != null) {
            if (noCallingIcon != null) {
                builder.addFloat(noCallingIcon, "alpha", 1, 0);
            }
            if (callStrengthIcon != null) {
                builder.addFloat(callStrengthIcon, "alpha", 1, 0);
            }
            builder.setListener(new TouchAnimator.ListenerAdapter() {
                @Override
                public void onAnimationAtEnd() {
                    mIconContainer.addIgnoredSlot(mMobileSlotName);
                    mIconContainer.addIgnoredSlot(mCallStrengthSlotName);
                }

                @Override
                public void onAnimationStarted() {
                    mIconContainer.removeIgnoredSlot(mMobileSlotName);
                    mIconContainer.removeIgnoredSlot(mCallStrengthSlotName);
                }

                @Override
                public void onAnimationAtStart() {
                    super.onAnimationAtStart();
                    mIconContainer.removeIgnoredSlot(mMobileSlotName);
                    mIconContainer.removeIgnoredSlot(mCallStrengthSlotName);
                }
            });
        }