diff --git a/OsmAnd-java/src/net/osmand/data/Amenity.java b/OsmAnd-java/src/net/osmand/data/Amenity.java index d077605839..6401618e84 100644 --- a/OsmAnd-java/src/net/osmand/data/Amenity.java +++ b/OsmAnd-java/src/net/osmand/data/Amenity.java @@ -91,6 +91,7 @@ public class Amenity extends MapObject { while ((s = br.readLine()) != null) { bld.append(s); } + br.close(); str = bld.toString(); } catch (IOException e) { e.printStackTrace(); diff --git a/OsmAnd/res/drawable-large-hdpi/map_note_audio.png b/OsmAnd/res/drawable-large-hdpi/map_note_audio.png index cc82413085..237069e0da 100644 Binary files a/OsmAnd/res/drawable-large-hdpi/map_note_audio.png and b/OsmAnd/res/drawable-large-hdpi/map_note_audio.png differ diff --git a/OsmAnd/res/drawable-large-hdpi/map_note_photo.png b/OsmAnd/res/drawable-large-hdpi/map_note_photo.png index c1763561f9..365a9a5b60 100644 Binary files a/OsmAnd/res/drawable-large-hdpi/map_note_photo.png and b/OsmAnd/res/drawable-large-hdpi/map_note_photo.png differ diff --git a/OsmAnd/res/drawable-large-hdpi/map_note_small.png b/OsmAnd/res/drawable-large-hdpi/map_note_small.png index 11cb3918c6..5d1d0b5347 100644 Binary files a/OsmAnd/res/drawable-large-hdpi/map_note_small.png and b/OsmAnd/res/drawable-large-hdpi/map_note_small.png differ diff --git a/OsmAnd/res/drawable-large-hdpi/map_note_video.png b/OsmAnd/res/drawable-large-hdpi/map_note_video.png index aa207e10ad..a5f9dba5d9 100644 Binary files a/OsmAnd/res/drawable-large-hdpi/map_note_video.png and b/OsmAnd/res/drawable-large-hdpi/map_note_video.png differ diff --git a/OsmAnd/res/drawable-large-hdpi/map_pin_poi.png b/OsmAnd/res/drawable-large-hdpi/map_pin_poi.png index 73642a9cc0..1f218bdca1 100644 Binary files a/OsmAnd/res/drawable-large-hdpi/map_pin_poi.png and b/OsmAnd/res/drawable-large-hdpi/map_pin_poi.png differ diff --git a/OsmAnd/res/drawable-large-hdpi/map_pin_poi_small.png b/OsmAnd/res/drawable-large-hdpi/map_pin_poi_small.png index 4d222e5051..287964f5d6 100644 Binary files a/OsmAnd/res/drawable-large-hdpi/map_pin_poi_small.png and b/OsmAnd/res/drawable-large-hdpi/map_pin_poi_small.png differ diff --git a/OsmAnd/res/drawable-large-hdpi/map_white_orange_poi_shield.png b/OsmAnd/res/drawable-large-hdpi/map_white_orange_poi_shield.png index e589d0b1cf..606b1af8a6 100644 Binary files a/OsmAnd/res/drawable-large-hdpi/map_white_orange_poi_shield.png and b/OsmAnd/res/drawable-large-hdpi/map_white_orange_poi_shield.png differ diff --git a/OsmAnd/res/drawable-large-hdpi/map_white_orange_poi_shield_small.png b/OsmAnd/res/drawable-large-hdpi/map_white_orange_poi_shield_small.png index 11bc552da0..59a9d8360a 100644 Binary files a/OsmAnd/res/drawable-large-hdpi/map_white_orange_poi_shield_small.png and b/OsmAnd/res/drawable-large-hdpi/map_white_orange_poi_shield_small.png differ diff --git a/OsmAnd/res/drawable-large-xhdpi/map_note_audio.png b/OsmAnd/res/drawable-large-xhdpi/map_note_audio.png index b1752cdcc7..f00aa9a3b4 100644 Binary files a/OsmAnd/res/drawable-large-xhdpi/map_note_audio.png and b/OsmAnd/res/drawable-large-xhdpi/map_note_audio.png differ diff --git a/OsmAnd/res/drawable-large-xhdpi/map_note_photo.png b/OsmAnd/res/drawable-large-xhdpi/map_note_photo.png index c671049a6b..8a2a815188 100644 Binary files a/OsmAnd/res/drawable-large-xhdpi/map_note_photo.png and b/OsmAnd/res/drawable-large-xhdpi/map_note_photo.png differ diff --git a/OsmAnd/res/drawable-large-xhdpi/map_note_small.png b/OsmAnd/res/drawable-large-xhdpi/map_note_small.png index 1c10f1a6b6..36f1170503 100644 Binary files a/OsmAnd/res/drawable-large-xhdpi/map_note_small.png and b/OsmAnd/res/drawable-large-xhdpi/map_note_small.png differ diff --git a/OsmAnd/res/drawable-large-xhdpi/map_note_video.png b/OsmAnd/res/drawable-large-xhdpi/map_note_video.png index fedf35f2dc..8f09403f52 100644 Binary files a/OsmAnd/res/drawable-large-xhdpi/map_note_video.png and b/OsmAnd/res/drawable-large-xhdpi/map_note_video.png differ diff --git a/OsmAnd/res/drawable-large-xhdpi/map_pin_poi.png b/OsmAnd/res/drawable-large-xhdpi/map_pin_poi.png index 5b5aa045e9..cd2a444309 100644 Binary files a/OsmAnd/res/drawable-large-xhdpi/map_pin_poi.png and b/OsmAnd/res/drawable-large-xhdpi/map_pin_poi.png differ diff --git a/OsmAnd/res/drawable-large-xhdpi/map_pin_poi_small.png b/OsmAnd/res/drawable-large-xhdpi/map_pin_poi_small.png index ad2cde151e..9a335a91c6 100644 Binary files a/OsmAnd/res/drawable-large-xhdpi/map_pin_poi_small.png and b/OsmAnd/res/drawable-large-xhdpi/map_pin_poi_small.png differ diff --git a/OsmAnd/res/drawable-large-xhdpi/map_white_orange_poi_shield.png b/OsmAnd/res/drawable-large-xhdpi/map_white_orange_poi_shield.png index b747faeb2b..fd74fb4a1d 100644 Binary files a/OsmAnd/res/drawable-large-xhdpi/map_white_orange_poi_shield.png and b/OsmAnd/res/drawable-large-xhdpi/map_white_orange_poi_shield.png differ diff --git a/OsmAnd/res/drawable-large-xhdpi/map_white_orange_poi_shield_small.png b/OsmAnd/res/drawable-large-xhdpi/map_white_orange_poi_shield_small.png index d218cdc107..de66729794 100644 Binary files a/OsmAnd/res/drawable-large-xhdpi/map_white_orange_poi_shield_small.png and b/OsmAnd/res/drawable-large-xhdpi/map_white_orange_poi_shield_small.png differ diff --git a/OsmAnd/res/drawable-large/map_note_audio.png b/OsmAnd/res/drawable-large/map_note_audio.png index 5339890822..ec824f1f5a 100644 Binary files a/OsmAnd/res/drawable-large/map_note_audio.png and b/OsmAnd/res/drawable-large/map_note_audio.png differ diff --git a/OsmAnd/res/drawable-large/map_note_photo.png b/OsmAnd/res/drawable-large/map_note_photo.png index dd528c5fe2..a586bcdd95 100644 Binary files a/OsmAnd/res/drawable-large/map_note_photo.png and b/OsmAnd/res/drawable-large/map_note_photo.png differ diff --git a/OsmAnd/res/drawable-large/map_note_small.png b/OsmAnd/res/drawable-large/map_note_small.png index 089584f09c..d6ef5c7895 100644 Binary files a/OsmAnd/res/drawable-large/map_note_small.png and b/OsmAnd/res/drawable-large/map_note_small.png differ diff --git a/OsmAnd/res/drawable-large/map_note_video.png b/OsmAnd/res/drawable-large/map_note_video.png index 11df3ffc0f..48066ca5c1 100644 Binary files a/OsmAnd/res/drawable-large/map_note_video.png and b/OsmAnd/res/drawable-large/map_note_video.png differ diff --git a/OsmAnd/res/drawable-large/map_pin_poi.png b/OsmAnd/res/drawable-large/map_pin_poi.png index d1790e5905..1d6a8d412b 100644 Binary files a/OsmAnd/res/drawable-large/map_pin_poi.png and b/OsmAnd/res/drawable-large/map_pin_poi.png differ diff --git a/OsmAnd/res/drawable-large/map_pin_poi_small.png b/OsmAnd/res/drawable-large/map_pin_poi_small.png index ed0068ec09..65242db619 100644 Binary files a/OsmAnd/res/drawable-large/map_pin_poi_small.png and b/OsmAnd/res/drawable-large/map_pin_poi_small.png differ diff --git a/OsmAnd/res/drawable-large/map_white_orange_poi_shield.png b/OsmAnd/res/drawable-large/map_white_orange_poi_shield.png index 62eaf89789..2f80b35243 100644 Binary files a/OsmAnd/res/drawable-large/map_white_orange_poi_shield.png and b/OsmAnd/res/drawable-large/map_white_orange_poi_shield.png differ diff --git a/OsmAnd/res/drawable-large/map_white_orange_poi_shield_small.png b/OsmAnd/res/drawable-large/map_white_orange_poi_shield_small.png index 6e26fe8d66..65558478b7 100644 Binary files a/OsmAnd/res/drawable-large/map_white_orange_poi_shield_small.png and b/OsmAnd/res/drawable-large/map_white_orange_poi_shield_small.png differ diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_search_dark.png b/OsmAnd/res/drawable-xxhdpi/ic_action_search_dark.png index 8fca8a0679..52f8a7de31 100644 Binary files a/OsmAnd/res/drawable-xxhdpi/ic_action_search_dark.png and b/OsmAnd/res/drawable-xxhdpi/ic_action_search_dark.png differ diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 4ac1745df2..1ae573f7fc 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -6,8 +6,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; -import net.londatiga.android.ActionItem; -import net.londatiga.android.QuickAction; import net.osmand.IndexConstants; import net.osmand.Location; import net.osmand.PlatformUtil; @@ -48,12 +46,10 @@ import android.app.Activity; import android.app.Dialog; import android.content.DialogInterface; import android.content.Intent; -import android.graphics.drawable.Drawable; import android.os.AsyncTask; import android.os.Bundle; import android.support.v7.app.AlertDialog; import android.view.View; -import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.WindowManager; 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() { final ListView menuItemsListView = (ListView) mapActivity.findViewById(R.id.menuItems); diff --git a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java index 3ee3915d27..8313b62955 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java @@ -27,7 +27,6 @@ import net.osmand.plus.GPXUtilities; import net.osmand.plus.GPXUtilities.GPXFile; import net.osmand.plus.GPXUtilities.GPXTrackAnalysis; import net.osmand.plus.GPXUtilities.TrkSegment; -import net.osmand.plus.GpxSelectionHelper; import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; @@ -174,11 +173,16 @@ public class GpxUiHelper { public static AlertDialog selectSingleGPXFile(final Activity activity, final boolean showCurrentGpx, final CallbackWithObject callbackWithObject) { OsmandApplication app = (OsmandApplication) activity.getApplication(); - final File dir = app.getAppPath(IndexConstants.GPX_INDEX_DIR); - final List list = getSortedGPXFilenames(dir, false); - if (!list.isEmpty() || showCurrentGpx) { + int gpxDirLength = app.getAppPath(IndexConstants.GPX_INDEX_DIR).getAbsolutePath().length(); + List selectedGpxFiles = app.getSelectedGpxHelper().getSelectedGPXFiles(); + final List list = new ArrayList<>(selectedGpxFiles.size() + 1); + if (!selectedGpxFiles.isEmpty() || 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, diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index 99c5e767f8..3502269c7a 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -6,13 +6,13 @@ import android.view.View; import android.widget.LinearLayout; import net.osmand.CallbackWithObject; -import net.osmand.IndexConstants; import net.osmand.data.FavouritePoint; import net.osmand.data.LatLon; import net.osmand.data.PointDescription; import net.osmand.plus.ContextMenuAdapter; import net.osmand.plus.GPXUtilities.GPXFile; import net.osmand.plus.GPXUtilities.WptPt; +import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; 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.util.MapUtils; -import java.io.File; import java.lang.ref.WeakReference; import java.util.List; @@ -53,7 +52,6 @@ public class MapContextMenu extends MenuTitleController { private LatLon myLocation; private Float heading; private boolean inLocationUpdate = false; - private long locationUpdateTime; private int favActionIconId; @@ -401,20 +399,18 @@ public class MapContextMenu extends MenuTitleController { } public void addWptPt() { - if (object == null) { - String title = getTitleStr(); - if (pointDescription.isWpt() || title.equals(addressNotKnownStr)) { - title = ""; - } + String title = getTitleStr(); + if (pointDescription.isWpt() || title.equals(addressNotKnownStr)) { + title = ""; + } - final File dir = mapActivity.getMyApplication().getAppPath(IndexConstants.GPX_INDEX_DIR); - final List list = GpxUiHelper.getSortedGPXFilenames(dir, false); - if (list.isEmpty()) { - GPXFile gpxFile = mapActivity.getMyApplication().getSavingTrackHelper().getCurrentGpx(); - getWptPtPointEditor().add(gpxFile, latLon, title); - } else { - addNewWptToGPXFile(title); - } + final List list + = mapActivity.getMyApplication().getSelectedGpxHelper().getSelectedGPXFiles(); + if (list.isEmpty()) { + GPXFile gpxFile = mapActivity.getMyApplication().getSavingTrackHelper().getCurrentGpx(); + getWptPtPointEditor().add(gpxFile, latLon, title); + } else { + addNewWptToGPXFile(title); } } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index 470ed6b338..4c924f29b7 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -28,7 +28,7 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; - +import net.osmand.Location; import net.osmand.data.LatLon; import net.osmand.data.QuadPoint; import net.osmand.data.RotatedTileBox; @@ -36,7 +36,6 @@ import net.osmand.plus.IconsCache; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; -import net.osmand.plus.TargetPointsHelper.TargetPoint; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.dashboard.DashLocationFragment; 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.OsmandMapTileView; import net.osmand.util.Algorithms; - import static android.util.TypedValue.COMPLEX_UNIT_DIP; 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); - // Correct use of destination vs. waypoit icon on button: - if (getMyApplication().getTargetPointsHelper().getPointToNavigate() == null) { - buttonWaypoint.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_flag_dark, + buttonWaypoint.setImageDrawable(iconsCache.getIcon(R.drawable.map_action_flag_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() { @Override public void onClick(View v) { @@ -760,7 +752,8 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents { private void updateCompassVisibility() { 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) { updateDistanceDirection(); compassView.setVisibility(View.VISIBLE); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java index f80f1583eb..2cd9ef4e87 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java @@ -257,7 +257,7 @@ public abstract class MenuController extends BaseMenuController { 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 ""; } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java index 44665e2d62..f1c7da8ac9 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuTitleController.java @@ -137,7 +137,7 @@ public abstract class MenuTitleController { getMapActivity().getMyApplication().getLocationProvider() .getRouteSegment(ll, new ResultMatcher() { - @Override + @Override public boolean publish(RouteDataObject object) { if (object != null) { OsmandSettings settings = getMapActivity().getMyApplication().getSettings(); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuBuilder.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuBuilder.java index 0d6a2fa942..273e86c927 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuBuilder.java @@ -29,7 +29,12 @@ public class EditPOIMenuBuilder extends MenuBuilder { OpenstreetmapPoint point = (OpenstreetmapPoint) osmPoint; for (Map.Entry 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); } } diff --git a/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java b/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java index db2a9d820e..4aebe527d5 100644 --- a/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java +++ b/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java @@ -191,10 +191,8 @@ public class PoiFiltersHelper { cacheTopStandardFilters = top; } List result = new ArrayList(); - if(OsmandPlugin.getEnabledPlugin(AccessibilityPlugin.class) != null) { - result.add(getShowAllPOIFilter()); - } result.addAll(cacheTopStandardFilters); + result.add(getShowAllPOIFilter()); return result; }