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

Commit 5ccff81a authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Fix overlapping wifi and airplane icons.

Bug: 5254547
Change-Id: If293be36c4e06a8fac6f728b1f96e5759fe20f6d
parent 62bb0cdc
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -45,6 +45,12 @@
            android:layout_gravity="center|bottom"
            />
    </FrameLayout>
    <View
        android:layout_height="6dp"
        android:layout_width="6dp"
        android:visibility="gone"
        android:id="@+id/spacer"
        />
    <FrameLayout
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
+14 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import com.android.systemui.statusbar.policy.NetworkController;

import com.android.systemui.R;

// Intimately tied to the design of res/layout/signal_cluster_view.xml
public class SignalClusterView
        extends LinearLayout 
        implements NetworkController.SignalCluster {
@@ -42,9 +43,11 @@ public class SignalClusterView
    private int mWifiStrengthId = 0, mWifiActivityId = 0;
    private boolean mMobileVisible = false;
    private int mMobileStrengthId = 0, mMobileActivityId = 0, mMobileTypeId = 0;
    private boolean mIsAirplaneMode = false;

    ViewGroup mWifiGroup, mMobileGroup;
    ImageView mWifi, mMobile, mWifiActivity, mMobileActivity, mMobileType;
    View mSpacer;

    public SignalClusterView(Context context) {
        this(context, null);
@@ -74,6 +77,7 @@ public class SignalClusterView
        mMobile         = (ImageView) findViewById(R.id.mobile_signal);
        mMobileActivity = (ImageView) findViewById(R.id.mobile_inout);
        mMobileType     = (ImageView) findViewById(R.id.mobile_type);
        mSpacer         =             findViewById(R.id.spacer);

        apply();
    }
@@ -109,6 +113,10 @@ public class SignalClusterView
        apply();
    }

    public void setIsAirplaneMode(boolean is) {
        mIsAirplaneMode = is;
    }

    // Run after each indicator change.
    private void apply() {
        if (mWifiGroup == null) return;
@@ -135,6 +143,12 @@ public class SignalClusterView
            mMobileGroup.setVisibility(View.GONE);
        }

        if (mMobileVisible && mWifiVisible && mIsAirplaneMode) {
            mSpacer.setVisibility(View.INVISIBLE);
        } else {
            mSpacer.setVisibility(View.GONE);
        }

        if (DEBUG) Slog.d(TAG,
                String.format("mobile: %s sig=%d act=%d typ=%d",
                    (mMobileVisible ? "VISIBLE" : "GONE"),
+2 −0
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@ public class NetworkController extends BroadcastReceiver {
        void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon);
        void setMobileDataIndicators(boolean visible, int strengthIcon, int activityIcon,
                int typeIcon);
        void setIsAirplaneMode(boolean is);
    }

    /**
@@ -877,6 +878,7 @@ public class NetworkController extends BroadcastReceiver {
                        mPhoneSignalIconId,
                        mMobileActivityIconId,
                        mDataTypeIconId);
                cluster.setIsAirplaneMode(mAirplaneMode);
            }
        }