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