void handleSelectionChanged(String selection){
  if (mDidExpandSelection) {
    mSelectedText=selection;
    mDidExpandSelection=false;
    return;
  }
  if (selection == null || selection.isEmpty()) {
    scheduleInvalidTapNotification();
    if (mSelectionType == SelectionType.TAP) {
      resetSelectionStates();
      return;
    }
  }
  if (!selection.isEmpty()) {
    unscheduleInvalidTapNotification();
  }
  mSelectedText=selection;
  if (mWasTapGestureDetected) {
    mSelectionType=SelectionType.TAP;
    handleSelection(selection,mSelectionType);
    mWasTapGestureDetected=false;
  }
 else {
    mHandler.handleSelectionModification(selection,isValidSelection(selection),mX,mY);
  }
}

void handleSelectionChanged ( String selection ) { if ( mDidExpandSelection ) { mSelectedText = selection ; mDidExpandSelection = false ; return ; } if ( selection == null || selection . isEmpty ( ) ) { scheduleInvalidTapNotification ( ) ; if ( mSelectionType == SelectionType . TAP ) { resetSelectionStates ( ) ; return ; } } if ( ! selection . isEmpty ( ) ) { unscheduleInvalidTapNotification ( ) ; } mSelectedText = selection ; if ( mWasTapGestureDetected ) { mSelectionType = SelectionType . TAP ; handleSelection ( selection , mSelectionType ) ; mWasTapGestureDetected = false ; } else { mHandler . handleSelectionModification ( selection , isValidSelection ( selection ) , mX , mY ) ; } }
handles a change in the current selection .
