Merge "Bouncer: Add style in sim pin view." into tm-dev
This commit is contained in:
commit
706e0c7148
@ -59,16 +59,17 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="4dp"
|
||||
>
|
||||
|
||||
<com.android.keyguard.PasswordTextView
|
||||
android:id="@+id/simPinEntry"
|
||||
android:layout_width="@dimen/keyguard_security_width"
|
||||
android:layout_height="@dimen/keyguard_password_height"
|
||||
android:gravity="center"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginRight="72dp"
|
||||
androidprv:scaledTextSize="@integer/scaled_password_text_size"
|
||||
android:contentDescription="@string/keyguard_accessibility_sim_pin_area"
|
||||
/>
|
||||
android:id="@+id/simPinEntry"
|
||||
style="@style/Widget.TextView.Password"
|
||||
android:layout_width="@dimen/keyguard_security_width"
|
||||
android:layout_height="@dimen/keyguard_password_height"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginRight="72dp"
|
||||
android:contentDescription="@string/keyguard_accessibility_sim_pin_area"
|
||||
android:gravity="center"
|
||||
androidprv:scaledTextSize="@integer/scaled_password_text_size" />
|
||||
</RelativeLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -60,16 +60,17 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="4dp"
|
||||
>
|
||||
|
||||
<com.android.keyguard.PasswordTextView
|
||||
android:id="@+id/pukEntry"
|
||||
android:layout_width="@dimen/keyguard_security_width"
|
||||
android:layout_height="@dimen/keyguard_password_height"
|
||||
android:gravity="center"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginRight="72dp"
|
||||
androidprv:scaledTextSize="@integer/scaled_password_text_size"
|
||||
android:contentDescription="@string/keyguard_accessibility_sim_puk_area"
|
||||
/>
|
||||
android:id="@+id/pukEntry"
|
||||
style="@style/Widget.TextView.Password"
|
||||
android:layout_width="@dimen/keyguard_security_width"
|
||||
android:layout_height="@dimen/keyguard_password_height"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginRight="72dp"
|
||||
android:contentDescription="@string/keyguard_accessibility_sim_puk_area"
|
||||
android:gravity="center"
|
||||
androidprv:scaledTextSize="@integer/scaled_password_text_size" />
|
||||
</RelativeLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -123,10 +123,10 @@ public class KeyguardSecurityViewFlipperController
|
||||
|
||||
private int getLayoutIdFor(SecurityMode securityMode) {
|
||||
switch (securityMode) {
|
||||
case Pattern: return com.android.systemui.R.layout.keyguard_pattern_view;
|
||||
case PIN: return com.android.systemui.R.layout.keyguard_pin_view;
|
||||
case Password: return com.android.systemui.R.layout.keyguard_password_view;
|
||||
case SimPin: return com.android.systemui.R.layout.keyguard_sim_pin_view;
|
||||
case Pattern: return R.layout.keyguard_pattern_view;
|
||||
case PIN: return R.layout.keyguard_pin_view;
|
||||
case Password: return R.layout.keyguard_password_view;
|
||||
case SimPin: return R.layout.keyguard_sim_pin_view;
|
||||
case SimPuk: return R.layout.keyguard_sim_puk_view;
|
||||
default:
|
||||
return 0;
|
||||
|
@ -18,8 +18,13 @@ package com.android.keyguard;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
|
||||
import com.android.systemui.R;
|
||||
|
||||
@ -27,6 +32,7 @@ import com.android.systemui.R;
|
||||
* Displays a PIN pad for unlocking.
|
||||
*/
|
||||
public class KeyguardSimPinView extends KeyguardPinBasedInputView {
|
||||
private ImageView mSimImageView;
|
||||
public static final String TAG = "KeyguardSimPinView";
|
||||
|
||||
public KeyguardSimPinView(Context context) {
|
||||
@ -62,6 +68,7 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
|
||||
|
||||
@Override
|
||||
protected void onFinishInflate() {
|
||||
mSimImageView = findViewById(R.id.keyguard_sim);
|
||||
super.onFinishInflate();
|
||||
|
||||
if (mEcaView instanceof EmergencyCarrierArea) {
|
||||
@ -79,5 +86,17 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView {
|
||||
return getContext().getString(
|
||||
com.android.internal.R.string.keyguard_accessibility_sim_pin_unlock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadColors() {
|
||||
super.reloadColors();
|
||||
|
||||
int[] customAttrs = {android.R.attr.textColorSecondary};
|
||||
TypedArray a = getContext().obtainStyledAttributes(customAttrs);
|
||||
int imageColor = a.getColor(0, 0);
|
||||
a.recycle();
|
||||
Drawable wrappedDrawable = DrawableCompat.wrap(mSimImageView.getDrawable());
|
||||
DrawableCompat.setTint(wrappedDrawable, imageColor);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,6 +130,12 @@ public class KeyguardSimPinViewController
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadColors() {
|
||||
super.reloadColors();
|
||||
mView.reloadColors();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void verifyPasswordAndUnlock() {
|
||||
String entry = mPasswordEntry.getText();
|
||||
|
@ -17,8 +17,13 @@
|
||||
package com.android.keyguard;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
|
||||
import com.android.systemui.R;
|
||||
|
||||
@ -27,6 +32,7 @@ import com.android.systemui.R;
|
||||
* Displays a PIN pad for entering a PUK (Pin Unlock Kode) provided by a carrier.
|
||||
*/
|
||||
public class KeyguardSimPukView extends KeyguardPinBasedInputView {
|
||||
private ImageView mSimImageView;
|
||||
private static final boolean DEBUG = KeyguardConstants.DEBUG;
|
||||
public static final String TAG = "KeyguardSimPukView";
|
||||
|
||||
@ -79,6 +85,7 @@ public class KeyguardSimPukView extends KeyguardPinBasedInputView {
|
||||
|
||||
@Override
|
||||
protected void onFinishInflate() {
|
||||
mSimImageView = findViewById(R.id.keyguard_sim);
|
||||
super.onFinishInflate();
|
||||
|
||||
if (mEcaView instanceof EmergencyCarrierArea) {
|
||||
@ -96,6 +103,18 @@ public class KeyguardSimPukView extends KeyguardPinBasedInputView {
|
||||
return getContext().getString(
|
||||
com.android.internal.R.string.keyguard_accessibility_sim_puk_unlock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadColors() {
|
||||
super.reloadColors();
|
||||
|
||||
int[] customAttrs = {android.R.attr.textColorSecondary};
|
||||
TypedArray a = getContext().obtainStyledAttributes(customAttrs);
|
||||
int imageColor = a.getColor(0, 0);
|
||||
a.recycle();
|
||||
Drawable wrappedDrawable = DrawableCompat.wrap(mSimImageView.getDrawable());
|
||||
DrawableCompat.setTint(wrappedDrawable, imageColor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -112,6 +112,12 @@ public class KeyguardSimPukViewController
|
||||
mStateMachine.reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadColors() {
|
||||
super.reloadColors();
|
||||
mView.reloadColors();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void verifyPasswordAndUnlock() {
|
||||
mStateMachine.next();
|
||||
@ -252,9 +258,6 @@ public class KeyguardSimPukViewController
|
||||
return mPinText.equals(mPasswordEntry.getText());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void updateSim() {
|
||||
getSimUnlockProgressDialog().show();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user