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

Commit 471f346e authored by Steve Kondik's avatar Steve Kondik
Browse files

Revert "Improve layout of MSIM SIM PIN/PUK keyguard views."

This reverts commit e0d83917.
parent c3c6fdea
Loading
Loading
Loading
Loading
+28 −16
Original line number Diff line number Diff line
@@ -28,32 +28,44 @@
        androidprv:layout_maxHeight="@dimen/keyguard_security_max_height"
        android:gravity="center_horizontal">

    <ImageView
            android:id="@+id/keyguard_sim"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:src="@drawable/ic_lockscreen_sim"/>
    <LinearLayout
       android:id="@+id/sim_info_message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_gravity="center_horizontal"
        android:orientation="horizontal">

        <ImageView
        android:visibility="gone">
        <TextView
            android:id="@+id/slot_id_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                android:src="@drawable/ic_lockscreen_sim"/>

            android:layout_gravity="center_horizontal"
            android:ellipsize="marquee"
            android:singleLine="true"
            android:textDirection = "locale"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="?android:attr/textColorPrimary"
            android:textSize="16sp"
            />
        <TextView
            android:id="@+id/sim_name"
            android:id="@+id/sub_display_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginStart="16dp"
            android:visibility="gone"
            android:padding="@dimen/sim_card_name_padding"
            android:layout_gravity="center_horizontal"
            android:ellipsize="middle"
            android:maxWidth="110dip"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textDirection = "locale"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="?android:attr/textColorPrimary" />

            android:textColor="?android:attr/textColorPrimary"
            android:textSize="16sp"
            />
    </LinearLayout>

    <include layout="@layout/keyguard_message_area"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+29 −16
Original line number Diff line number Diff line
@@ -29,32 +29,45 @@
        androidprv:layout_maxHeight="@dimen/keyguard_security_max_height"
        android:gravity="center_horizontal">

    <ImageView
            android:id="@+id/keyguard_sim"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:src="@drawable/ic_lockscreen_sim"/>
    <LinearLayout
       android:id="@+id/sim_info_message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_gravity="center_horizontal"
        android:orientation="horizontal">

        <ImageView
        android:visibility="gone"
        >
        <TextView
            android:id="@+id/slot_id_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                android:src="@drawable/ic_lockscreen_sim"/>

            android:layout_gravity="center_horizontal"
            android:ellipsize="marquee"
            android:singleLine="true"
            android:textDirection = "locale"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="?android:attr/textColorPrimary"
            android:textSize="16sp"
            />
        <TextView
            android:id="@+id/sim_name"
            android:id="@+id/sub_display_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginStart="16dp"
            android:visibility="gone"
            android:padding="@dimen/sim_card_name_padding"
            android:layout_gravity="center_horizontal"
            android:ellipsize="middle"
            android:maxWidth="110dip"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textDirection = "locale"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="?android:attr/textColorPrimary" />

            android:textColor="?android:attr/textColorPrimary"
            android:textSize="16sp"
            />
    </LinearLayout>

    <include layout="@layout/keyguard_message_area"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+4 −3
Original line number Diff line number Diff line
@@ -178,7 +178,8 @@

    <!-- The translation for disappearing security views after having solved them. -->
    <dimen name="disappear_y_translation">-32dp</dimen>

    <!-- The padding around the SIM card name -->
    <dimen name="sim_card_name_padding">4dip</dimen>
    <!-- For SIM card detection info text max width in SIM card changed dialog -->
    <dimen name="sim_card_name_maxwidth">100dip</dimen>
    <!-- For SIM card name padding in SIM pin/puk unlock and SIM card changed dialog -->
    <dimen name="sim_card_name_padding">6dip</dimen>
</resources>
+0 −16
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.keyguard;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.KeyEvent;
@@ -212,19 +211,4 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView
        }
        return false;
    }

    protected void applyPaddingToView(View view, int paddingDimenResId) {
        final Rect backgroundPadding = new Rect();

        if (view.getBackground() != null) {
            view.getBackground().getPadding(backgroundPadding);
        }

        final Resources res = getContext().getResources();
        final int defaultPadding = res.getDimensionPixelSize(paddingDimenResId);
        view.setPadding(backgroundPadding.left + defaultPadding,
                backgroundPadding.top + defaultPadding,
                backgroundPadding.right + defaultPadding,
                backgroundPadding.bottom + defaultPadding);
    }
}
+27 −19
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.app.Dialog;
import android.app.ProgressDialog;
import android.graphics.Color;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.util.AttributeSet;
@@ -57,7 +58,7 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
    private AlertDialog mRemainingAttemptsDialog;
    KeyguardUpdateMonitor mKgUpdateMonitor;
    private int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
    private TextView mSubNameView;
    private TextView mSubDisplayName = null;
    private ImageView mSimImageView;

    private KeyguardUpdateMonitorCallback mUpdateCallback = new KeyguardUpdateMonitorCallback() {
@@ -146,11 +147,15 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
    protected void onFinishInflate() {
        super.onFinishInflate();

        mSubNameView = (TextView) findViewById(R.id.sim_name);
        mSubDisplayName = (TextView) findViewById(R.id.sub_display_name);
        mSubId = mKgUpdateMonitor.getSimPinLockSubId();
        mSimImageView = (ImageView) findViewById(R.id.keyguard_sim);
        if ( mKgUpdateMonitor.getNumPhones() > 1 ) {
            mSubNameView.setVisibility(View.VISIBLE);

            View simInfoMsg = findViewById(R.id.sim_info_message);
            if (simInfoMsg != null) {
                simInfoMsg.setVisibility(View.VISIBLE);
            }
            handleSubInfoChange();
        }

@@ -352,23 +357,24 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
    }

    private void handleSubInfoChange() {
        String displayName = null;
        //get Display Name
        SubscriptionInfo info =
            SubscriptionManager.from(mContext).getActiveSubscriptionInfo(mSubId);
        final String displayName;

        if (info != null && info.displayName != null) {
            displayName = info.displayName;
        } else {
            displayName = mContext.getString(R.string.kg_slot_name,
                    SubscriptionManager.getSlotId(mSubId) + 1);
        if (null != info) {
           displayName = info.getDisplayName().toString();
        }

        if (DEBUG) Log.i(TAG, "handleSubInfoChange, mSubId=" + mSubId +
                ", displayName=" + displayName);
        mSubNameView.setText(displayName);

        if (info != null && info.simIconRes[0] != 0) {
            mSubNameView.setBackgroundResource(info.simIconRes[0]);
        TextView slotName = (TextView)findViewById(R.id.slot_id_name);
        //Set slot display name
        if (null == displayName) {//display name not yet configured.
            if (DEBUG) Log.d(TAG, "mSubId " + mSubId + ": New Card Inserted");
            slotName.setText(mContext.getString(R.string.kg_slot_name,
                    SubscriptionManager.getSlotId(mSubId) + 1));
            slotName.setVisibility(View.VISIBLE);
            mSubDisplayName.setVisibility(View.GONE);
        } else {
            if (DEBUG) Log.d(TAG, "handleSubInfoChange, refresh Sub Info for mSubId=" + mSubId);
            int color = Color.WHITE;
@@ -376,11 +382,13 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
               color = info.getIconTint();
            }
            mSimImageView.setImageTintList(ColorStateList.valueOf(color));
            mSubNameView.setBackground(null);
            int simCardNamePadding = getContext().getResources().
                                getDimensionPixelSize(R.dimen.sim_card_name_padding);
            mSubDisplayName.setPadding(simCardNamePadding, 0, simCardNamePadding, 0);
            mSubDisplayName.setText(displayName);
            mSubDisplayName.setVisibility(View.VISIBLE);
            slotName.setVisibility(View.GONE);
        }
        // Setting the background modifies the padding of the view in case the drawable
        // itself contains padding, so make sure to preserve our padding
        applyPaddingToView(mSubNameView, R.dimen.sim_card_name_padding);
    }

    private void showDefaultMessage() {
Loading