Skip to content

Commit

Permalink
Prevent swipe actions on the 'Pinned' header.
Browse files Browse the repository at this point in the history
  • Loading branch information
greyson-signal committed Aug 17, 2020
1 parent 3f7dd21 commit bdd298c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ private static class PlaceholderViewHolder extends RecyclerView.ViewHolder {
}
}

private static class HeaderViewHolder extends RecyclerView.ViewHolder {
static class HeaderViewHolder extends RecyclerView.ViewHolder {
private TextView headerText;

public HeaderViewHolder(@NonNull View itemView) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1022,8 +1022,9 @@ public boolean onMove(@NonNull RecyclerView recyclerView,

@Override
public int getSwipeDirs(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) {
if (viewHolder.itemView instanceof ConversationListItemAction ||
actionMode != null ||
if (viewHolder.itemView instanceof ConversationListItemAction ||
viewHolder instanceof ConversationListAdapter.HeaderViewHolder ||
actionMode != null ||
activeAdapter == searchAdapter)
{
return 0;
Expand Down

0 comments on commit bdd298c

Please sign in to comment.