Skip to content

Commit

Permalink
upgrade InputConnectionHacker.java
Browse files Browse the repository at this point in the history
  • Loading branch information
jecelyin committed Aug 23, 2017
1 parent 6e6a818 commit 808050a
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,19 @@

package com.jecelyin.editor.v2.widget.text;

import android.annotation.TargetApi;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.KeyEvent;
import android.view.inputmethod.CompletionInfo;
import android.view.inputmethod.CorrectionInfo;
import android.view.inputmethod.ExtractedText;
import android.view.inputmethod.ExtractedTextRequest;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputContentInfo;

/**
* @author Jecelyin Peng <jecelyin@gmail.com>
Expand Down Expand Up @@ -197,4 +202,28 @@ public boolean isSymPressed() {
public boolean isCtrlPressed() {
return isCtrlPressed;
}

@TargetApi(Build.VERSION_CODES.N)
@Override
public boolean deleteSurroundingTextInCodePoints(int beforeLength, int afterLength) {
return ic.deleteSurroundingTextInCodePoints(beforeLength, afterLength);
}

@TargetApi(Build.VERSION_CODES.N)
@Override
public Handler getHandler() {
return ic.getHandler();
}

@TargetApi(Build.VERSION_CODES.N)
@Override
public void closeConnection() {
ic.closeConnection();
}

@TargetApi(Build.VERSION_CODES.N_MR1)
@Override
public boolean commitContent(@NonNull InputContentInfo inputContentInfo, int flags, @Nullable Bundle opts) {
return ic.commitContent(inputContentInfo, flags, opts);
}
}

0 comments on commit 808050a

Please sign in to comment.