Merge "Filter out ACTION_UP events in onKey() listener." into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
73ba4a7136
@@ -84,6 +84,13 @@ public class SaveFragment extends Fragment {
|
||||
new View.OnKeyListener() {
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||
// Only handle key-down events. This is simpler, consistent with most other
|
||||
// UIs, and enables the handling of repeated key events from holding down a
|
||||
// key.
|
||||
if (event.getAction() != KeyEvent.ACTION_DOWN) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (keyCode == KeyEvent.KEYCODE_ENTER && mSave.isEnabled()) {
|
||||
performSave();
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user