fixed incorrect double click detection when navigating between Settings screens
This commit is contained in:
parent
62b232c93e
commit
d500980042
1 changed files with 7 additions and 2 deletions
|
|
@ -41,14 +41,19 @@ abstract public class ActivityWithNavigation extends AppCompatActivity {
|
|||
|
||||
// Reset the last key even if we are not going to process it. This is to avoid
|
||||
// detecting a double click, when the user has pressed a different key in between.
|
||||
boolean click = (keyCode == lastKey);
|
||||
boolean doubleClick = (keyCode == lastKey);
|
||||
lastKey = keyCode;
|
||||
|
||||
if (!Key.isNumber(keyCode)) {
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
selectOption(Key.codeToNumber(settings, keyCode), click);
|
||||
selectOption(Key.codeToNumber(settings, keyCode), doubleClick);
|
||||
|
||||
if (doubleClick) {
|
||||
resetKeyRepeat();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue