-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(android): add deselectItem to Androids ListView #14246
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
base: master
Are you sure you want to change the base?
Conversation
It would be better to trigger the automatic deselection of a |
For parity with the current iOS implementation, this is the correct way. Changing the default behavior could be inside future versions then. As it was not requested so far, it seems like low prio though. |
|
||
// not needed on Android but parity for iOS method call | ||
@Kroll.method | ||
public void deselectItem(int section, int item) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect an empty-function warning or something. Isn't that the case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A debug warning is better here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, if Android does not have the concept, it really should just not be exposed. I thought about it a bit more and think that it's much more clean instead of an empty function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it might be a good empty function as you have to use it on iOS so often and you always have to make the if OS_IOS
check before it because it will throw a "method not found" error on Android.
but as you've said: no requests by other people yet, just thought it might be a good convenient method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just write $.listView.deselectItem?.(event.sectionIndex, event.itemIndex)
for that :)
On iOS you use
$.lst_open.deselectItem(0, e.itemIndex)
to deselect a clicked item. This method is not needed on Android but also not available in the SDK so you have to add anif OS_IOS
all the time.This PR will just add an empty method to the Android ListView so you can remove the
if OS_IOS
statement.