Added possibility to open waypoints in drawer
This commit is contained in:
parent
129f8599d1
commit
54be98dfd6
6 changed files with 580 additions and 425 deletions
|
@ -1,24 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
<ImageView android:id="@+id/icon"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"/>
|
|
||||||
<TextView android:id="@+id/descr"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"/>
|
|
||||||
<TextView android:id="@+id/title"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"/>
|
|
||||||
<ImageButton android:id="@+id/remove"
|
|
||||||
android:focusable="false"
|
|
||||||
android:layout_marginLeft="11dp"
|
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"/>
|
|
||||||
</LinearLayout>
|
|
54
OsmAnd/res/layout/drawer_list_waypoint_header.xml
Normal file
54
OsmAnd/res/layout/drawer_list_waypoint_header.xml
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_marginRight="3dp">
|
||||||
|
|
||||||
|
<ImageView android:id="@+id/icon"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
<TextView android:id="@+id/title"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:text="@string/waypoints"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:textSize="20sp"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/sort"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:focusable="false"
|
||||||
|
android:layout_marginRight="8dp"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/edit"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:focusable="false"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:layout_marginRight="8dp"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/all"
|
||||||
|
android:contentDescription="@string/flat_list_waypoints"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:focusable="false"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:layout_marginRight="8dp"/>
|
||||||
|
</LinearLayout>
|
|
@ -40,12 +40,6 @@ import android.widget.TextView;
|
||||||
|
|
||||||
public class IntermediatePointsDialog {
|
public class IntermediatePointsDialog {
|
||||||
|
|
||||||
|
|
||||||
public static void openIntermediatePointsDialog(MapActivity mapActivity){
|
|
||||||
// openIntermediatePointsDialog(mapActivity, (OsmandApplication) mapActivity.getApplication(), false);
|
|
||||||
WaypointDialogHelper.showWaypointsDialog(mapActivity, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void openIntermediatePointsDialog(final Activity activity,
|
public static void openIntermediatePointsDialog(final Activity activity,
|
||||||
final OsmandApplication app, final boolean changeOrder){
|
final OsmandApplication app, final boolean changeOrder){
|
||||||
TargetPointsHelper targets = app.getTargetPointsHelper();
|
TargetPointsHelper targets = app.getTargetPointsHelper();
|
||||||
|
|
|
@ -1,38 +1,28 @@
|
||||||
package net.osmand.plus.activities;
|
package net.osmand.plus.activities;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.Collator;
|
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.londatiga.android.ActionItem;
|
import net.londatiga.android.ActionItem;
|
||||||
import net.londatiga.android.QuickAction;
|
import net.londatiga.android.QuickAction;
|
||||||
import net.osmand.AndroidUtils;
|
|
||||||
import net.osmand.IndexConstants;
|
import net.osmand.IndexConstants;
|
||||||
import net.osmand.Location;
|
import net.osmand.Location;
|
||||||
import net.osmand.access.AccessibleAlertBuilder;
|
import net.osmand.access.AccessibleAlertBuilder;
|
||||||
import net.osmand.access.AccessibleToast;
|
import net.osmand.access.AccessibleToast;
|
||||||
import net.osmand.data.FavouritePoint;
|
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
import net.osmand.data.QuadRect;
|
import net.osmand.data.QuadRect;
|
||||||
import net.osmand.data.RotatedTileBox;
|
import net.osmand.data.RotatedTileBox;
|
||||||
import net.osmand.map.ITileSource;
|
import net.osmand.map.ITileSource;
|
||||||
import net.osmand.plus.ApplicationMode;
|
import net.osmand.plus.ApplicationMode;
|
||||||
import net.osmand.plus.ContextMenuAdapter;
|
import net.osmand.plus.ContextMenuAdapter;
|
||||||
import net.osmand.plus.ContextMenuAdapter.Item;
|
|
||||||
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
|
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
|
||||||
import net.osmand.plus.ContextMenuAdapter.OnRowItemClick;
|
import net.osmand.plus.ContextMenuAdapter.OnRowItemClick;
|
||||||
import net.osmand.plus.FavouritesDbHelper;
|
|
||||||
import net.osmand.plus.FavouritesDbHelper.FavoriteGroup;
|
|
||||||
import net.osmand.plus.GPXUtilities;
|
import net.osmand.plus.GPXUtilities;
|
||||||
import net.osmand.plus.GPXUtilities.GPXFile;
|
import net.osmand.plus.GPXUtilities.GPXFile;
|
||||||
import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile;
|
import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile;
|
||||||
import net.osmand.plus.OsmAndFormatter;
|
|
||||||
import net.osmand.plus.OsmAndLocationProvider;
|
import net.osmand.plus.OsmAndLocationProvider;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.OsmandPlugin;
|
import net.osmand.plus.OsmandPlugin;
|
||||||
|
@ -44,7 +34,6 @@ import net.osmand.plus.activities.actions.OsmAndDialogs;
|
||||||
import net.osmand.plus.activities.actions.ShareLocation;
|
import net.osmand.plus.activities.actions.ShareLocation;
|
||||||
import net.osmand.plus.activities.actions.StartGPSStatus;
|
import net.osmand.plus.activities.actions.StartGPSStatus;
|
||||||
import net.osmand.plus.activities.search.SearchActivity;
|
import net.osmand.plus.activities.search.SearchActivity;
|
||||||
import net.osmand.plus.base.FavoriteImageDrawable;
|
|
||||||
import net.osmand.plus.development.OsmandDevelopmentPlugin;
|
import net.osmand.plus.development.OsmandDevelopmentPlugin;
|
||||||
import net.osmand.plus.dialogs.ConfigureMapMenu;
|
import net.osmand.plus.dialogs.ConfigureMapMenu;
|
||||||
import net.osmand.plus.dialogs.FavoriteDialogs;
|
import net.osmand.plus.dialogs.FavoriteDialogs;
|
||||||
|
@ -55,36 +44,26 @@ import net.osmand.plus.routing.RoutingHelper;
|
||||||
import net.osmand.plus.views.BaseMapLayer;
|
import net.osmand.plus.views.BaseMapLayer;
|
||||||
import net.osmand.plus.views.MapTileLayer;
|
import net.osmand.plus.views.MapTileLayer;
|
||||||
import net.osmand.plus.views.OsmandMapTileView;
|
import net.osmand.plus.views.OsmandMapTileView;
|
||||||
import net.osmand.util.MapUtils;
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.AlertDialog.Builder;
|
import android.app.AlertDialog.Builder;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Resources;
|
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.view.GravityCompat;
|
import android.support.v4.view.GravityCompat;
|
||||||
import android.support.v4.widget.DrawerLayout;
|
import android.support.v4.widget.DrawerLayout;
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.AutoCompleteTextView;
|
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
public class MapActivityActions implements DialogProvider {
|
public class MapActivityActions implements DialogProvider {
|
||||||
|
@ -363,7 +342,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
targets.navigateToPoint(new LatLon(latitude, longitude), true,
|
targets.navigateToPoint(new LatLon(latitude, longitude), true,
|
||||||
dest ? -1 : targets.getIntermediatePoints().size(), selected);
|
dest ? -1 : targets.getIntermediatePoints().size(), selected);
|
||||||
if(targets.getIntermediatePoints().size() > 0) {
|
if(targets.getIntermediatePoints().size() > 0) {
|
||||||
IntermediatePointsDialog.openIntermediatePointsDialog(mapActivity);
|
openIntermediatePointsDialog();
|
||||||
}
|
}
|
||||||
} else if (standardId == R.string.context_menu_item_share_location) {
|
} else if (standardId == R.string.context_menu_item_share_location) {
|
||||||
enhance(dialogBundle,latitude,longitude,mapActivity.getMapView().getZoom());
|
enhance(dialogBundle,latitude,longitude,mapActivity.getMapView().getZoom());
|
||||||
|
@ -737,7 +716,12 @@ public class MapActivityActions implements DialogProvider {
|
||||||
// ContextMenuAdapter cm = waypointDialogHelper.setListAdapter(app.getMapActivity(),
|
// ContextMenuAdapter cm = waypointDialogHelper.setListAdapter(app.getMapActivity(),
|
||||||
// mDrawerList, deletedPoints);
|
// mDrawerList, deletedPoints);
|
||||||
// prepareOptionsMenu(cm);
|
// prepareOptionsMenu(cm);
|
||||||
WaypointDialogHelper.showWaypointsDialog(mapActivity, false);
|
boolean drawer = true;
|
||||||
|
if (drawer) {
|
||||||
|
showWaypointsInDrawer(false);
|
||||||
|
} else {
|
||||||
|
waypointDialogHelper.showWaypointsDialog(mapActivity, false);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}).reg();
|
}).reg();
|
||||||
|
@ -878,8 +862,20 @@ public class MapActivityActions implements DialogProvider {
|
||||||
return optionsMenuHelper;
|
return optionsMenuHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void showWaypointsInDrawer(boolean b) {
|
||||||
|
final int[] running = new int[]{-1};
|
||||||
|
ArrayAdapter<Object> listAdapter = waypointDialogHelper.getWaypointsDrawerAdapter(b, mapActivity,
|
||||||
|
running);
|
||||||
|
mDrawerList.setAdapter(listAdapter);
|
||||||
|
mDrawerList.setDivider(mapActivity.getResources().getDrawable(R.drawable.drawer_divider));
|
||||||
|
mDrawerList.setBackgroundColor( getMyApplication().getSettings().isLightContentMenu()?
|
||||||
|
mapActivity.getResources().getColor(R.color.color_white) :
|
||||||
|
mapActivity.getResources().getColor(R.color.dark_drawer_bg_color));
|
||||||
|
mDrawerList.setOnItemClickListener(waypointDialogHelper.getDrawerItemClickListener(mapActivity, running, listAdapter, null));
|
||||||
|
}
|
||||||
|
|
||||||
public void openIntermediatePointsDialog(){
|
public void openIntermediatePointsDialog(){
|
||||||
IntermediatePointsDialog.openIntermediatePointsDialog(mapActivity);
|
waypointDialogHelper.showWaypointsDialog(mapActivity, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private TargetPointsHelper getTargets() {
|
private TargetPointsHelper getTargets() {
|
||||||
|
|
|
@ -55,6 +55,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||||
|
|
||||||
private static class RadiusItem {
|
private static class RadiusItem {
|
||||||
int type;
|
int type;
|
||||||
|
|
||||||
public RadiusItem(int type) {
|
public RadiusItem(int type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
@ -217,7 +218,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||||
}.execute(reachedView);
|
}.execute(reachedView);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showWaypointsDialogFlat(FragmentActivity fragmentActivity, boolean edit) {
|
public void showWaypointsDialogFlat(FragmentActivity fragmentActivity, boolean edit) {
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putBoolean(WaypointDialogFragment.FLAT_ARG, true);
|
args.putBoolean(WaypointDialogFragment.FLAT_ARG, true);
|
||||||
args.putBoolean(WaypointDialogFragment.EDIT_ARG, edit);
|
args.putBoolean(WaypointDialogFragment.EDIT_ARG, edit);
|
||||||
|
@ -226,7 +227,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||||
fragmentActivity.getSupportFragmentManager().beginTransaction().add(wdf, "tag").commit();
|
fragmentActivity.getSupportFragmentManager().beginTransaction().add(wdf, "tag").commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showWaypointsDialog(FragmentActivity fragmentActivity, boolean edit) {
|
public void showWaypointsDialog(FragmentActivity fragmentActivity, boolean edit) {
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
WaypointDialogFragment wdf = new WaypointDialogFragment();
|
WaypointDialogFragment wdf = new WaypointDialogFragment();
|
||||||
args.putBoolean(WaypointDialogFragment.EDIT_ARG, edit);
|
args.putBoolean(WaypointDialogFragment.EDIT_ARG, edit);
|
||||||
|
@ -234,7 +235,491 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||||
fragmentActivity.getSupportFragmentManager().beginTransaction().add(wdf, "tag").commit();
|
fragmentActivity.getSupportFragmentManager().beginTransaction().add(wdf, "tag").commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class WaypointDialogFragment extends DialogFragment {
|
|
||||||
|
public ArrayAdapter<Object> getWaypointsDrawerAdapter(final boolean edit,
|
||||||
|
final FragmentActivity ctx, final int[] running) {
|
||||||
|
final List<WaypointHelper.LocationPointWrapper> deletedPoints = new ArrayList<WaypointHelper.LocationPointWrapper>();
|
||||||
|
final List<Object> points = getPoints();
|
||||||
|
return new ArrayAdapter<Object>(ctx,
|
||||||
|
R.layout.waypoint_reached, R.id.title, points) {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||||
|
// User super class to create the View
|
||||||
|
View v = convertView;
|
||||||
|
final ArrayAdapter<Object> thisAdapter = this;
|
||||||
|
boolean labelView = (getItem(position) instanceof Integer);
|
||||||
|
if (position == 0) {
|
||||||
|
v = createDrawerHeader(ctx, edit);
|
||||||
|
} else if (getItem(position) instanceof RadiusItem) {
|
||||||
|
final int type = ((RadiusItem) getItem(position)).type;
|
||||||
|
v = createItemForRadiusProximity(ctx, type, running, position, thisAdapter);
|
||||||
|
} else if (labelView) {
|
||||||
|
v = createItemForCategory(ctx, (Integer) getItem(position), running, position, thisAdapter);
|
||||||
|
} else {
|
||||||
|
if (v == null || v.findViewById(R.id.info_close) == null) {
|
||||||
|
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_reached, null);
|
||||||
|
}
|
||||||
|
updatePointInfoView(app, ctx, v, (LocationPointWrapper) getItem(position), null);
|
||||||
|
View remove = v.findViewById(R.id.info_close);
|
||||||
|
if (!edit) {
|
||||||
|
remove.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
remove.setVisibility(View.VISIBLE);
|
||||||
|
((ImageButton) remove).setImageDrawable(ctx.getResources().getDrawable(
|
||||||
|
app.getSettings().isLightContent() ? R.drawable.ic_action_gremove_light
|
||||||
|
: R.drawable.ic_action_gremove_dark));
|
||||||
|
remove.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
LocationPointWrapper point = (LocationPointWrapper) points.get(position);
|
||||||
|
remove(point);
|
||||||
|
deletedPoints.add(point);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayAdapter<Object> getWaypointsAdapter(final boolean edit, final List<LocationPointWrapper> deletedPoints,
|
||||||
|
final FragmentActivity ctx, final int[] running,
|
||||||
|
final AlertDialog[] srcDialog, final DialogFragment dialogFragment) {
|
||||||
|
final List<Object> points = getPoints();
|
||||||
|
return new ArrayAdapter<Object>(ctx,
|
||||||
|
R.layout.waypoint_reached, R.id.title, points) {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||||
|
// User super class to create the View
|
||||||
|
View v = convertView;
|
||||||
|
final ArrayAdapter<Object> thisAdapter = this;
|
||||||
|
boolean labelView = (getItem(position) instanceof Integer);
|
||||||
|
if (position == 0) {
|
||||||
|
v = createDialogHeader(ctx, edit, false, srcDialog[0]);
|
||||||
|
} else if (getItem(position) instanceof RadiusItem) {
|
||||||
|
final int type = ((RadiusItem) getItem(position)).type;
|
||||||
|
v = createItemForRadiusProximity(ctx, type, running, position, thisAdapter);
|
||||||
|
} else if (labelView) {
|
||||||
|
v = createItemForCategory(ctx, (Integer) getItem(position), running, position, thisAdapter);
|
||||||
|
} else {
|
||||||
|
if (v == null || v.findViewById(R.id.info_close) == null) {
|
||||||
|
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_reached, null);
|
||||||
|
}
|
||||||
|
updatePointInfoView(app, ctx, v, (LocationPointWrapper) getItem(position), dialogFragment);
|
||||||
|
View remove = v.findViewById(R.id.info_close);
|
||||||
|
if (!edit) {
|
||||||
|
remove.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
remove.setVisibility(View.VISIBLE);
|
||||||
|
((ImageButton) remove).setImageDrawable(ctx.getResources().getDrawable(
|
||||||
|
app.getSettings().isLightContent() ? R.drawable.ic_action_gremove_light
|
||||||
|
: R.drawable.ic_action_gremove_dark));
|
||||||
|
remove.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
LocationPointWrapper point = (LocationPointWrapper) points.get(position);
|
||||||
|
remove(point);
|
||||||
|
deletedPoints.add(point);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected View createDrawerHeader(final FragmentActivity ctx, final boolean editF) {
|
||||||
|
View v;
|
||||||
|
v = ctx.getLayoutInflater().inflate(R.layout.drawer_list_waypoint_header, null);
|
||||||
|
|
||||||
|
ImageView icon = (ImageView) v.findViewById(R.id.icon);
|
||||||
|
if (mapActivity.getMyApplication().getSettings().isLightContent()){
|
||||||
|
icon.setImageResource(R.drawable.ic_back_drawer_white);
|
||||||
|
} else {
|
||||||
|
icon.setImageResource(R.drawable.ic_back_drawer_dark);
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageView edit = (ImageView) v.findViewById(R.id.edit);
|
||||||
|
ImageView sort = (ImageView) v.findViewById(R.id.sort);
|
||||||
|
ImageView all = (ImageView) v.findViewById(R.id.all);
|
||||||
|
edit.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_action_edit_light
|
||||||
|
: R.drawable.ic_action_edit_dark);
|
||||||
|
edit.setVisibility(editF ? View.GONE : View.VISIBLE);
|
||||||
|
edit.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
mapActivity.getMapActions().showWaypointsInDrawer(!editF);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (app.getTargetPointsHelper().getIntermediatePoints().size() > 0) {
|
||||||
|
sort.setVisibility(View.VISIBLE);
|
||||||
|
sort.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_sort_waypoint_white
|
||||||
|
: R.drawable.ic_sort_waypoint_dark);
|
||||||
|
sort.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
IntermediatePointsDialog.openIntermediatePointsDialog(app.getMapActivity(), app, true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
sort.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
if (waypointHelper.isRouteCalculated()) {
|
||||||
|
all.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
all.setVisibility(View.VISIBLE);
|
||||||
|
all.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_action_gup_light
|
||||||
|
: R.drawable.ic_action_gup_dark);
|
||||||
|
all.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
mapActivity.getMapActions().showWaypointsInDrawer(editF);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected View createDialogHeader(final FragmentActivity ctx, final boolean editF, final boolean flat, final AlertDialog dlg) {
|
||||||
|
View v;
|
||||||
|
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_title, null);
|
||||||
|
ImageButton edit = (ImageButton) v.findViewById(R.id.edit);
|
||||||
|
ImageButton sort = (ImageButton) v.findViewById(R.id.sort);
|
||||||
|
ImageButton all = (ImageButton) v.findViewById(R.id.all);
|
||||||
|
edit.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_action_edit_light
|
||||||
|
: R.drawable.ic_action_edit_dark);
|
||||||
|
edit.setVisibility(editF ? View.GONE : View.VISIBLE);
|
||||||
|
edit.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (flat) {
|
||||||
|
showWaypointsDialogFlat(ctx, true);
|
||||||
|
} else {
|
||||||
|
showWaypointsDialog(ctx, true);
|
||||||
|
}
|
||||||
|
if (dlg != null) {
|
||||||
|
dlg.dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (app.getTargetPointsHelper().getIntermediatePoints().size() > 0) {
|
||||||
|
sort.setVisibility(View.VISIBLE);
|
||||||
|
sort.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_sort_waypoint_white
|
||||||
|
: R.drawable.ic_sort_waypoint_dark);
|
||||||
|
sort.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
IntermediatePointsDialog.openIntermediatePointsDialog(app.getMapActivity(), app, true);
|
||||||
|
if (dlg != null) {
|
||||||
|
dlg.dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
sort.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
if (waypointHelper.isRouteCalculated()) {
|
||||||
|
all.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
all.setVisibility(View.VISIBLE);
|
||||||
|
if (flat) {
|
||||||
|
all.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_action_gdown_light
|
||||||
|
: R.drawable.ic_action_gdown_dark);
|
||||||
|
} else {
|
||||||
|
all.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_action_gup_light
|
||||||
|
: R.drawable.ic_action_gup_dark);
|
||||||
|
}
|
||||||
|
all.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (flat) {
|
||||||
|
showWaypointsDialog(ctx, editF);
|
||||||
|
} else {
|
||||||
|
showWaypointsDialogFlat(ctx, editF);
|
||||||
|
}
|
||||||
|
if (dlg != null) {
|
||||||
|
dlg.dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected View createItemForRadiusProximity(final FragmentActivity ctx, final int type, final int[] running,
|
||||||
|
final int position, final ArrayAdapter<Object> thisAdapter) {
|
||||||
|
View v;
|
||||||
|
v = ctx.getLayoutInflater().inflate(R.layout.drawer_list_radius, null);
|
||||||
|
final TextView radius = (TextView) v.findViewById(R.id.descr);
|
||||||
|
((ImageView) v.findViewById(R.id.waypoint_icon)).setImageResource(
|
||||||
|
app.getSettings().isLightContent() ? R.drawable.ic_poi_radius_white
|
||||||
|
: R.drawable.ic_poi_radius_dark);
|
||||||
|
radius.setText(OsmAndFormatter.getFormattedDistance(waypointHelper.getSearchDeviationRadius(type), app));
|
||||||
|
radius.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
selectDifferentRadius(type, running, position, thisAdapter, mapActivity);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected View createItemForCategory(final FragmentActivity ctx, final int type, final int[] running,
|
||||||
|
final int position, final ArrayAdapter<Object> thisAdapter) {
|
||||||
|
View v;
|
||||||
|
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_header, null);
|
||||||
|
ImageView sort = (ImageView) v.findViewById(R.id.sort);
|
||||||
|
//sort button in Destination header
|
||||||
|
if (type == 0 && sort != null && app.getTargetPointsHelper().getIntermediatePoints().size() > 0) {
|
||||||
|
sort.setVisibility(View.VISIBLE);
|
||||||
|
if (app.getSettings().isLightContent()) {
|
||||||
|
sort.setImageResource(R.drawable.ic_sort_waypoint_white);
|
||||||
|
} else {
|
||||||
|
sort.setImageResource(R.drawable.ic_sort_waypoint_dark);
|
||||||
|
}
|
||||||
|
sort.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
IntermediatePointsDialog.openIntermediatePointsDialog(ctx, app, true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
sort.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
final CompoundButton btn = (CompoundButton) v.findViewById(R.id.check_item);
|
||||||
|
btn.setVisibility(waypointHelper.isTypeConfigurable(type) ? View.VISIBLE : View.GONE);
|
||||||
|
btn.setOnCheckedChangeListener(null);
|
||||||
|
final boolean checked = waypointHelper.isTypeEnabled(type);
|
||||||
|
btn.setChecked(checked);
|
||||||
|
btn.setEnabled(running[0] == -1);
|
||||||
|
v.findViewById(R.id.ProgressBar).setVisibility(position == running[0] ? View.VISIBLE : View.GONE);
|
||||||
|
btn.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
running[0] = position;
|
||||||
|
thisAdapter.notifyDataSetInvalidated();
|
||||||
|
if (type == WaypointHelper.POI && isChecked) {
|
||||||
|
selectPoi(running, thisAdapter, type, isChecked, ctx);
|
||||||
|
} else {
|
||||||
|
enableType(running, thisAdapter, type, isChecked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
TextView tv = (TextView) v.findViewById(R.id.header_text);
|
||||||
|
tv.setText(getHeader(type, checked, ctx));
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void selectPoi(final int[] running, final ArrayAdapter<Object> listAdapter, final int type,
|
||||||
|
final boolean enable, Activity ctx) {
|
||||||
|
if (ctx instanceof MapActivity && !PoiFilter.CUSTOM_FILTER_ID.equals(app.getSettings().getPoiFilterForMap())) {
|
||||||
|
MapActivity map = (MapActivity) ctx;
|
||||||
|
final PoiFilter[] selected = new PoiFilter[1];
|
||||||
|
AlertDialog dlg = map.getMapLayers().selectPOIFilterLayer(map.getMapView(), selected);
|
||||||
|
dlg.setOnDismissListener(new OnDismissListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(DialogInterface dialog) {
|
||||||
|
if (selected != null) {
|
||||||
|
enableType(running, listAdapter, type, enable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
enableType(running, listAdapter, type, enable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void enableType(final int[] running, final ArrayAdapter<Object> listAdapter, final int type,
|
||||||
|
final boolean enable) {
|
||||||
|
new AsyncTask<Void, Void, Void>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Void doInBackground(Void... params) {
|
||||||
|
app.getWaypointHelper().enableWaypointType(type, enable);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void onPostExecute(Void result) {
|
||||||
|
running[0] = -1;
|
||||||
|
listAdapter.clear();
|
||||||
|
for (Object point : getPoints()) {
|
||||||
|
listAdapter.add(point);
|
||||||
|
}
|
||||||
|
listAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}.execute((Void) null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AdapterView.OnItemClickListener getDrawerItemClickListener(final FragmentActivity ctx,
|
||||||
|
final int[] running,
|
||||||
|
final ArrayAdapter<Object> listAdapter, final DialogFragment dialog) {
|
||||||
|
return new AdapterView.OnItemClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemClick(AdapterView<?> adapterView, View view, int item, long l) {
|
||||||
|
if (item == 0){
|
||||||
|
mapActivity.getMapActions().prepareStartOptionsMenu();
|
||||||
|
} else if (listAdapter.getItem(item) instanceof LocationPointWrapper) {
|
||||||
|
LocationPointWrapper ps = (LocationPointWrapper) listAdapter.getItem(item);
|
||||||
|
showOnMap(app, ctx, ps.getPoint(), dialog);
|
||||||
|
} else if (new Integer(WaypointHelper.TARGETS).equals(listAdapter.getItem(item))) {
|
||||||
|
IntermediatePointsDialog.openIntermediatePointsDialog(ctx, app, true);
|
||||||
|
} else if (listAdapter.getItem(item) instanceof RadiusItem) {
|
||||||
|
selectDifferentRadius(((RadiusItem) listAdapter.getItem(item)).type, running, item, listAdapter, ctx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void selectDifferentRadius(final int type, final int[] running, final int position,
|
||||||
|
final ArrayAdapter<Object> thisAdapter, Activity ctx) {
|
||||||
|
int length = WaypointHelper.SEARCH_RADIUS_VALUES.length;
|
||||||
|
String[] names = new String[length];
|
||||||
|
int selected = 0;
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
names[i] = OsmAndFormatter.getFormattedDistance(WaypointHelper.SEARCH_RADIUS_VALUES[i], app);
|
||||||
|
if (WaypointHelper.SEARCH_RADIUS_VALUES[i] == waypointHelper.getSearchDeviationRadius(type)) {
|
||||||
|
selected = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
new AlertDialog.Builder(ctx)
|
||||||
|
.setSingleChoiceItems(names, selected, new OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
|
int value = WaypointHelper.SEARCH_RADIUS_VALUES[i];
|
||||||
|
if (waypointHelper.getSearchDeviationRadius(type) != value) {
|
||||||
|
running[0] = position;
|
||||||
|
waypointHelper.setSearchDeviationRadius(type, value);
|
||||||
|
recalculatePoints(running, thisAdapter, WaypointHelper.POI);
|
||||||
|
dialogInterface.dismiss();
|
||||||
|
thisAdapter.notifyDataSetInvalidated();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).setTitle(app.getString(R.string.search_radius_proximity))
|
||||||
|
.setNegativeButton(R.string.default_buttons_cancel, null)
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void recalculatePoints(final int[] running, final ArrayAdapter<Object> listAdapter, final int type) {
|
||||||
|
new AsyncTask<Void, Void, Void>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Void doInBackground(Void... params) {
|
||||||
|
app.getWaypointHelper().recalculatePoints(type);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void onPostExecute(Void result) {
|
||||||
|
running[0] = -1;
|
||||||
|
listAdapter.clear();
|
||||||
|
for (Object point : getPoints()) {
|
||||||
|
listAdapter.add(point);
|
||||||
|
}
|
||||||
|
listAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}.execute((Void) null);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getHeader(int type, boolean checked, Activity ctx) {
|
||||||
|
String str = ctx.getString(R.string.waypoints);
|
||||||
|
switch (type) {
|
||||||
|
case WaypointHelper.TARGETS:
|
||||||
|
str = ctx.getString(R.string.targets);
|
||||||
|
break;
|
||||||
|
case WaypointHelper.ALARMS:
|
||||||
|
str = ctx.getString(R.string.way_alarms);
|
||||||
|
break;
|
||||||
|
case WaypointHelper.FAVORITES:
|
||||||
|
str = ctx.getString(R.string.my_favorites);
|
||||||
|
break;
|
||||||
|
case WaypointHelper.WAYPOINTS:
|
||||||
|
str = ctx.getString(R.string.waypoints);
|
||||||
|
break;
|
||||||
|
case WaypointHelper.POI:
|
||||||
|
str = waypointHelper.getPoiFilter() == null || !checked ? ctx.getString(R.string.poi) : waypointHelper
|
||||||
|
.getPoiFilter().getName();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected List<Object> getPoints() {
|
||||||
|
final List<Object> points = new ArrayList<Object>();
|
||||||
|
boolean rc = waypointHelper.isRouteCalculated();
|
||||||
|
points.add("");
|
||||||
|
for (int i = 0; i < WaypointHelper.MAX; i++) {
|
||||||
|
List<LocationPointWrapper> tp = waypointHelper.getWaypoints(i);
|
||||||
|
if (!rc && i != WaypointHelper.WAYPOINTS && i != WaypointHelper.TARGETS) {
|
||||||
|
// skip
|
||||||
|
} else if (waypointHelper.isTypeVisible(i)) {
|
||||||
|
if (i != WaypointHelper.TARGETS) {
|
||||||
|
points.add(new Integer(i));
|
||||||
|
}
|
||||||
|
if ((i == WaypointHelper.POI || i == WaypointHelper.FAVORITES || i == WaypointHelper.WAYPOINTS)
|
||||||
|
&& rc) {
|
||||||
|
if (waypointHelper.isTypeEnabled(i)) {
|
||||||
|
points.add(new RadiusItem(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (tp != null && tp.size() > 0) {
|
||||||
|
points.addAll(tp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return points;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void showOnMap(OsmandApplication app, Activity a, LocationPoint locationPoint, DialogFragment dialog) {
|
||||||
|
if (!(a instanceof MapActivity)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MapActivity ctx = (MapActivity) a;
|
||||||
|
AnimateDraggingMapThread thread = ctx.getMapView().getAnimatedDraggingThread();
|
||||||
|
int fZoom = ctx.getMapView().getZoom() < 15 ? 15 : ctx.getMapView().getZoom();
|
||||||
|
boolean di = dialog != null;
|
||||||
|
if (thread.isAnimating()) {
|
||||||
|
ctx.getMapView().setIntZoom(fZoom);
|
||||||
|
ctx.getMapView().setLatLon(locationPoint.getLatitude(), locationPoint.getLongitude());
|
||||||
|
app.getAppCustomization().showLocationPoint(ctx, locationPoint);
|
||||||
|
} else {
|
||||||
|
final double dist = MapUtils.getDistance(ctx.getMapView().getLatitude(), ctx.getMapView().getLongitude(),
|
||||||
|
locationPoint.getLatitude(), locationPoint.getLongitude());
|
||||||
|
double t = 10;
|
||||||
|
if (dist < t) {
|
||||||
|
app.getAppCustomization().showLocationPoint(ctx, locationPoint);
|
||||||
|
} else {
|
||||||
|
thread.startMoving(locationPoint.getLatitude(), locationPoint.getLongitude(), fZoom, true);
|
||||||
|
}
|
||||||
|
if (di) {
|
||||||
|
ctx.getMapLayers().getContextMenuLayer().setSelectedObject(locationPoint);
|
||||||
|
ctx.getMapLayers()
|
||||||
|
.getContextMenuLayer()
|
||||||
|
.setLocation(new LatLon(locationPoint.getLatitude(), locationPoint.getLongitude()),
|
||||||
|
locationPoint.getName(ctx));
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WaypointDialogFragment extends DialogFragment {
|
||||||
|
|
||||||
WaypointHelper waypointHelper;
|
WaypointHelper waypointHelper;
|
||||||
private OsmandApplication app;
|
private OsmandApplication app;
|
||||||
|
@ -257,91 +742,6 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||||
return createWaypointsDialog(getArguments().getBoolean(EDIT_ARG));
|
return createWaypointsDialog(getArguments().getBoolean(EDIT_ARG));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void selectPoi(final int[] running, final ArrayAdapter<Object> listAdapter, final int type,
|
|
||||||
final boolean enable) {
|
|
||||||
if (getActivity() instanceof MapActivity && !PoiFilter.CUSTOM_FILTER_ID.equals(app.getSettings().getPoiFilterForMap())) {
|
|
||||||
MapActivity map = (MapActivity) getActivity();
|
|
||||||
final PoiFilter[] selected = new PoiFilter[1];
|
|
||||||
AlertDialog dlg = map.getMapLayers().selectPOIFilterLayer(map.getMapView(), selected);
|
|
||||||
dlg.setOnDismissListener(new OnDismissListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDismiss(DialogInterface dialog) {
|
|
||||||
if (selected != null) {
|
|
||||||
enableType(running, listAdapter, type, enable);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
enableType(running, listAdapter, type, enable);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void recalculatePoints(final int[] running, final ArrayAdapter<Object> listAdapter, final int type){
|
|
||||||
new AsyncTask<Void, Void, Void>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Void doInBackground(Void... params) {
|
|
||||||
app.getWaypointHelper().recalculatePoints(type);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void onPostExecute(Void result) {
|
|
||||||
running[0] = -1;
|
|
||||||
listAdapter.clear();
|
|
||||||
for (Object point : getPoints()) {
|
|
||||||
listAdapter.add(point);
|
|
||||||
}
|
|
||||||
listAdapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
}.execute((Void) null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void enableType(final int[] running, final ArrayAdapter<Object> listAdapter, final int type,
|
|
||||||
final boolean enable) {
|
|
||||||
new AsyncTask<Void, Void, Void>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Void doInBackground(Void... params) {
|
|
||||||
app.getWaypointHelper().enableWaypointType(type, enable);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void onPostExecute(Void result) {
|
|
||||||
running[0] = -1;
|
|
||||||
listAdapter.clear();
|
|
||||||
for (Object point : getPoints()) {
|
|
||||||
listAdapter.add(point);
|
|
||||||
}
|
|
||||||
listAdapter.notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
}.execute((Void) null);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected String getHeader(int type, boolean checked) {
|
|
||||||
FragmentActivity ctx = getActivity();
|
|
||||||
String str = ctx.getString(R.string.waypoints);
|
|
||||||
switch (type) {
|
|
||||||
case WaypointHelper.TARGETS:
|
|
||||||
str = ctx.getString(R.string.targets);
|
|
||||||
break;
|
|
||||||
case WaypointHelper.ALARMS:
|
|
||||||
str = ctx.getString(R.string.way_alarms);
|
|
||||||
break;
|
|
||||||
case WaypointHelper.FAVORITES:
|
|
||||||
str = ctx.getString(R.string.my_favorites);
|
|
||||||
break;
|
|
||||||
case WaypointHelper.WAYPOINTS:
|
|
||||||
str = ctx.getString(R.string.waypoints);
|
|
||||||
break;
|
|
||||||
case WaypointHelper.POI:
|
|
||||||
str = waypointHelper.getPoiFilter() == null || !checked ? ctx.getString(R.string.poi) : waypointHelper
|
|
||||||
.getPoiFilter().getName();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AlertDialog createWaypointsDialogFlat(final List<LocationPointWrapper> points, final boolean edit) {
|
public AlertDialog createWaypointsDialogFlat(final List<LocationPointWrapper> points, final boolean edit) {
|
||||||
final List<LocationPointWrapper> deletedPoints = new ArrayList<WaypointHelper.LocationPointWrapper>();
|
final List<LocationPointWrapper> deletedPoints = new ArrayList<WaypointHelper.LocationPointWrapper>();
|
||||||
final FragmentActivity ctx = getActivity();
|
final FragmentActivity ctx = getActivity();
|
||||||
|
@ -353,7 +753,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||||
// User super class to create the View
|
// User super class to create the View
|
||||||
View v = convertView;
|
View v = convertView;
|
||||||
if(position == 0) {
|
if (position == 0) {
|
||||||
return createDialogHeader(ctx, edit, true, srcDialog[0]);
|
return createDialogHeader(ctx, edit, true, srcDialog[0]);
|
||||||
}
|
}
|
||||||
if (v == null || v.findViewById(R.id.waypoint_icon) == null) {
|
if (v == null || v.findViewById(R.id.waypoint_icon) == null) {
|
||||||
|
@ -361,7 +761,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||||
}
|
}
|
||||||
updatePointInfoView(app, ctx, v, getItem(position), WaypointDialogFragment.this);
|
updatePointInfoView(app, ctx, v, getItem(position), WaypointDialogFragment.this);
|
||||||
View remove = v.findViewById(R.id.info_close);
|
View remove = v.findViewById(R.id.info_close);
|
||||||
if(!edit) {
|
if (!edit) {
|
||||||
remove.setVisibility(View.GONE);
|
remove.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
remove.setVisibility(View.VISIBLE);
|
remove.setVisibility(View.VISIBLE);
|
||||||
|
@ -401,7 +801,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||||
waypointHelper.removeVisibleLocationPoint(deletedPoints);
|
waypointHelper.removeVisibleLocationPoint(deletedPoints);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(edit) {
|
if (edit) {
|
||||||
builder.setNegativeButton(ctx.getString(R.string.default_buttons_cancel), null);
|
builder.setNegativeButton(ctx.getString(R.string.default_buttons_cancel), null);
|
||||||
}
|
}
|
||||||
AlertDialog dlg = builder.create();
|
AlertDialog dlg = builder.create();
|
||||||
|
@ -410,72 +810,28 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public AlertDialog createWaypointsDialog(final boolean edit) {
|
public AlertDialog createWaypointsDialog(final boolean edit) {
|
||||||
final List<Object> points = getPoints();
|
|
||||||
final List<LocationPointWrapper> deletedPoints = new ArrayList<WaypointHelper.LocationPointWrapper>();
|
final List<LocationPointWrapper> deletedPoints = new ArrayList<WaypointHelper.LocationPointWrapper>();
|
||||||
final FragmentActivity ctx = getActivity();
|
final FragmentActivity ctx = getActivity();
|
||||||
final ListView listView = new ListView(ctx);
|
final ListView listView = new ListView(ctx);
|
||||||
final int[] running = new int[]{-1};
|
final int[] running = new int[]{-1};
|
||||||
final AlertDialog[] srcDialog = new AlertDialog[1];
|
final AlertDialog[] srcDialog = new AlertDialog[1];
|
||||||
final ArrayAdapter<Object> listAdapter = new ArrayAdapter<Object>(ctx,
|
final ArrayAdapter<Object> listAdapter = getWaypointsAdapter(edit, deletedPoints, ctx,
|
||||||
R.layout.waypoint_reached, R.id.title, points) {
|
running, srcDialog, WaypointDialogFragment.this);
|
||||||
|
|
||||||
@Override
|
|
||||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
|
||||||
// User super class to create the View
|
|
||||||
View v = convertView;
|
|
||||||
final ArrayAdapter<Object> thisAdapter = this;
|
|
||||||
boolean labelView = (getItem(position) instanceof Integer);
|
|
||||||
if(position == 0) {
|
|
||||||
v = createDialogHeader(ctx, edit, false, srcDialog[0]);
|
|
||||||
} else if (getItem(position) instanceof RadiusItem){
|
|
||||||
final int type = ((RadiusItem) getItem(position)).type;
|
|
||||||
v = createItemForRadiusProximity(ctx, type, running, position, thisAdapter);
|
|
||||||
} else if (labelView) {
|
|
||||||
v = createItemForCategory(ctx, (Integer) getItem(position), running, position, thisAdapter);
|
|
||||||
} else {
|
|
||||||
if(v == null || v.findViewById(R.id.info_close) == null) {
|
|
||||||
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_reached, null);
|
|
||||||
}
|
|
||||||
updatePointInfoView(app, ctx, v, (LocationPointWrapper) getItem(position), WaypointDialogFragment.this);
|
|
||||||
View remove = v.findViewById(R.id.info_close);
|
|
||||||
if (!edit) {
|
|
||||||
remove.setVisibility(View.GONE);
|
|
||||||
} else {
|
|
||||||
remove.setVisibility(View.VISIBLE);
|
|
||||||
((ImageButton) remove).setImageDrawable(ctx.getResources().getDrawable(
|
|
||||||
app.getSettings().isLightContent() ? R.drawable.ic_action_gremove_light
|
|
||||||
: R.drawable.ic_action_gremove_dark));
|
|
||||||
remove.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
LocationPointWrapper point = (LocationPointWrapper) points.get(position);
|
|
||||||
remove(point);
|
|
||||||
deletedPoints.add(point);
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
listView.setAdapter(listAdapter);
|
listView.setAdapter(listAdapter);
|
||||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
listView.setOnItemClickListener( new AdapterView.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> adapterView, View view, int item, long l) {
|
public void onItemClick(AdapterView<?> adapterView, View view, int item, long l) {
|
||||||
if (listAdapter.getItem(item) instanceof LocationPointWrapper) {
|
if (listAdapter.getItem(item) instanceof LocationPointWrapper) {
|
||||||
LocationPointWrapper ps = (LocationPointWrapper) listAdapter.getItem(item);
|
LocationPointWrapper ps = (LocationPointWrapper) listAdapter.getItem(item);
|
||||||
showOnMap(app, ctx, ps.getPoint(), WaypointDialogFragment.this);
|
showOnMap(app, ctx, ps.getPoint(), WaypointDialogFragment.this);
|
||||||
} else if(new Integer(WaypointHelper.TARGETS).equals(listAdapter.getItem(item))) {
|
} else if (new Integer(WaypointHelper.TARGETS).equals(listAdapter.getItem(item))) {
|
||||||
IntermediatePointsDialog.openIntermediatePointsDialog(getActivity(), app, true);
|
IntermediatePointsDialog.openIntermediatePointsDialog(ctx, app, true);
|
||||||
if(srcDialog[0] != null) {
|
if (srcDialog[0] != null) {
|
||||||
srcDialog[0].dismiss();
|
srcDialog[0].dismiss();
|
||||||
}
|
}
|
||||||
} else if(listAdapter.getItem(item) instanceof RadiusItem) {
|
} else if (listAdapter.getItem(item) instanceof RadiusItem) {
|
||||||
selectDifferentRadius(((RadiusItem) listAdapter.getItem(item)).type, running, item, listAdapter);
|
selectDifferentRadius(((RadiusItem) listAdapter.getItem(item)).type, running, item, listAdapter, ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -488,7 +844,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||||
waypointHelper.removeVisibleLocationPoint(deletedPoints);
|
waypointHelper.removeVisibleLocationPoint(deletedPoints);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(edit) {
|
if (edit) {
|
||||||
builder.setNegativeButton(ctx.getString(R.string.default_buttons_cancel), null);
|
builder.setNegativeButton(ctx.getString(R.string.default_buttons_cancel), null);
|
||||||
}
|
}
|
||||||
AlertDialog dlg = builder.create();
|
AlertDialog dlg = builder.create();
|
||||||
|
@ -496,227 +852,6 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
|
||||||
return dlg;
|
return dlg;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List<Object> getPoints() {
|
|
||||||
final List<Object> points = new ArrayList<Object>();
|
|
||||||
boolean rc = waypointHelper.isRouteCalculated();
|
|
||||||
points.add("");
|
|
||||||
for (int i = 0; i < WaypointHelper.MAX; i++) {
|
|
||||||
List<LocationPointWrapper> tp = waypointHelper.getWaypoints(i);
|
|
||||||
if(!rc && i != WaypointHelper.WAYPOINTS && i != WaypointHelper.TARGETS) {
|
|
||||||
// skip
|
|
||||||
} else if (waypointHelper.isTypeVisible(i)) {
|
|
||||||
if(i != WaypointHelper.TARGETS) {
|
|
||||||
points.add(new Integer(i));
|
|
||||||
}
|
|
||||||
if ((i == WaypointHelper.POI || i == WaypointHelper.FAVORITES || i == WaypointHelper.WAYPOINTS)
|
|
||||||
&& rc) {
|
|
||||||
if (waypointHelper.isTypeEnabled(i)) {
|
|
||||||
points.add(new RadiusItem(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (tp != null && tp.size() > 0) {
|
|
||||||
points.addAll(tp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return points;
|
|
||||||
}
|
|
||||||
protected View createDialogHeader(final FragmentActivity ctx, final boolean editF, final boolean flat, final AlertDialog dlg) {
|
|
||||||
View v;
|
|
||||||
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_title, null);
|
|
||||||
ImageButton edit = (ImageButton) v.findViewById(R.id.edit);
|
|
||||||
ImageButton sort = (ImageButton) v.findViewById(R.id.sort);
|
|
||||||
ImageButton all = (ImageButton) v.findViewById(R.id.all);
|
|
||||||
edit.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_action_edit_light
|
|
||||||
: R.drawable.ic_action_edit_dark);
|
|
||||||
edit.setVisibility(editF ? View.GONE : View.VISIBLE);
|
|
||||||
edit.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if(flat) {
|
|
||||||
showWaypointsDialogFlat(ctx, true);
|
|
||||||
} else {
|
|
||||||
showWaypointsDialog(ctx, true);
|
|
||||||
}
|
|
||||||
if(dlg != null) {
|
|
||||||
dlg.dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if(app.getTargetPointsHelper().getIntermediatePoints().size() > 0) {
|
|
||||||
sort.setVisibility(View.VISIBLE);
|
|
||||||
sort.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_sort_waypoint_white
|
|
||||||
: R.drawable.ic_sort_waypoint_dark);
|
|
||||||
sort.setOnClickListener(new View.OnClickListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
IntermediatePointsDialog.openIntermediatePointsDialog(getActivity(), app, true);
|
|
||||||
if(dlg != null) {
|
|
||||||
dlg.dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
sort.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
if(waypointHelper.isRouteCalculated()) {
|
|
||||||
all.setVisibility(View.GONE);
|
|
||||||
} else {
|
|
||||||
all.setVisibility(View.VISIBLE);
|
|
||||||
if(flat) {
|
|
||||||
all.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_action_gdown_light
|
|
||||||
: R.drawable.ic_action_gdown_dark);
|
|
||||||
} else {
|
|
||||||
all.setImageResource(app.getSettings().isLightContent() ? R.drawable.ic_action_gup_light
|
|
||||||
: R.drawable.ic_action_gup_dark);
|
|
||||||
}
|
|
||||||
all.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if(flat) {
|
|
||||||
showWaypointsDialog(ctx, editF);
|
|
||||||
} else {
|
|
||||||
showWaypointsDialogFlat(ctx, editF);
|
|
||||||
}
|
|
||||||
if(dlg != null) {
|
|
||||||
dlg.dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void selectDifferentRadius(final int type, final int[] running, final int position,
|
|
||||||
final ArrayAdapter<Object> thisAdapter) {
|
|
||||||
int length = WaypointHelper.SEARCH_RADIUS_VALUES.length;
|
|
||||||
String[] names = new String[length];
|
|
||||||
int selected = 0;
|
|
||||||
for (int i = 0; i < length; i++) {
|
|
||||||
names[i] = OsmAndFormatter.getFormattedDistance(WaypointHelper.SEARCH_RADIUS_VALUES[i], app);
|
|
||||||
if (WaypointHelper.SEARCH_RADIUS_VALUES[i] == waypointHelper.getSearchDeviationRadius(type)){
|
|
||||||
selected = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
new AlertDialog.Builder(getActivity())
|
|
||||||
.setSingleChoiceItems(names, selected, new OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialogInterface, int i) {
|
|
||||||
int value = WaypointHelper.SEARCH_RADIUS_VALUES[i];
|
|
||||||
if (waypointHelper.getSearchDeviationRadius(type) != value){
|
|
||||||
running[0] = position;
|
|
||||||
waypointHelper.setSearchDeviationRadius(type, value);
|
|
||||||
recalculatePoints(running, thisAdapter, WaypointHelper.POI);
|
|
||||||
dialogInterface.dismiss();
|
|
||||||
thisAdapter.notifyDataSetInvalidated();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).setTitle(app.getString(R.string.search_radius_proximity))
|
|
||||||
.setNegativeButton(R.string.default_buttons_cancel, null)
|
|
||||||
.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected View createItemForRadiusProximity(final FragmentActivity ctx, final int type, final int[] running,
|
|
||||||
final int position, final ArrayAdapter<Object> thisAdapter) {
|
|
||||||
View v;
|
|
||||||
v = ctx.getLayoutInflater().inflate(R.layout.drawer_list_radius, null);
|
|
||||||
final TextView radius = (TextView) v.findViewById(R.id.descr);
|
|
||||||
((ImageView)v.findViewById(R.id.waypoint_icon)).setImageResource(
|
|
||||||
app.getSettings().isLightContent() ? R.drawable.ic_poi_radius_white
|
|
||||||
: R.drawable.ic_poi_radius_dark);
|
|
||||||
radius.setText(OsmAndFormatter.getFormattedDistance(waypointHelper.getSearchDeviationRadius(type), app));
|
|
||||||
radius.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
selectDifferentRadius(type, running, position, thisAdapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected View createItemForCategory(final FragmentActivity ctx, final int type, final int[] running,
|
|
||||||
final int position, final ArrayAdapter<Object> thisAdapter) {
|
|
||||||
View v;
|
|
||||||
v = ctx.getLayoutInflater().inflate(R.layout.waypoint_header, null);
|
|
||||||
ImageView sort = (ImageView) v.findViewById(R.id.sort);
|
|
||||||
//sort button in Destination header
|
|
||||||
if (type == 0 && sort != null && app.getTargetPointsHelper().getIntermediatePoints().size() > 0){
|
|
||||||
sort.setVisibility(View.VISIBLE);
|
|
||||||
if (app.getSettings().isLightContent()){
|
|
||||||
sort.setImageResource(R.drawable.ic_sort_waypoint_white);
|
|
||||||
} else {
|
|
||||||
sort.setImageResource(R.drawable.ic_sort_waypoint_dark);
|
|
||||||
}
|
|
||||||
sort.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
IntermediatePointsDialog.openIntermediatePointsDialog(ctx, app, true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
sort.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
final CompoundButton btn = (CompoundButton) v.findViewById(R.id.check_item);
|
|
||||||
btn.setVisibility(waypointHelper.isTypeConfigurable(type) ? View.VISIBLE : View.GONE);
|
|
||||||
btn.setOnCheckedChangeListener(null);
|
|
||||||
final boolean checked = waypointHelper.isTypeEnabled(type);
|
|
||||||
btn.setChecked(checked);
|
|
||||||
btn.setEnabled(running[0] == -1);
|
|
||||||
v.findViewById(R.id.ProgressBar).setVisibility(position == running[0] ? View.VISIBLE : View.GONE);
|
|
||||||
btn.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
||||||
running[0] = position;
|
|
||||||
thisAdapter.notifyDataSetInvalidated();
|
|
||||||
if (type == WaypointHelper.POI && isChecked) {
|
|
||||||
selectPoi(running, thisAdapter, type, isChecked);
|
|
||||||
} else {
|
|
||||||
enableType(running, thisAdapter, type, isChecked);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
TextView tv = (TextView) v.findViewById(R.id.header_text);
|
|
||||||
tv.setText(getHeader(type, checked));
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void showOnMap(OsmandApplication app, Activity a, LocationPoint locationPoint, DialogFragment dialog) {
|
|
||||||
if (!(a instanceof MapActivity)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MapActivity ctx = (MapActivity) a;
|
|
||||||
AnimateDraggingMapThread thread = ctx.getMapView().getAnimatedDraggingThread();
|
|
||||||
int fZoom = ctx.getMapView().getZoom() < 15 ? 15 : ctx.getMapView().getZoom();
|
|
||||||
boolean di = dialog != null;
|
|
||||||
if (thread.isAnimating()) {
|
|
||||||
ctx.getMapView().setIntZoom(fZoom);
|
|
||||||
ctx.getMapView().setLatLon(locationPoint.getLatitude(), locationPoint.getLongitude());
|
|
||||||
app.getAppCustomization().showLocationPoint(ctx, locationPoint);
|
|
||||||
} else {
|
|
||||||
final double dist = MapUtils.getDistance(ctx.getMapView().getLatitude(), ctx.getMapView().getLongitude(),
|
|
||||||
locationPoint.getLatitude(), locationPoint.getLongitude());
|
|
||||||
double t = 10;
|
|
||||||
if (dist < t) {
|
|
||||||
app.getAppCustomization().showLocationPoint(ctx, locationPoint);
|
|
||||||
} else {
|
|
||||||
thread.startMoving(locationPoint.getLatitude(), locationPoint.getLongitude(), fZoom, true);
|
|
||||||
}
|
|
||||||
if (di) {
|
|
||||||
ctx.getMapLayers().getContextMenuLayer().setSelectedObject(locationPoint);
|
|
||||||
ctx.getMapLayers()
|
|
||||||
.getContextMenuLayer()
|
|
||||||
.setLocation(new LatLon(locationPoint.getLatitude(), locationPoint.getLongitude()),
|
|
||||||
locationPoint.getName(ctx));
|
|
||||||
dialog.dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -149,7 +149,7 @@ public class MapRouteInfoControl extends MapControls implements IRouteInformatio
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if(getTargets().checkPointToNavigateShort()) {
|
if(getTargets().checkPointToNavigateShort()) {
|
||||||
hideDialog();
|
hideDialog();
|
||||||
IntermediatePointsDialog.openIntermediatePointsDialog(mapActivity);
|
mapActivity.getMapActions().openIntermediatePointsDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue