Fix recycler view positions
This commit is contained in:
parent
b88bed8e01
commit
1810e5fcbf
2 changed files with 2 additions and 2 deletions
|
@ -49,7 +49,7 @@ public class MapMarkersActiveFragment extends Fragment implements OsmAndCompassL
|
|||
|
||||
@Override
|
||||
public void onItemClick(View view) {
|
||||
int pos = recyclerView.indexOfChild(view);
|
||||
int pos = recyclerView.getChildAdapterPosition(view);
|
||||
MapMarker marker = adapter.getItem(pos);
|
||||
mapActivity.getMyApplication().getSettings().setMapLocationToShow(marker.getLatitude(), marker.getLongitude(),
|
||||
15, marker.getPointDescription(mapActivity), true, marker);
|
||||
|
|
|
@ -46,7 +46,7 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel
|
|||
adapter.setAdapterListener(new MapMarkersHistoryAdapter.MapMarkersHistoryAdapterListener() {
|
||||
@Override
|
||||
public void onItemClick(View view) {
|
||||
int pos = recyclerView.indexOfChild(view);
|
||||
int pos = recyclerView.getChildAdapterPosition(view);
|
||||
Object item = adapter.getItem(pos);
|
||||
if (item instanceof MapMarker) {
|
||||
MapMarker marker = (MapMarker) item;
|
||||
|
|
Loading…
Reference in a new issue