Add Cancel button in Car Keyguard
Change-Id: I0c44f3583fe1dadade1e1b01229571ab7eb29643 Fixes: 74964857 Test: Manually tested on Mojave
This commit is contained in:
@@ -98,5 +98,8 @@
|
||||
<item type="id" name="status_bar_view_state_tag" />
|
||||
|
||||
<item type="id" name="display_cutout" />
|
||||
|
||||
<!-- Optional cancel button on Keyguard -->
|
||||
<item type="id" name="cancel_button"/>
|
||||
</resources>
|
||||
|
||||
|
||||
@@ -107,6 +107,13 @@ public class KeyguardPINView extends KeyguardPinBasedInputView {
|
||||
new View[]{
|
||||
null, mEcaView, null
|
||||
}};
|
||||
|
||||
View cancelBtn = findViewById(R.id.cancel_button);
|
||||
if (cancelBtn != null) {
|
||||
cancelBtn.setOnClickListener(view -> {
|
||||
mCallback.reset();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -205,6 +205,13 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView
|
||||
}
|
||||
});
|
||||
|
||||
View cancelBtn = findViewById(R.id.cancel_button);
|
||||
if (cancelBtn != null) {
|
||||
cancelBtn.setOnClickListener(view -> {
|
||||
mCallback.reset();
|
||||
});
|
||||
}
|
||||
|
||||
// If there's more than one IME, enable the IME switcher button
|
||||
updateSwitchImeButton();
|
||||
|
||||
|
||||
@@ -157,6 +157,13 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
|
||||
if (button != null) {
|
||||
button.setCallback(this);
|
||||
}
|
||||
|
||||
View cancelBtn = findViewById(R.id.cancel_button);
|
||||
if (cancelBtn != null) {
|
||||
cancelBtn.setOnClickListener(view -> {
|
||||
mCallback.reset();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user