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

How to apply set on item click listener on AsymmetricRecyclerView. #59

Open
ashishsharma30 opened this issue Jul 30, 2016 · 15 comments
Open

Comments

@ashishsharma30
Copy link

Hi,
can you please tell me how to apply set on item click listener on AsymmetricRecyclerView.

@PhamUyen
Copy link

do you resolve this issue?

@mathias21
Copy link

AsymmetricRecyclerView is implementing

public void fireOnItemClick(int index, View v)

method that is empty. There is only one way to solve this, extending the class and redefine it or make a PR with a different implementation.

@PhamUyen
Copy link

PhamUyen commented Apr 15, 2017 via email

@mathias21
Copy link

You can also checkout the code and include "library" module in your project. Then modify the method directly in the AsymmetricRecyclerView. That is what I did. Maybe in a future I will make a PR.

@PhamUyen
Copy link

PhamUyen commented Apr 16, 2017 via email

@krishnapatel086
Copy link

Hi,
can you please tell me how to apply set on item click listener on AsymmetricRecyclerView.

@mathias21
Copy link

Hi @krishnapatel086

If this was not fixed (not sure) you need to redefine the method by yourself, please check comments above. You need to implement it either importing the project as module and changing the code in it or extending the class and overriding the method implementation.

@krishnapatel086
Copy link

what can i change inside method?

@mathias21
Copy link

You need to define there the behaviour you would expect. Currently it is empty, so nothing will happen.

@krishnapatel086
Copy link

but i need to open new activity after click so what i hv to do?

@ashishsharma30
Copy link
Author

@krishnapatel086 try this

1st Step : implements AdapterView.OnItemClickListener

2nd Step : listView.setOnItemClickListener(this);

3rd Step :

@OverRide public void onItemClick(@nonnull AdapterView<?> parent, @nonnull View view,
int position, long id) {
Toast.makeText(this, "Item " + position + " clicked", Toast.LENGTH_SHORT).show();
}

@krishnapatel086
Copy link

i use recyclerview

@ashishsharma30
Copy link
Author

ashishsharma30 commented Apr 11, 2018

@krishnapatel086 in ViewHolder

try to in bind method.

public void bind(final ContentItem item, final OnItemClickListener listener) {
itemView.setOnClickListener(new View.OnClickListener() {
@OverRide public void onClick(View v) {
listener.onItemClick(item);
}
});
}

@krishnapatel086
Copy link

i use recyclerView.fireOnItemClick(rowItem.rowItem.getIndex(), v); now what i have to do?

@xin78693304
Copy link

xin78693304 commented Jan 23, 2024 via email

Repository owner deleted a comment Jan 31, 2024
Repository owner deleted a comment Feb 2, 2024
Repository owner deleted a comment from chasedson Feb 7, 2024
Repository owner deleted a comment from mrpanday93 Feb 15, 2024
Repository owner deleted a comment from devarya Feb 16, 2024
Repository owner deleted a comment from mkproject-admin Feb 21, 2024
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

No branches or pull requests

5 participants