fix selection mode for reposts on Publishes page

This commit is contained in:
Akinwale Ariwodola 2020-05-28 03:45:56 +01:00
parent e6861c8436
commit a40c160ac6
2 changed files with 3 additions and 2 deletions

View file

@ -327,7 +327,7 @@ public class ClaimListAdapter extends RecyclerView.Adapter<ClaimListAdapter.View
} }
boolean isPending = item.getConfirmations() == 0; boolean isPending = item.getConfirmations() == 0;
boolean isSelected = isClaimSelected(item); boolean isSelected = isClaimSelected(original);
vh.itemView.setSelected(isSelected); vh.itemView.setSelected(isSelected);
vh.selectedOverlayView.setVisibility(isSelected ? View.VISIBLE : View.GONE); vh.selectedOverlayView.setVisibility(isSelected ? View.VISIBLE : View.GONE);
vh.itemView.setOnClickListener(new View.OnClickListener() { vh.itemView.setOnClickListener(new View.OnClickListener() {

View file

@ -239,7 +239,8 @@ public class PublishesFragment extends BaseFragment implements ActionMode.Callba
@Override @Override
public boolean onPrepareActionMode(androidx.appcompat.view.ActionMode actionMode, Menu menu) { public boolean onPrepareActionMode(androidx.appcompat.view.ActionMode actionMode, Menu menu) {
int selectionCount = adapter != null ? adapter.getSelectedCount() : 0; int selectionCount = adapter != null ? adapter.getSelectedCount() : 0;
menu.findItem(R.id.action_edit).setVisible(selectionCount == 1); menu.findItem(R.id.action_edit).setVisible(selectionCount == 1 &&
Claim.TYPE_STREAM.equalsIgnoreCase(adapter.getSelectedItems().get(0).getValueType()));
return true; return true;
} }