Fix divider in history

This commit is contained in:
PavelRatushny 2017-09-22 15:37:52 +03:00
parent caccd76c15
commit c52c7eb1a9

View file

@ -154,13 +154,13 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter<RecyclerView.
itemViewHolder.iconDirection.setVisibility(View.GONE); itemViewHolder.iconDirection.setVisibility(View.GONE);
itemViewHolder.leftPointSpace.setVisibility(View.GONE); itemViewHolder.leftPointSpace.setVisibility(View.GONE);
itemViewHolder.rightPointSpace.setVisibility(View.GONE); itemViewHolder.rightPointSpace.setVisibility(View.GONE);
if (position == getItemCount() - 1) { boolean lastItem = position == getItemCount() - 1;
itemViewHolder.bottomShadow.setVisibility(View.VISIBLE); if ((getItemCount() > position + 1 && getItemViewType(position + 1) == HEADER_TYPE) || lastItem) {
itemViewHolder.divider.setVisibility(View.GONE); itemViewHolder.divider.setVisibility(View.GONE);
} else { } else {
itemViewHolder.bottomShadow.setVisibility(View.GONE);
itemViewHolder.divider.setVisibility(View.VISIBLE); itemViewHolder.divider.setVisibility(View.VISIBLE);
} }
itemViewHolder.bottomShadow.setVisibility(lastItem ? View.VISIBLE : View.GONE);
} else if (holder instanceof MapMarkerHeaderViewHolder) { } else if (holder instanceof MapMarkerHeaderViewHolder) {
final MapMarkerHeaderViewHolder dateViewHolder = (MapMarkerHeaderViewHolder) holder; final MapMarkerHeaderViewHolder dateViewHolder = (MapMarkerHeaderViewHolder) holder;
final Integer dateHeader = (Integer) getItem(position); final Integer dateHeader = (Integer) getItem(position);