diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java index c7b7b3c709..eb82305124 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/PlanRouteFragment.java @@ -1,6 +1,7 @@ package net.osmand.plus.mapmarkers; import android.graphics.drawable.Drawable; +import android.os.Build; import android.os.Bundle; import android.support.annotation.DrawableRes; import android.support.annotation.Nullable; @@ -14,6 +15,7 @@ import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.ViewTreeObserver; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; @@ -221,6 +223,24 @@ public class PlanRouteFragment extends Fragment implements OsmAndLocationListene markersRv.setLayoutManager(new LinearLayoutManager(getContext())); markersRv.setAdapter(adapter); + if (portrait) { + showMarkersList(); + } else { + mainView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { + @Override + public void onGlobalLayout() { + showMarkersList(); + + ViewTreeObserver obs = mainView.getViewTreeObserver(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + obs.removeOnGlobalLayoutListener(this); + } else { + obs.removeGlobalOnLayoutListener(this); + } + } + }); + } + return view; } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersItemTouchHelperCallback.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersItemTouchHelperCallback.java index f8829b793c..32f08e9e0d 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersItemTouchHelperCallback.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersItemTouchHelperCallback.java @@ -132,8 +132,10 @@ public class MapMarkersItemTouchHelperCallback extends ItemTouchHelper.Callback @Override public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { super.clearView(recyclerView, viewHolder); - ((MapMarkerItemViewHolder) viewHolder).optionsBtn.setVisibility(View.VISIBLE); - iconHidden = false; + if (iconHidden) { + ((MapMarkerItemViewHolder) viewHolder).optionsBtn.setVisibility(View.VISIBLE); + iconHidden = false; + } adapter.onItemDismiss(viewHolder); } diff --git a/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java b/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java index f5129c680a..f08e20539a 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java @@ -41,6 +41,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe private final ContextMenuLayer contextMenuLayer; private final MeasurementToolLayer measurementToolLayer; + private final MapMarkersLayer mapMarkersLayer; private ImageView contextMarker; private final MapActivity mapActivity; private final OsmandApplication app; @@ -66,6 +67,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe settings = activity.getMyApplication().getSettings(); quickActionRegistry = activity.getMapLayers().getQuickActionRegistry(); measurementToolLayer = mapActivity.getMapLayers().getMeasurementToolLayer(); + mapMarkersLayer = mapActivity.getMapLayers().getMapMarkersLayer(); } @@ -323,6 +325,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe contextMenuLayer.isInChangeMarkerPositionMode() || contextMenuLayer.isInGpxDetailsMode() || measurementToolLayer.isInMeasurementMode() || + mapMarkersLayer.isInPlanRouteMode() || mapActivity.getContextMenu().isVisible() && !mapActivity.getContextMenu().findMenuFragment().get().isRemoving() || mapActivity.getContextMenu().isVisible() && mapActivity.getContextMenu().findMenuFragment().get().isAdded() || mapActivity.getContextMenu().getMultiSelectionMenu().isVisible() && mapActivity.getContextMenu().getMultiSelectionMenu().getFragmentByTag().isAdded() ||