Merge branch 'master' of https://github.com/osmandapp/Osmand
|
@ -91,6 +91,7 @@ public class Amenity extends MapObject {
|
||||||
while ((s = br.readLine()) != null) {
|
while ((s = br.readLine()) != null) {
|
||||||
bld.append(s);
|
bld.append(s);
|
||||||
}
|
}
|
||||||
|
br.close();
|
||||||
str = bld.toString();
|
str = bld.toString();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 4 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 7 KiB After Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2 KiB |
|
@ -6,8 +6,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.londatiga.android.ActionItem;
|
|
||||||
import net.londatiga.android.QuickAction;
|
|
||||||
import net.osmand.IndexConstants;
|
import net.osmand.IndexConstants;
|
||||||
import net.osmand.Location;
|
import net.osmand.Location;
|
||||||
import net.osmand.PlatformUtil;
|
import net.osmand.PlatformUtil;
|
||||||
|
@ -48,12 +46,10 @@ import android.app.Activity;
|
||||||
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.graphics.drawable.Drawable;
|
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
@ -841,51 +837,6 @@ public class MapActivityActions implements DialogProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void showObjectContextMenu(final ContextMenuAdapter qa, final Activity activity,
|
|
||||||
final OnClickListener onShow) {
|
|
||||||
OsmandApplication app = (OsmandApplication) activity.getApplication();
|
|
||||||
if (app.accessibilityEnabled()) {
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
|
||||||
String[] values = qa.getItemNames();
|
|
||||||
builder.setItems(values, new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
|
||||||
OnContextMenuClick clk = qa.getClickAdapter(which);
|
|
||||||
if (clk != null) {
|
|
||||||
clk.onContextMenuClick(null, qa.getElementId(which), which, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
builder.show();
|
|
||||||
} else {
|
|
||||||
final QuickAction view = new QuickAction(qa.getAnchor());
|
|
||||||
for (int i = 0; i < qa.length(); i++) {
|
|
||||||
|
|
||||||
ActionItem ai = new ActionItem();
|
|
||||||
Drawable id = qa.getImage(app, i, true);
|
|
||||||
if (id != null) {
|
|
||||||
ai.setIcon(id);
|
|
||||||
}
|
|
||||||
final int ki = i;
|
|
||||||
ai.setTitle(qa.getItemName(i));
|
|
||||||
ai.setOnClickListener(new OnClickListener() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (onShow != null) {
|
|
||||||
onShow.onClick(v);
|
|
||||||
}
|
|
||||||
view.dismiss();
|
|
||||||
qa.getClickAdapter(ki).onContextMenuClick(null, qa.getElementId(ki), ki, false);
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
view.addActionItem(ai);
|
|
||||||
}
|
|
||||||
view.show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void updateDrawerMenu() {
|
protected void updateDrawerMenu() {
|
||||||
final ListView menuItemsListView = (ListView) mapActivity.findViewById(R.id.menuItems);
|
final ListView menuItemsListView = (ListView) mapActivity.findViewById(R.id.menuItems);
|
||||||
|
|
|
@ -27,7 +27,6 @@ import net.osmand.plus.GPXUtilities;
|
||||||
import net.osmand.plus.GPXUtilities.GPXFile;
|
import net.osmand.plus.GPXUtilities.GPXFile;
|
||||||
import net.osmand.plus.GPXUtilities.GPXTrackAnalysis;
|
import net.osmand.plus.GPXUtilities.GPXTrackAnalysis;
|
||||||
import net.osmand.plus.GPXUtilities.TrkSegment;
|
import net.osmand.plus.GPXUtilities.TrkSegment;
|
||||||
import net.osmand.plus.GpxSelectionHelper;
|
|
||||||
import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile;
|
import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile;
|
||||||
import net.osmand.plus.OsmAndFormatter;
|
import net.osmand.plus.OsmAndFormatter;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
@ -174,11 +173,16 @@ public class GpxUiHelper {
|
||||||
public static AlertDialog selectSingleGPXFile(final Activity activity,
|
public static AlertDialog selectSingleGPXFile(final Activity activity,
|
||||||
final boolean showCurrentGpx, final CallbackWithObject<GPXFile[]> callbackWithObject) {
|
final boolean showCurrentGpx, final CallbackWithObject<GPXFile[]> callbackWithObject) {
|
||||||
OsmandApplication app = (OsmandApplication) activity.getApplication();
|
OsmandApplication app = (OsmandApplication) activity.getApplication();
|
||||||
final File dir = app.getAppPath(IndexConstants.GPX_INDEX_DIR);
|
int gpxDirLength = app.getAppPath(IndexConstants.GPX_INDEX_DIR).getAbsolutePath().length();
|
||||||
final List<String> list = getSortedGPXFilenames(dir, false);
|
List<SelectedGpxFile> selectedGpxFiles = app.getSelectedGpxHelper().getSelectedGPXFiles();
|
||||||
if (!list.isEmpty() || showCurrentGpx) {
|
final List<String> list = new ArrayList<>(selectedGpxFiles.size() + 1);
|
||||||
|
if (!selectedGpxFiles.isEmpty() || showCurrentGpx) {
|
||||||
if (showCurrentGpx) {
|
if (showCurrentGpx) {
|
||||||
list.add(0, activity.getString(R.string.shared_string_currently_recording_track));
|
list.add(activity.getString(R.string.shared_string_currently_recording_track));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (SelectedGpxFile selectedGpx : selectedGpxFiles) {
|
||||||
|
list.add(selectedGpx.getGpxFile().path.substring(gpxDirLength + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
final ContextMenuAdapter adapter = createGpxContextMenuAdapter(activity, list, null, false,
|
final ContextMenuAdapter adapter = createGpxContextMenuAdapter(activity, list, null, false,
|
||||||
|
|
|
@ -6,13 +6,13 @@ import android.view.View;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
import net.osmand.CallbackWithObject;
|
import net.osmand.CallbackWithObject;
|
||||||
import net.osmand.IndexConstants;
|
|
||||||
import net.osmand.data.FavouritePoint;
|
import net.osmand.data.FavouritePoint;
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
import net.osmand.data.PointDescription;
|
import net.osmand.data.PointDescription;
|
||||||
import net.osmand.plus.ContextMenuAdapter;
|
import net.osmand.plus.ContextMenuAdapter;
|
||||||
import net.osmand.plus.GPXUtilities.GPXFile;
|
import net.osmand.plus.GPXUtilities.GPXFile;
|
||||||
import net.osmand.plus.GPXUtilities.WptPt;
|
import net.osmand.plus.GPXUtilities.WptPt;
|
||||||
|
import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.activities.MapActivity;
|
import net.osmand.plus.activities.MapActivity;
|
||||||
import net.osmand.plus.helpers.GpxUiHelper;
|
import net.osmand.plus.helpers.GpxUiHelper;
|
||||||
|
@ -29,7 +29,6 @@ import net.osmand.plus.views.ContextMenuLayer;
|
||||||
import net.osmand.plus.views.OsmandMapLayer;
|
import net.osmand.plus.views.OsmandMapLayer;
|
||||||
import net.osmand.util.MapUtils;
|
import net.osmand.util.MapUtils;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -53,7 +52,6 @@ public class MapContextMenu extends MenuTitleController {
|
||||||
private LatLon myLocation;
|
private LatLon myLocation;
|
||||||
private Float heading;
|
private Float heading;
|
||||||
private boolean inLocationUpdate = false;
|
private boolean inLocationUpdate = false;
|
||||||
private long locationUpdateTime;
|
|
||||||
|
|
||||||
private int favActionIconId;
|
private int favActionIconId;
|
||||||
|
|
||||||
|
@ -401,20 +399,18 @@ public class MapContextMenu extends MenuTitleController {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addWptPt() {
|
public void addWptPt() {
|
||||||
if (object == null) {
|
String title = getTitleStr();
|
||||||
String title = getTitleStr();
|
if (pointDescription.isWpt() || title.equals(addressNotKnownStr)) {
|
||||||
if (pointDescription.isWpt() || title.equals(addressNotKnownStr)) {
|
title = "";
|
||||||
title = "";
|
}
|
||||||
}
|
|
||||||
|
|
||||||
final File dir = mapActivity.getMyApplication().getAppPath(IndexConstants.GPX_INDEX_DIR);
|
final List<SelectedGpxFile> list
|
||||||
final List<String> list = GpxUiHelper.getSortedGPXFilenames(dir, false);
|
= mapActivity.getMyApplication().getSelectedGpxHelper().getSelectedGPXFiles();
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
GPXFile gpxFile = mapActivity.getMyApplication().getSavingTrackHelper().getCurrentGpx();
|
GPXFile gpxFile = mapActivity.getMyApplication().getSavingTrackHelper().getCurrentGpx();
|
||||||
getWptPtPointEditor().add(gpxFile, latLon, title);
|
getWptPtPointEditor().add(gpxFile, latLon, title);
|
||||||
} else {
|
} else {
|
||||||
addNewWptToGPXFile(title);
|
addNewWptToGPXFile(title);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import net.osmand.Location;
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
import net.osmand.data.QuadPoint;
|
import net.osmand.data.QuadPoint;
|
||||||
import net.osmand.data.RotatedTileBox;
|
import net.osmand.data.RotatedTileBox;
|
||||||
|
@ -36,7 +36,6 @@ import net.osmand.plus.IconsCache;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.OsmandSettings;
|
import net.osmand.plus.OsmandSettings;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
|
||||||
import net.osmand.plus.activities.MapActivity;
|
import net.osmand.plus.activities.MapActivity;
|
||||||
import net.osmand.plus.dashboard.DashLocationFragment;
|
import net.osmand.plus.dashboard.DashLocationFragment;
|
||||||
import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents;
|
import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents;
|
||||||
|
@ -46,7 +45,6 @@ import net.osmand.plus.mapcontextmenu.MenuController.TitleProgressController;
|
||||||
import net.osmand.plus.views.AnimateDraggingMapThread;
|
import net.osmand.plus.views.AnimateDraggingMapThread;
|
||||||
import net.osmand.plus.views.OsmandMapTileView;
|
import net.osmand.plus.views.OsmandMapTileView;
|
||||||
import net.osmand.util.Algorithms;
|
import net.osmand.util.Algorithms;
|
||||||
|
|
||||||
import static android.util.TypedValue.COMPLEX_UNIT_DIP;
|
import static android.util.TypedValue.COMPLEX_UNIT_DIP;
|
||||||
import static net.osmand.plus.mapcontextmenu.MenuBuilder.SHADOW_HEIGHT_TOP_DP;
|
import static net.osmand.plus.mapcontextmenu.MenuBuilder.SHADOW_HEIGHT_TOP_DP;
|
||||||
|
|
||||||
|
@ -361,14 +359,8 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
||||||
});
|
});
|
||||||
|
|
||||||
final ImageButton buttonWaypoint = (ImageButton) view.findViewById(R.id.context_menu_route_button);
|
final ImageButton buttonWaypoint = (ImageButton) view.findViewById(R.id.context_menu_route_button);
|
||||||
// Correct use of destination vs. waypoit icon on button:
|
buttonWaypoint.setImageDrawable(iconsCache.getIcon(R.drawable.map_action_flag_dark,
|
||||||
if (getMyApplication().getTargetPointsHelper().getPointToNavigate() == null) {
|
|
||||||
buttonWaypoint.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_flag_dark,
|
|
||||||
light ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
|
light ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
|
||||||
} else {
|
|
||||||
buttonWaypoint.setImageDrawable(iconsCache.getIcon(R.drawable.map_action_waypoints,
|
|
||||||
light ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
|
|
||||||
}
|
|
||||||
buttonWaypoint.setOnClickListener(new View.OnClickListener() {
|
buttonWaypoint.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
@ -760,7 +752,8 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
|
||||||
|
|
||||||
private void updateCompassVisibility() {
|
private void updateCompassVisibility() {
|
||||||
View compassView = view.findViewById(R.id.compass_layout);
|
View compassView = view.findViewById(R.id.compass_layout);
|
||||||
boolean gpsFixed = getMyApplication().getLocationProvider().getGPSInfo().fixed;
|
Location ll = getMyApplication().getLocationProvider().getLastKnownLocation();
|
||||||
|
boolean gpsFixed = ll != null && System.currentTimeMillis() - ll.getTime() < 1000 * 60 * 60 * 20;
|
||||||
if (gpsFixed && menu.displayDistanceDirection() && menu.getCurrentMenuState() != MenuState.FULL_SCREEN) {
|
if (gpsFixed && menu.displayDistanceDirection() && menu.getCurrentMenuState() != MenuState.FULL_SCREEN) {
|
||||||
updateDistanceDirection();
|
updateDistanceDirection();
|
||||||
compassView.setVisibility(View.VISIBLE);
|
compassView.setVisibility(View.VISIBLE);
|
||||||
|
|
|
@ -257,7 +257,7 @@ public abstract class MenuController extends BaseMenuController {
|
||||||
|
|
||||||
public Drawable getSecondLineTypeIcon() { return null; }
|
public Drawable getSecondLineTypeIcon() { return null; }
|
||||||
|
|
||||||
public int getFavActionIconId() { return R.drawable.ic_action_fav_dark; }
|
public int getFavActionIconId() { return R.drawable.map_action_fav_dark; }
|
||||||
|
|
||||||
public String getTypeStr() { return ""; }
|
public String getTypeStr() { return ""; }
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ public abstract class MenuTitleController {
|
||||||
getMapActivity().getMyApplication().getLocationProvider()
|
getMapActivity().getMyApplication().getLocationProvider()
|
||||||
.getRouteSegment(ll, new ResultMatcher<RouteDataObject>() {
|
.getRouteSegment(ll, new ResultMatcher<RouteDataObject>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean publish(RouteDataObject object) {
|
public boolean publish(RouteDataObject object) {
|
||||||
if (object != null) {
|
if (object != null) {
|
||||||
OsmandSettings settings = getMapActivity().getMyApplication().getSettings();
|
OsmandSettings settings = getMapActivity().getMyApplication().getSettings();
|
||||||
|
|
|
@ -29,7 +29,12 @@ public class EditPOIMenuBuilder extends MenuBuilder {
|
||||||
OpenstreetmapPoint point = (OpenstreetmapPoint) osmPoint;
|
OpenstreetmapPoint point = (OpenstreetmapPoint) osmPoint;
|
||||||
|
|
||||||
for (Map.Entry<String, String> e : point.getEntity().getTags().entrySet()) {
|
for (Map.Entry<String, String> e : point.getEntity().getTags().entrySet()) {
|
||||||
String text = e.getKey() + "=" + e.getValue();
|
String text;
|
||||||
|
if (EditPoiData.POI_TYPE_TAG.equals(e.getKey())) {
|
||||||
|
text = e.getValue();
|
||||||
|
} else {
|
||||||
|
text = e.getKey() + "=" + e.getValue();
|
||||||
|
}
|
||||||
buildRow(view, R.drawable.ic_action_info_dark, text, 0, false, 0);
|
buildRow(view, R.drawable.ic_action_info_dark, text, 0, false, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,10 +191,8 @@ public class PoiFiltersHelper {
|
||||||
cacheTopStandardFilters = top;
|
cacheTopStandardFilters = top;
|
||||||
}
|
}
|
||||||
List<PoiUIFilter> result = new ArrayList<PoiUIFilter>();
|
List<PoiUIFilter> result = new ArrayList<PoiUIFilter>();
|
||||||
if(OsmandPlugin.getEnabledPlugin(AccessibilityPlugin.class) != null) {
|
|
||||||
result.add(getShowAllPOIFilter());
|
|
||||||
}
|
|
||||||
result.addAll(cacheTopStandardFilters);
|
result.addAll(cacheTopStandardFilters);
|
||||||
|
result.add(getShowAllPOIFilter());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|