AsymmetricGridView icon indicating copy to clipboard operation
AsymmetricGridView copied to clipboard

How to apply set on item click listener on AsymmetricRecyclerView.

Open ashishsharma30 opened this issue 8 years ago • 15 comments

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

ashishsharma30 avatar Jul 30 '16 16:07 ashishsharma30

do you resolve this issue?

PhamUyen avatar Mar 18 '17 17:03 PhamUyen

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.

mathias21 avatar Apr 14 '17 19:04 mathias21

yes. thank you so much

2017-04-15 2:49 GMT+07:00 Jorge [email protected]:

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 .

PhamUyen avatar Apr 15 '17 04:04 PhamUyen

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.

mathias21 avatar Apr 15 '17 09:04 mathias21

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

2017-04-15 16:59 GMT+07:00 Jorge [email protected]:

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 .

PhamUyen avatar Apr 16 '17 03:04 PhamUyen

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

krishnapatel086 avatar Apr 11 '18 09:04 krishnapatel086

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.

mathias21 avatar Apr 11 '18 09:04 mathias21

what can i change inside method?

krishnapatel086 avatar Apr 11 '18 10:04 krishnapatel086

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

mathias21 avatar Apr 11 '18 11:04 mathias21

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

krishnapatel086 avatar Apr 11 '18 11:04 krishnapatel086

@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(); }

ashishsharma30 avatar Apr 11 '18 11:04 ashishsharma30

i use recyclerview

krishnapatel086 avatar Apr 11 '18 11:04 krishnapatel086

@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); } }); }

ashishsharma30 avatar Apr 11 '18 11:04 ashishsharma30

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

krishnapatel086 avatar Apr 11 '18 11:04 krishnapatel086

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

xin78693304 avatar Jan 23 '24 20:01 xin78693304