mirror of
https://github.com/etlegacy/etlegacy-android.git
synced 2024-11-10 06:52:06 +00:00
java: refactor PopUpFunctionalKeys and PopUpRemoveFunctionalKeys functions
This commit is contained in:
parent
958cac8e98
commit
ff051a90e2
1 changed files with 9 additions and 6 deletions
|
@ -39,18 +39,21 @@ public class ETLActivity extends SDLActivity implements JoyStickListener {
|
|||
* to prevent flooding at creating multiple entries
|
||||
*/
|
||||
protected void PopUpFunctionalKeys() {
|
||||
etl_PopMenu.getMenu().removeItem(1);
|
||||
etl_PopMenu.getMenu().add(1, 1, 1, "F1");
|
||||
etl_PopMenu.getMenu().removeItem(2);
|
||||
etl_PopMenu.getMenu().add(2, 2, 2, "F2");
|
||||
|
||||
for (int i = 1; i < 3; i++) {
|
||||
if (etl_PopMenu.getMenu().findItem(i) == null)
|
||||
etl_PopMenu.getMenu().add(i, i, i, "F".concat(String.valueOf(i)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dirty Hack to remove Functional Keys at Disconnect
|
||||
*/
|
||||
protected void PopUpRemoveFunctionalKeys() {
|
||||
etl_PopMenu.getMenu().removeItem(1);
|
||||
etl_PopMenu.getMenu().removeItem(2);
|
||||
|
||||
for (int i = 1; i < 3; i++) {
|
||||
etl_PopMenu.getMenu().removeItem(i);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue