Fix swipe in groups

This commit is contained in:
PavelRatushny 2017-09-21 18:47:33 +03:00
parent e5bb69053b
commit 75cc6162b7

View file

@ -83,8 +83,9 @@ public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassL
@Override @Override
public int getSwipeDirs(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { public int getSwipeDirs(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
boolean markerViewHolder = viewHolder instanceof MapMarkerItemViewHolder; boolean markerViewHolder = viewHolder instanceof MapMarkerItemViewHolder;
if (markerViewHolder) { int pos = viewHolder.getAdapterPosition();
MapMarker marker = (MapMarker) adapter.getItem(viewHolder.getAdapterPosition()); if (markerViewHolder && pos != -1) {
MapMarker marker = (MapMarker) adapter.getItem(pos);
if (marker.history) { if (marker.history) {
return ItemTouchHelper.RIGHT; return ItemTouchHelper.RIGHT;
} else { } else {