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-12139: Android: Textfield change event behaves differently in 2.1.4 and 3.0.0 SDK #4072

Merged
merged 3 commits into from Apr 9, 2013

Conversation

pingwang2011
Copy link
Contributor

@ghost ghost assigned hieupham007 Apr 4, 2013
{

if (maxLength >= 0 && editable.length() > maxLength) {
isTruncatingText = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you setting this to true then to false in the same function call?

@hieupham007
Copy link
Contributor

Code reviewed. Please address comments.

if (cursor > maxLength) {
cursor = maxLength;
}
tv.setText(newText);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We set isTruncatingText to true in this if block because we truncate the characters and reset text. The function tv.setText(newText) here will directly invoke onTextChanged() and afterTextChanged() again. But maybe I should return here to make it more clear.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return here would be a behavior change from this code. Can you comment on this code to make it more clear?

@pingwang2011
Copy link
Contributor Author

Updated.

@hieupham007
Copy link
Contributor

Code reviewed and functionally tested. Request accepted

hieupham007 added a commit that referenced this pull request Apr 9, 2013
timob-12139: Android: Textfield change event behaves differently in 2.1.4 and 3.0.0 SDK
@hieupham007 hieupham007 merged commit fbeb4e4 into tidev:master Apr 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants