Skip to content
Closed
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
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ VERSION_CODE=8
GROUP=com.splitwise

ANDROID_BUILD_MIN_SDK_VERSION=14
ANDROID_BUILD_TARGET_SDK_VERSION=21
ANDROID_BUILD_SDK_VERSION=21
ANDROID_BUILD_TOOLS_VERSION=21.1.2
ANDROID_BUILD_TARGET_SDK_VERSION=22
ANDROID_BUILD_SDK_VERSION=23
ANDROID_BUILD_TOOLS_VERSION=23.0.2

POM_DESCRIPTION=Android Token AutoComplete EditText
POM_URL=https://github.com/splitwise/TokenAutoComplete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ private void init() {
addListeners();

setTextIsSelectable(false);
setLongClickable(false);

//In theory, get the soft keyboard to not supply suggestions. very unreliable < API 11
setInputType(getInputType() | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE);
Expand Down Expand Up @@ -1124,11 +1123,15 @@ private class TokenSpanWatcher implements SpanWatcher {
@Override
public void onSpanAdded(Spannable text, Object what, int start, int end) {
if (what instanceof TokenCompleteTextView<?>.TokenImageSpan && !savingState && !focusChanging) {
TokenImageSpan token = (TokenImageSpan) what;
objects.add(token.getToken());

if (listener != null)
listener.onTokenAdded(token.getToken());
TokenImageSpan tokenSpan = (TokenImageSpan)what;
final T token = tokenSpan.getToken();

// Android reinserts the spans under selection when the user
// cuts or copies some text from the context menu
if (allowDuplicates || !objects.contains(token)) {
objects.add(token);
if (listener != null) listener.onTokenAdded(token);
}
}
}

Expand Down