Add Cancel button in Car Keyguard

Change-Id: I0c44f3583fe1dadade1e1b01229571ab7eb29643
Fixes: 74964857
Test:  Manually tested on Mojave
This commit is contained in:
Jian Jin
2018-04-06 12:40:50 -07:00
parent d450c4bcdd
commit 44e4d82d2e
4 changed files with 24 additions and 0 deletions

View File

@@ -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>

View File

@@ -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

View File

@@ -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();

View File

@@ -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