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

Commit de787a31 authored by yinxu's avatar yinxu
Browse files

Hide call strength slot when QSBH expands

Bug: 185802587
Test: manual tests
Change-Id: Idd4ee15251e6abde5891f679c8bd543ecd833f58
parent 01991ab3
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);
                }
            });
        }