Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for handling enter key event on Google keyboard #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ Use `setTags(...)` to set the initial tags in the group.

To "submit" a new tag as user press "Enter" or tap the blank area of the tag group, also you can "submit" a new tag via `submitTag()`.

**Note**: Google keyboard (a few soft keyboard not honour the key event) currently not supported "Enter" key to "submit" a new tag.

#### How to delete a tag?

To delete a tag as user press "Backspace" key or double-tap the tag which you want to delete.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.text.Editable;
import android.text.InputType;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.ArrowKeyMovementMethod;
Expand Down Expand Up @@ -736,6 +737,9 @@ public boolean onLongClick(View v) {

if (state == STATE_INPUT) {
requestFocus();
//Replace Enter (new line) button with Action Go
setRawInputType(InputType.TYPE_CLASS_TEXT);
setImeOptions(EditorInfo.IME_ACTION_GO);

// Handle the ENTER key down.
setOnEditorActionListener(new OnEditorActionListener() {
Expand Down Expand Up @@ -1022,4 +1026,4 @@ public boolean deleteSurroundingText(int beforeLength, int afterLength) {
}
}
}
}
}