Example #1
1
 /**
  * Apply a processed event.
  *
  * @param event the event to be applied
  */
 public void applyProcessedEvent(final Event event) {
   if (null != event) {
     // TODO: figure out the generic way of doing this
     if (Constants.CODE_DELETE == event.mKeyCode) {
       final int length = mCombinedText.length();
       if (length > 0) {
         final int lastCodePoint = mCombinedText.codePointBefore(length);
         mCombinedText.delete(length - Character.charCount(lastCodePoint), length);
       }
     } else {
       final CharSequence textToCommit = event.getTextToCommit();
       if (!TextUtils.isEmpty(textToCommit)) {
         mCombinedText.append(textToCommit);
       }
     }
   }
   updateStateFeedback();
 }