Add small changes
This commit is contained in:
parent
3dcc410fd7
commit
8f00527bd7
2 changed files with 6 additions and 5 deletions
|
@ -19,8 +19,8 @@ import java.util.List;
|
|||
|
||||
class MeasurementToolAdapter extends RecyclerView.Adapter<MeasurementToolAdapter.Holder> {
|
||||
|
||||
private MapActivity mapActivity;
|
||||
private List<WptPt> points;
|
||||
private final MapActivity mapActivity;
|
||||
private final List<WptPt> points;
|
||||
private RemovePointListener removePointListener;
|
||||
private ItemClickListener itemClickListener;
|
||||
|
||||
|
|
|
@ -201,6 +201,7 @@ public class MeasurementToolFragment extends Fragment {
|
|||
}
|
||||
|
||||
adapter = new MeasurementToolAdapter(getMapActivity(), measurementLayer.getMeasurementPoints());
|
||||
final RecyclerView rv = mainView.findViewById(R.id.measure_points_recycler_view);
|
||||
adapter.setRemovePointListener(new MeasurementToolAdapter.RemovePointListener() {
|
||||
@Override
|
||||
public void onPointRemove() {
|
||||
|
@ -215,9 +216,6 @@ public class MeasurementToolFragment extends Fragment {
|
|||
}
|
||||
}
|
||||
});
|
||||
final RecyclerView rv = mainView.findViewById(R.id.measure_points_recycler_view);
|
||||
rv.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
rv.setAdapter(adapter);
|
||||
adapter.setItemClickListener(new MeasurementToolAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(View view) {
|
||||
|
@ -225,6 +223,8 @@ public class MeasurementToolFragment extends Fragment {
|
|||
measurementLayer.moveMapToPoint(pos);
|
||||
}
|
||||
});
|
||||
rv.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
rv.setAdapter(adapter);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
@ -391,6 +391,7 @@ public class MeasurementToolFragment extends Fragment {
|
|||
super.onDestroyView();
|
||||
exitMeasurementMode();
|
||||
adapter.setRemovePointListener(null);
|
||||
adapter.setItemClickListener(null);
|
||||
if (pointsDetailsOpened) {
|
||||
setPreviousMapPosition();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue