diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java index 142482c851..c46c6e0656 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java @@ -14,6 +14,7 @@ import android.support.v4.content.ContextCompat; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.helper.ItemTouchHelper; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -24,6 +25,7 @@ import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.mapmarkers.adapters.MapMarkerDateViewHolder; +import net.osmand.plus.mapmarkers.adapters.MapMarkerItemViewHolder; import net.osmand.plus.mapmarkers.adapters.MapMarkersHistoryAdapter; public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHelper.MapMarkerChangedListener { @@ -81,6 +83,17 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel private Bitmap deleteBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_action_delete_dark); private Bitmap resetBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_action_reset_to_default_dark); + @Override + public int getSwipeDirs(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { + if (viewHolder instanceof MapMarkerDateViewHolder) { + return 0; + } + if (viewHolder instanceof MapMarkerItemViewHolder) { + ((MapMarkerItemViewHolder) viewHolder).setOptionsButtonVisibility(View.GONE); + } + return super.getSwipeDirs(recyclerView, viewHolder); + } + @Override public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) { return false; @@ -107,11 +120,11 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel } @Override - public int getSwipeDirs(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { - if (viewHolder instanceof MapMarkerDateViewHolder) { - return 0; + public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { + if (viewHolder instanceof MapMarkerItemViewHolder) { + ((MapMarkerItemViewHolder) viewHolder).setOptionsButtonVisibility(View.VISIBLE); } - return super.getSwipeDirs(recyclerView, viewHolder); + super.clearView(recyclerView, viewHolder); } @Override diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerItemViewHolder.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerItemViewHolder.java index d3042e2090..7f63f34b7b 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerItemViewHolder.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerItemViewHolder.java @@ -30,4 +30,8 @@ public class MapMarkerItemViewHolder extends RecyclerView.ViewHolder { description = (TextView) view.findViewById(R.id.map_marker_description); optionsBtn = (ImageButton) view.findViewById(R.id.map_marker_options_button); } + + public void setOptionsButtonVisibility(int visibility) { + optionsBtn.setVisibility(visibility); + } }