Refactored the GestureDetector's onSingleTapConfirmed method