Fix space before second row

This commit is contained in:
PavelRatushny 2017-09-14 14:05:34 +03:00
parent 3a70579de7
commit 82b0a08ff4
3 changed files with 21 additions and 4 deletions

View file

@ -80,12 +80,15 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginRight="4dp"
android:layout_marginEnd="4dp"
android:maxLines="1" android:maxLines="1"
android:textSize="@dimen/default_desc_text_size" android:textSize="@dimen/default_desc_text_size"
tools:text="213 m"/> tools:text="213 m"/>
<View
android:id="@+id/map_marker_left_point_space"
android:layout_width="4dp"
android:layout_height="wrap_content"/>
<android.support.v7.widget.AppCompatTextView <android.support.v7.widget.AppCompatTextView
android:id="@+id/map_marker_point_text_view" android:id="@+id/map_marker_point_text_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -97,13 +100,16 @@
android:visibility="gone" android:visibility="gone"
tools:visibility="visible"/> tools:visibility="visible"/>
<View
android:id="@+id/map_marker_right_point_space"
android:layout_width="4dp"
android:layout_height="wrap_content"/>
<android.support.v7.widget.AppCompatTextView <android.support.v7.widget.AppCompatTextView
android:id="@+id/map_marker_description" android:id="@+id/map_marker_description"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:textColor="?android:textColorSecondary" android:textColor="?android:textColorSecondary"

View file

@ -16,7 +16,9 @@ public class MapMarkerItemViewHolder extends RecyclerView.ViewHolder {
final ImageView icon; final ImageView icon;
final TextView title; final TextView title;
final TextView distance; final TextView distance;
final View leftPointSpace;
final TextView point; final TextView point;
final View rightPointSpace;
final TextView description; final TextView description;
final ImageButton optionsBtn; final ImageButton optionsBtn;
final View divider; final View divider;
@ -30,7 +32,9 @@ public class MapMarkerItemViewHolder extends RecyclerView.ViewHolder {
icon = (ImageView) view.findViewById(R.id.map_marker_icon); icon = (ImageView) view.findViewById(R.id.map_marker_icon);
title = (TextView) view.findViewById(R.id.map_marker_title); title = (TextView) view.findViewById(R.id.map_marker_title);
distance = (TextView) view.findViewById(R.id.map_marker_distance); distance = (TextView) view.findViewById(R.id.map_marker_distance);
leftPointSpace = view.findViewById(R.id.map_marker_left_point_space);
point = (TextView) view.findViewById(R.id.map_marker_point_text_view); point = (TextView) view.findViewById(R.id.map_marker_point_text_view);
rightPointSpace = view.findViewById(R.id.map_marker_right_point_space);
description = (TextView) view.findViewById(R.id.map_marker_description); description = (TextView) view.findViewById(R.id.map_marker_description);
optionsBtn = (ImageButton) view.findViewById(R.id.map_marker_options_button); optionsBtn = (ImageButton) view.findViewById(R.id.map_marker_options_button);
divider = view.findViewById(R.id.divider); divider = view.findViewById(R.id.divider);
@ -48,4 +52,9 @@ public class MapMarkerItemViewHolder extends RecyclerView.ViewHolder {
public void setBottomShadowVisibility(int visibility) { public void setBottomShadowVisibility(int visibility) {
bottomShadow.setVisibility(visibility); bottomShadow.setVisibility(visibility);
} }
public void setPointSpaceVisibility(int visibility) {
leftPointSpace.setVisibility(visibility);
rightPointSpace.setVisibility(visibility);
}
} }

View file

@ -132,6 +132,8 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter<RecyclerView.
notifyItemRemoved(position); notifyItemRemoved(position);
} }
}); });
itemViewHolder.setIconDirectionVisibility(View.GONE);
itemViewHolder.setPointSpaceVisibility(View.GONE);
if (position == getItemCount() - 1) { if (position == getItemCount() - 1) {
((MapMarkerItemViewHolder) holder).setBottomShadowVisibility(View.VISIBLE); ((MapMarkerItemViewHolder) holder).setBottomShadowVisibility(View.VISIBLE);
} else { } else {