Пример #1
0
 private void cursorIsInShowingView(EditableLineView v) {
   int s = v.getShowingTextStartPosition();
   int e = v.getShowingTextEndPosition();
   int c = v.getLeft().getCursorCol();
   if (!(s <= c && c <= e)) {
     v.recenter();
   }
 }
Пример #2
0
  public void updateCommitTextFromIME(
      EditableLineView mTextView, EditableLineViewBuffer mTextBuffer) {
    // following code is yaxutuke sigoto
    if (!mTextView.isFocus()) {
      return;
    }
    setMode(mTextView.getMode());
    if (mTextView.getMyInputConnection() == null) {
      return;
    }
    mTextView.getMyInputConnection().setIMEController(KeyEventManager.this);
    MyInputConnection c = mTextView.getMyInputConnection();
    if (c == null) {
      return;
    }

    mTextBuffer.IsCrlfMode(mTextView.isCrlfMode());

    boolean first = true;
    while (true) {
      CommitText text = c.popFirst();
      if (text != null) {
        mTextView.getStage(mTextView).resetTimer();
        if (first == true) {
          cursorIsInShowingView(mTextView);
          first = false;
        }
        // android.util.Log.v("kiyo","key= #");
        mTextBuffer.setCursor(
            mTextView.getLeft().getCursorRow(), mTextView.getLeft().getCursorCol());
        a(text, mTextView, mTextBuffer);
        mTextView.getLeft().setCursorRow(mTextBuffer.getRow());
        mTextView.getLeft().setCursorCol(mTextBuffer.getCol());
      } else {
        break;
      }
    }
  }