@Override public boolean ccTouchesCancelled(MotionEvent event) { if (state == MenuState.kMenuStateTrackingTouch) { if (selectedItem != null) { selectedItem.unselected(); } state = MenuState.kMenuStateWaiting; return TouchDispatcher.kEventHandled; } return TouchDispatcher.kEventIgnored; }
@Override public boolean ccTouchesMoved(MotionEvent event) { if (state == MenuState.kMenuStateTrackingTouch) { MenuItem currentItem = itemForTouch(event); if (currentItem != selectedItem) { if (selectedItem != null) { selectedItem.unselected(); } selectedItem = currentItem; if (selectedItem != null) { selectedItem.selected(); } } return TouchDispatcher.kEventHandled; } return TouchDispatcher.kEventIgnored; }