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

timob-15535: Revert timob-14615 #5202

Merged
merged 1 commit into from
Jan 10, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,7 @@ public void handleKeyboard(KrollDict d)
if ((autocorrect != InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS || passwordMask) && type != KEYBOARD_DECIMAL_PAD) {
textTypeAndClass = textTypeAndClass | InputType.TYPE_CLASS_TEXT;
}
if (!field) {
tv.setSingleLine(false);
}

tv.setCursorVisible(true);
switch(type) {
case KEYBOARD_DEFAULT:
Expand Down Expand Up @@ -532,6 +530,12 @@ protected char[] getAcceptedChars() {
tv.setKeyListener(null);
tv.setCursorVisible(false);
}

//setSingleLine() append the flag TYPE_TEXT_FLAG_MULTI_LINE to the current inputType, so we want to call this
//after we set inputType.
if (!field) {
tv.setSingleLine(false);
}

}

Expand Down Expand Up @@ -583,13 +587,8 @@ public void handleReturnKeyType(int type)
break;
}

int currentInputType = tv.getInputType();
//FLAG_MULTI_LINE will display enter key, therefore disables our ime options.
if (!field && (currentInputType & InputType.TYPE_TEXT_FLAG_MULTI_LINE) != 0) {
currentInputType &= ~InputType.TYPE_TEXT_FLAG_MULTI_LINE;
}
//Set input type caches ime options, so whenever we change ime options, we must reset input type
tv.setInputType(currentInputType);
tv.setInputType(tv.getInputType());
}

}