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

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

Merge "Hide the mobile slot when QSBH expands in legacy model" into sc-dev am:...

Merge "Hide the mobile slot when QSBH expands in legacy model" into sc-dev am: 6e776921 am: 8c4b5d4c

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

Change-Id: I633de18b7497b1082ac7a1d6523c2393fbdf396a
parents 41cb0b32 8c4b5d4c
Loading
Loading
Loading
Loading
+30 −7
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.FeatureFlagUtils;
import android.util.Pair;
import android.view.DisplayCutout;
import android.view.View;
@@ -87,13 +88,21 @@ public class QuickStatusBarHeader extends FrameLayout {
    private int mTopViewMeasureHeight;

    private final String mMobileSlotName;
    private final String mNoCallingSlotName;
    private final String mCallStrengthSlotName;
    private final boolean mProviderModel;

    public QuickStatusBarHeader(Context context, AttributeSet attrs) {
        super(context, attrs);
        mMobileSlotName = context.getString(com.android.internal.R.string.status_bar_no_calling);
        mMobileSlotName = context.getString(com.android.internal.R.string.status_bar_mobile);
        mNoCallingSlotName = context.getString(com.android.internal.R.string.status_bar_no_calling);
        mCallStrengthSlotName =
                context.getString(com.android.internal.R.string.status_bar_call_strength);
        if (FeatureFlagUtils.isEnabled(context, FeatureFlagUtils.SETTINGS_PROVIDER_MODEL)) {
            mProviderModel = true;
        } else {
            mProviderModel = false;
        }
    }

    /**
@@ -242,14 +251,24 @@ public class QuickStatusBarHeader extends FrameLayout {
                .setListener(new TouchAnimator.ListenerAdapter() {
                    @Override
                    public void onAnimationAtEnd() {
                        mIconContainer.addIgnoredSlot(mMobileSlotName);
                        // TODO(b/185580157): Remove the mProviderModel if the mobile slot can be
                        // hidden in Provider model.
                        if (mProviderModel) {
                            mIconContainer.addIgnoredSlot(mNoCallingSlotName);
                            mIconContainer.addIgnoredSlot(mCallStrengthSlotName);
                        } else {
                            mIconContainer.addIgnoredSlot(mMobileSlotName);
                        }
                    }

                    @Override
                    public void onAnimationStarted() {
                        mIconContainer.addIgnoredSlot(mMobileSlotName);
                        if (mProviderModel) {
                            mIconContainer.addIgnoredSlot(mNoCallingSlotName);
                            mIconContainer.addIgnoredSlot(mCallStrengthSlotName);
                        } else {
                            mIconContainer.addIgnoredSlot(mMobileSlotName);
                        }

                        setSeparatorVisibility(false);
                    }
@@ -257,8 +276,12 @@ public class QuickStatusBarHeader extends FrameLayout {
                    @Override
                    public void onAnimationAtStart() {
                        super.onAnimationAtStart();
                        mIconContainer.removeIgnoredSlot(mMobileSlotName);
                        if (mProviderModel) {
                            mIconContainer.removeIgnoredSlot(mNoCallingSlotName);
                            mIconContainer.removeIgnoredSlot(mCallStrengthSlotName);
                        } else {
                            mIconContainer.removeIgnoredSlot(mMobileSlotName);
                        }

                        setSeparatorVisibility(mShowClockIconsSeparator);
                    }