Skip to content

ExpandableViewHolder#onClick should always call super #477

@technicalflaw

Description

@technicalflaw

Currently, onClick doesn't call super if the item isn't enabled or isViewExpandableOnClick() == false, but this stops any callbacks added to the adapter from being called, which should never be the case if the item is enabled. I think it should be the same as onLongClick().

public void onClick(View view) {
  if (mAdapter.isEnabled(getFlexibleAdapterPosition()) && isViewExpandableOnClick()) {
    toggleExpansion();
  }
  super.onClick(view);
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions