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

Commit 666f3da6 authored by cretin45's avatar cretin45 Committed by Ed Carrigan
Browse files

SystemUI: Status bar UI cleanup for MSIM and roaming

Change-Id: Id0a94962ff062daeba1988ccf799ca1f8c3e2e1d
parent 516ad521
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -26,5 +26,7 @@
    android:layout_gravity="bottom"
    android:layout_marginBottom="@dimen/close_handle_height"
    android:gravity="center"
    android:singleLine="true"
    android:ellipsize="end"
    android:visibility="invisible"
    />
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@
        />

    <LinearLayout
        android:id="@+id/carrier_label_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
+61 −6
Original line number Diff line number Diff line
@@ -19,16 +19,71 @@
*/
-->


<TextView
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/subs_label"
    android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network"
    android:layout_height="@dimen/carrier_label_height"
    android:layout_width="match_parent"
    android:layout_marginBottom="@dimen/close_handle_height"
    android:layout_gravity="bottom"
    android:orientation="horizontal"
    android:visibility="gone">
    <TextView
        android:id="@+id/sub1_label"
        android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network"
        android:layout_height="@dimen/carrier_label_height"
        android:layout_width="0px"
        android:layout_weight="1"
        android:gravity="right"
        android:singleLine="true"
        android:ellipsize="end"
        />

    <TextView
        android:id="@+id/sub1_separator"
        android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network"
        android:layout_height="@dimen/carrier_label_height"
        android:layout_width="wrap_content"
        android:gravity="center"
        android:paddingLeft="10dp"
        android:paddingRight="10dp"
        android:singleLine="true"
        android:text="@string/status_bar_sim_slot_separator"
        />

    <TextView
        android:id="@+id/sub2_label"
        android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network"
        android:layout_height="@dimen/carrier_label_height"
        android:layout_width="0px"
        android:layout_weight="1"
        android:gravity="left"
        android:singleLine="true"
        android:ellipsize="end"
        />

    <TextView
        android:id="@+id/sub2_separator"
        android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network"
        android:layout_height="@dimen/carrier_label_height"
        android:layout_width="wrap_content"
        android:gravity="center"
    android:visibility="invisible"
        android:paddingLeft="10dp"
        android:paddingRight="10dp"
        android:singleLine="true"
        android:text="@string/status_bar_sim_slot_separator"
        android:visibility="gone"
        />

    <TextView
        android:id="@+id/sub3_label"
        android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network"
        android:layout_height="@dimen/carrier_label_height"
        android:layout_width="0px"
        android:layout_weight="1"
        android:gravity="left"
        android:singleLine="true"
        android:ellipsize="end"
        android:visibility="gone"
        />
</LinearLayout>
+3 −1
Original line number Diff line number Diff line
@@ -106,7 +106,9 @@
    </string>

    <!-- Separator for PLMN and SPN in network name. -->
    <string name="status_bar_network_name_separator" translatable="false">|</string>
    <string name="status_bar_network_name_separator" translatable="false">-</string>
    <string name="status_bar_sim_slot_separator" translatable="false">|</string>


    <!-- Network connection string for Bluetooth Reverse Tethering -->
    <string name="bluetooth_tethered">Bluetooth tethered</string>
+21 −10
Original line number Diff line number Diff line
@@ -265,8 +265,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
    ImageView mSettingsButton, mNotificationButton;

    // carrier/wifi label
    private View mCarrierLableContainer;
    private TextView mCarrierLabel;
    private TextView mSubsLabel;
    private View mSubsLabel;
    private boolean mCarrierLabelVisible = false;
    private int mCarrierLabelHeight;
    private TextView mEmergencyCallLabel;
@@ -796,7 +797,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        // Other icons
        mBatteryView = (BatteryMeterView) mStatusBarView.findViewById(R.id.battery);
        mDockBatteryView = (DockBatteryMeterView) mStatusBarView.findViewById(R.id.dock_battery);

        mCarrierLableContainer = mStatusBarWindow.findViewById(R.id.carrier_label_container);
        if (MSimTelephonyManager.getDefault().isMultiSimEnabled()) {
            mMSimNetworkController = new MSimNetworkController(mContext);
            mMSimSignalClusterView = (MSimSignalClusterView)
@@ -821,7 +822,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
            }

            mCarrierLabel = (TextView)mStatusBarWindow.findViewById(R.id.carrier_label);
            mSubsLabel = (TextView)mStatusBarWindow.findViewById(R.id.subs_label);
            mSubsLabel = mStatusBarWindow.findViewById(R.id.subs_label);
            int numPhones = MSimTelephonyManager.getDefault().getPhoneCount();
            if (numPhones == 3) {
                mSubsLabel.findViewById(R.id.sub2_separator).setVisibility(View.VISIBLE);
                mSubsLabel.findViewById(R.id.sub3_label).setVisibility(View.VISIBLE);
            }
            mShowCarrierInPanel = (mCarrierLabel != null);

            if (DEBUG) Log.v(TAG, "carrierlabel=" + mCarrierLabel + " show=" +
@@ -1608,11 +1614,16 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,

    protected void updateCarrierLabelVisibility(boolean force) {
        if (!mShowCarrierInPanel) return;
        final boolean isMultiSim =  MSimTelephonyManager.getDefault().isMultiSimEnabled();
        int labelHeight = mCarrierLabelHeight;
        if (isMultiSim) {
            labelHeight = labelHeight * 2; //SubLabel height is same a carrier label
        }
        // The idea here is to only show the carrier label when there is enough room to see it,
        // i.e. when there aren't enough notifications to fill the panel.
        if (SPEW) {
            Log.d(TAG, String.format("pileh=%d scrollh=%d carrierh=%d",
                    mPile.getHeight(), mScrollView.getHeight(), mCarrierLabelHeight));
                    mPile.getHeight(), mScrollView.getHeight(), labelHeight));
        }

        final boolean emergencyCallsShownElsewhere = mEmergencyCallLabel != null;
@@ -1622,7 +1633,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,

        final boolean makeVisible =
            !(emergencyCallsShownElsewhere && isEmergencyOnly)
            && mPile.getHeight() < (mNotificationPanel.getHeight() - mCarrierLabelHeight - mNotificationHeaderHeight)
            && mPile.getHeight() < (mNotificationPanel.getHeight() - labelHeight - mNotificationHeaderHeight)
            && mScrollView.getVisibility() == View.VISIBLE
            && !mAnimatingFlip;

@@ -1631,11 +1642,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
            if (DEBUG) {
                Log.d(TAG, "making carrier label " + (makeVisible?"visible":"invisible"));
            }
            mCarrierLabel.animate().cancel();
            mCarrierLableContainer.animate().cancel();
            if (makeVisible) {
                mCarrierLabel.setVisibility(View.VISIBLE);
                mCarrierLableContainer.setVisibility(View.VISIBLE);
            }
            mCarrierLabel.animate()
            mCarrierLableContainer.animate()
                .alpha(makeVisible ? 1f : 0f)
                //.setStartDelay(makeVisible ? 500 : 0)
                //.setDuration(makeVisible ? 750 : 100)
@@ -1644,8 +1655,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        if (!mCarrierLabelVisible) { // race
                            mCarrierLabel.setVisibility(View.INVISIBLE);
                            mCarrierLabel.setAlpha(0f);
                            mCarrierLableContainer.setVisibility(View.INVISIBLE);
                            mCarrierLableContainer.setAlpha(0f);
                        }
                    }
                })
Loading