thefex / Xamarin.Bindings.AdvancedRecyclerView

Xamarin Android binding library for: https://github.com/h6ah4i/android-advancedrecyclerview
Apache License 2.0
0 stars 0 forks source link

All Clicks don't work on v 1.16.2 #17

Closed Nikdm46 closed 2 years ago

Nikdm46 commented 4 years ago

All Clicks don't work on v 1.16.2

For Header Click/LongClick bind to: HeaderClickCommand/HeaderLongClickCommand

For Footer Click/LongClick bind to: FooterClickCommand/FooterLongClickCommand

For Item Click (non expandable/grouped recyclerview) bind to: ItemClick/ItemLongClick

For Group Item Click ( expandable/grouped recyclerview) bind to: GroupItemClick/GroupItemLongClick

For Child Item Click ( expandable / grouped recyclerview) bind to: ChildItemClick/ChildItemLongClick
NeuronKarrde commented 4 years ago

As I investigated, click subscribing changed in MvxAdvancedRecyclerViewHolder(moved to OnAttachedToWindow). But OnAttachedToWindow method never invokes @thefex My suggestion is to add advancedRecyclerViewHolder.OnAttachedToWindow(); to MvxExpandableItemAdapter.OnBindChildViewHolder and MvxExpandableItemAdapter.OnBindGroupViewHolder. Could you please verify that?

NeuronKarrde commented 4 years ago

Oh, found one workaround. You can subscribe to ChildItemBound and GroupItemBound and call OnAttachedToWindow public override void OnStart() { base.OnStart(); _recyclerView.ExpandableItemAdapter.ChildItemBound += ExpandableItemAdapterOnChildItemBound; }

  public override void OnStop()
  {
      base.OnStop();
      _recyclerView.ExpandableItemAdapter.ChildItemBound -= ExpandableItemAdapterOnChildItemBound;
  }

  private void ExpandableItemAdapterOnChildItemBound(MvxExpandableItemAdapterBoundedArgs obj)
  {
     obj.ViewHolder.OnAttachedToWindow();
  }
evgenyvalavin commented 4 years ago

Came across the same problem. ChildItemClick in ExpandableRecyclerView doesn't work for me since v1.16.1

MaximST92 commented 4 years ago

@NeuronKarrde Thanks for the workaround. Is there a version planned where this issue will be resolved?

thefex commented 2 years ago

Fixed.