예제 #1
0
 /**
  * Send a request to the native counterpart to delete a given range of characters.
  *
  * @param beforeLength Number of characters to extend the selection by before the existing
  *     selection.
  * @param afterLength Number of characters to extend the selection by after the existing
  *     selection.
  * @return Whether the native counterpart of ImeAdapter received the call.
  */
 boolean deleteSurroundingText(int beforeLength, int afterLength) {
   mViewEmbedder.onImeEvent();
   if (mNativeImeAdapterAndroid == 0) return false;
   nativeSendSyntheticKeyEvent(
       mNativeImeAdapterAndroid,
       WebInputEventType.RawKeyDown,
       SystemClock.uptimeMillis(),
       COMPOSITION_KEY_CODE,
       0,
       0);
   nativeDeleteSurroundingText(mNativeImeAdapterAndroid, beforeLength, afterLength);
   nativeSendSyntheticKeyEvent(
       mNativeImeAdapterAndroid,
       WebInputEventType.KeyUp,
       SystemClock.uptimeMillis(),
       COMPOSITION_KEY_CODE,
       0,
       0);
   return true;
 }
예제 #2
0
 boolean deleteSurroundingText(int beforeLength, int afterLength) {
   if (mNativeImeAdapterAndroid == 0) return false;
   nativeDeleteSurroundingText(mNativeImeAdapterAndroid, beforeLength, afterLength);
   return true;
 }