Merge pull request #4951 from osmandapp/PaulsBranch

Pauls branch
This commit is contained in:
Alexander Sytnyk 2018-01-26 17:07:26 +02:00 committed by GitHub
commit d662b44c19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View file

@ -705,9 +705,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
}
@Override
public void onItemClick(View view) {
public void onItemClick(int position) {
if (mapActivity != null && measurementLayer != null) {
int position = pointsRv.indexOfChild(view);
if (pointsListOpened) {
hidePointsList();
}

View file

@ -52,12 +52,6 @@ public class MeasurementToolAdapter extends RecyclerView.Adapter<MeasurementTool
final int backgroundColor = ContextCompat.getColor(mapActivity,
nightMode ? R.color.ctx_menu_info_view_bg_dark : R.color.ctx_menu_info_view_bg_light);
view.setBackgroundColor(backgroundColor);
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
listener.onItemClick(view);
}
});
return new MeasureToolItemVH(view);
}
@ -129,6 +123,12 @@ public class MeasurementToolAdapter extends RecyclerView.Adapter<MeasurementTool
listener.onRemoveClick(holder.getAdapterPosition());
}
});
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
listener.onItemClick(holder.getAdapterPosition());
}
});
}
@Override
@ -174,7 +174,7 @@ public class MeasurementToolAdapter extends RecyclerView.Adapter<MeasurementTool
void onRemoveClick(int position);
void onItemClick(View view);
void onItemClick(int position);
void onDragStarted(RecyclerView.ViewHolder holder);