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

Commit bb7cbbb3 authored by Pawit Pornkitprasan's avatar Pawit Pornkitprasan Committed by Gerrit Code Review
Browse files

Keyguard: fix chopped keyguard on hdpi MSim devices

Both the CarrierText and MSimCarrierText were in the View, taking
additional space. Remove CarrierText from the view in case of MSim.

Change-Id: I803695044d06470ef9af59863ba92444e41488f5
parent 8d1f8639
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
    android:clickable="true">

    <com.android.keyguard.MSimCarrierText
        android:id="@+id/msim_carrier_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:singleLine="true"
+13 −1
Original line number Diff line number Diff line
@@ -40,7 +40,12 @@ public class EmergencyCarrierArea extends LinearLayout {
    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();

        if (!KeyguardUpdateMonitor.sIsMultiSimEnabled) {
            // For MSIM, we need to wait until the view has been inflated to find it
            mCarrierText = (CarrierText) findViewById(R.id.carrier_text);
        }

        mEmergencyButton = (EmergencyButton) findViewById(R.id.emergency_call_button);

        // The emergency button overlaps the carrier text, only noticeable when highlighted.
@@ -48,6 +53,13 @@ public class EmergencyCarrierArea extends LinearLayout {
        mEmergencyButton.setOnTouchListener(new OnTouchListener(){
            @Override
            public boolean onTouch(View v, MotionEvent event) {

                if (mCarrierText == null) {
                    // We're using MSIM
                    mCarrierText = (CarrierText) findViewById(R.id.msim_keyguard_carrier_area)
                            .findViewById(R.id.msim_carrier_text);
                }

                switch(event.getAction()) {
                    case MotionEvent.ACTION_DOWN:
                        mCarrierText.animate().alpha(0);
+6 −0
Original line number Diff line number Diff line
@@ -998,6 +998,12 @@ public class KeyguardHostView extends KeyguardViewBase {
                ViewStub vStub = (ViewStub) (v.findViewById(R.id.stub_msim_carrier_text));
                if (vStub != null) {
                    vStub.inflate();

                    // Remove the non-MSim carrier text
                    View carrierText = v.findViewById(R.id.carrier_text);
                    if (carrierText != null) {
                        ((EmergencyCarrierArea) carrierText.getParent()).removeView(carrierText);
                    }
                }
            }
            mSecurityViewContainer.addView(v);