delete quick action fix; hide drawer/direction in quick action mode

This commit is contained in:
Korusn Oleksandr 2016-12-28 12:42:56 +02:00
parent 285ee3d266
commit 01fdcf112d
3 changed files with 16 additions and 11 deletions

View file

@ -173,6 +173,7 @@ public class MapActivityLayers {
mapQuickActionLayer = new MapQuickActionLayer(activity, contextMenuLayer);
mapView.addLayer(mapQuickActionLayer, 12);
contextMenuLayer.setMapQuickActionLayer(mapQuickActionLayer);
mapControlsLayer.setMapQuickActionLayer(mapQuickActionLayer);
transparencyListener = new StateChangedListener<Integer>() {
@Override

View file

@ -7,7 +7,6 @@ import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.MotionEventCompat;
import android.support.v7.app.AlertDialog;
@ -278,9 +277,10 @@ public class QuickActionListFragment extends BaseOsmAndFragment implements Quick
}
notifyItemRangeChanged(position, itemsList.size() - position);
if (itemsList.size() == 1){
itemsList.remove(0);
notifyItemRemoved(0);
int lastPosition = itemsList.size() - 1;
if (getItemViewType(lastPosition) == SCREEN_HEADER_TYPE){
itemsList.remove(lastPosition);
notifyItemRemoved(lastPosition);
}
}

View file

@ -99,6 +99,7 @@ public class MapControlsLayer extends OsmandMapLayer {
private long lastZoom;
private boolean hasTargets;
private ContextMenuLayer contextMenuLayer;
private MapQuickActionLayer mapQuickActionLayer;
private boolean forceShowCompass;
public MapControlsLayer(MapActivity activity) {
@ -395,9 +396,6 @@ public class MapControlsLayer extends OsmandMapLayer {
backToMenuButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mapActivity.getMapView().getLayerByClass(MapQuickActionLayer.class).setLayerState(true))
return;
MapActivity.clearPrevActivityIntent();
if (dash) {
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.DASHBOARD);
@ -415,9 +413,6 @@ public class MapControlsLayer extends OsmandMapLayer {
routePlanButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mapActivity.getMapView().getLayerByClass(MapQuickActionLayer.class).setLayerState(true))
return;
doRoute(false);
}
});
@ -634,7 +629,7 @@ public class MapControlsLayer extends OsmandMapLayer {
boolean showRouteCalculationControls = routePlanningMode ||
((app.accessibilityEnabled() || (System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS)) && routeFollowingMode);
updateMyLocation(rh, dialogOpened);
boolean showButtons = (showRouteCalculationControls || !routeFollowingMode) && !contextMenuLayer.isInChangeMarkerPositionMode();
boolean showButtons = (showRouteCalculationControls || !routeFollowingMode) && !isInChangeMarkerPositionMode();
//routePlanningBtn.setIconResId(routeFollowingMode ? R.drawable.ic_action_gabout_dark : R.drawable.map_directions);
if (rh.isFollowingMode()) {
routePlanningBtn.setIconResId(R.drawable.map_start_navigation);
@ -1035,6 +1030,15 @@ public class MapControlsLayer extends OsmandMapLayer {
return zoomText;
}
public void setMapQuickActionLayer(MapQuickActionLayer mapQuickActionLayer) {
this.mapQuickActionLayer = mapQuickActionLayer;
}
private boolean isInChangeMarkerPositionMode(){
return mapQuickActionLayer == null ? contextMenuLayer.isInChangeMarkerPositionMode() :
mapQuickActionLayer.isInChangeMarkerPositionMode() || contextMenuLayer.isInChangeMarkerPositionMode();
}
public static View.OnLongClickListener getOnClickMagnifierListener(final OsmandMapTileView view) {
return new View.OnLongClickListener() {