felipecsl / AsymmetricGridView

Android ListView that mimics a GridView with asymmetric items. Supports items with row span and column span
http://felipecsl.com/AsymmetricGridView
MIT License
1.84k stars 431 forks source link

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

Open ashishsharma30 opened 8 years ago

ashishsharma30 commented 8 years ago

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

PhamUyen commented 7 years ago

do you resolve this issue?

mathias21 commented 7 years ago

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 commented 7 years ago

yes. thank you so much

2017-04-15 2:49 GMT+07:00 Jorge notifications@github.com:

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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/felipecsl/AsymmetricGridView/issues/59#issuecomment-294223343, or mute the thread https://github.com/notifications/unsubscribe-auth/ARMfXKrN5WXb9sVg5HjxJAleZr9eX9jzks5rv83JgaJpZM4JY1xQ .

mathias21 commented 7 years ago

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 commented 7 years ago

yes, i did that,too. =)))

2017-04-15 16:59 GMT+07:00 Jorge notifications@github.com:

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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/felipecsl/AsymmetricGridView/issues/59#issuecomment-294283758, or mute the thread https://github.com/notifications/unsubscribe-auth/ARMfXAeGm5ID36mD5ay6NFGJl5Yr6vaSks5rwJTzgaJpZM4JY1xQ .

krishnapatel086 commented 6 years ago

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

mathias21 commented 6 years ago

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 commented 6 years ago

what can i change inside method?

mathias21 commented 6 years ago

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

krishnapatel086 commented 6 years ago

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

ashishsharma30 commented 6 years ago

@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 commented 6 years ago

i use recyclerview

ashishsharma30 commented 6 years ago

@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 commented 6 years ago

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

xin78693304 commented 7 months ago

您的邮件我已收到。我会尽快阅读。非常感谢您。