From 3774f9b3cbfe4411c37f9199fdf0c6ed0c6e46c9 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 21 Jul 2010 06:41:11 +0000 Subject: [PATCH] fix small issues git-svn-id: https://osmand.googlecode.com/svn/trunk@376 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8 --- .../src/com/osmand/ToDoConstants.java | 31 +++++++++++-------- OsmAnd/res/values-ru/strings.xml | 2 +- OsmAnd/res/values/strings.xml | 2 +- OsmAnd/src/com/osmand/ResourceManager.java | 2 +- .../com/osmand/activities/MapActivity.java | 4 +-- .../com/osmand/activities/RoutingHelper.java | 5 +++ .../activities/ShowRouteInfoActivity.java | 17 +++++----- 7 files changed, 37 insertions(+), 26 deletions(-) diff --git a/DataExtractionOSM/src/com/osmand/ToDoConstants.java b/DataExtractionOSM/src/com/osmand/ToDoConstants.java index fceade3e31..e9e7a6f22b 100644 --- a/DataExtractionOSM/src/com/osmand/ToDoConstants.java +++ b/DataExtractionOSM/src/com/osmand/ToDoConstants.java @@ -8,20 +8,25 @@ package com.osmand; */ public class ToDoConstants { - // TODO ANDROID - // for 0.3 - - // Improvement : Show layers (?) - // Improvement : Show stops in the transport route on the map - // Improvement : show favorites on the map? + // TODO ANDROID 0.3 + // Improvements + // 1. Show layers (?) - + // 0) map 1) transport 2) Poi (choose filter) 3) Favorites 4) Route (gmaps) 5) Transport route ? 6) Traffic ? 7) NameFinder + // 1.4 show detailed route on the map with turns and show route information directly (like in gmaps) - // Improvement : progress while loading tiles - // Improvement : download with wget or multi downloader - // Improvement : use NameFinder for search POI/address near location + // 2. Using NameFinder to search online + // 3. Show route info after route calc + // 4. show vehicle for calculating route + + // BUGS + // ISSUE 21. + // ISSUE 23. - // Imrpovement : show vehicle for calculating route - // Improvement : show detailed route on the map with turns and show route information directly (like in gmaps) - // Improvement : show route info after route is calculated (-) + + // TODO + // Improvements + // 5. Download with wget + // 6. progress while map is loading // Not clear if it is really needed // 69. Add phone information to POI @@ -29,7 +34,7 @@ public class ToDoConstants { // Unscheduled (complex) - // 66. Transport routing (show next stop, total distance, show stop get out) (?). + // 66. Transport routing (show next stop, total distance, show stop get out, voice) (?). // 64. Traffic information (?) - rmaps (http://jgo.maps.yandex.net/tiles?l=trf)? // 65. Intermediate points - for better control routing, to avoid traffic jams ...(?) // 40. Support simple vector road rendering (require new index file) (?) diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 5171cf0232..eecb3e1aa0 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -106,7 +106,7 @@ Уровень детализации Выберите максимальный уровень для загрузки из интернета О маршруте - Общая протяженность = {0}, время в пути = \'\'{1}\'\'. + Общая протяженность = {0}, время в пути = {1} ч. {2} мин. Выберите сервис для прокладки маршрута Прокладка маршрута Директория на SD карточка не доступна для сохранения diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 15966f8f17..75d2aeeb7e 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -106,7 +106,7 @@ Max zoom level Choose max zoom level to download using internet About route - Overall distance = {0}, travelling time = \'\'{1}\'\'. + Overall distance = {0}, travelling time = {1} h {2} m. Choose routing service Routing Directory on SD card to save index is not accessible diff --git a/OsmAnd/src/com/osmand/ResourceManager.java b/OsmAnd/src/com/osmand/ResourceManager.java index dc78c00b9f..7c126f4816 100644 --- a/OsmAnd/src/com/osmand/ResourceManager.java +++ b/OsmAnd/src/com/osmand/ResourceManager.java @@ -507,7 +507,7 @@ public class ResourceManager { if(source == null || source.getBitDensity() == 0){ maxImgCacheSize = 48; } else { - maxImgCacheSize = 1024 / source.getBitDensity(); + maxImgCacheSize = 512 / source.getBitDensity(); } } diff --git a/OsmAnd/src/com/osmand/activities/MapActivity.java b/OsmAnd/src/com/osmand/activities/MapActivity.java index a318524994..7faaef2406 100644 --- a/OsmAnd/src/com/osmand/activities/MapActivity.java +++ b/OsmAnd/src/com/osmand/activities/MapActivity.java @@ -132,12 +132,12 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso private Notification getNotification(){ Intent notificationIndent = new Intent(this, MapActivity.class); - notificationIndent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + notificationIndent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); Notification notification = new Notification(R.drawable.icon, "", //$NON-NLS-1$ System.currentTimeMillis()); notification.setLatestEventInfo(this, Version.APP_NAME, getString(R.string.go_back_to_osmand), PendingIntent.getActivity( - this.getBaseContext(), 0, notificationIndent, + this, 0, notificationIndent, PendingIntent.FLAG_UPDATE_CURRENT)); return notification; } diff --git a/OsmAnd/src/com/osmand/activities/RoutingHelper.java b/OsmAnd/src/com/osmand/activities/RoutingHelper.java index 0bafb8f72d..ffb0b9d583 100644 --- a/OsmAnd/src/com/osmand/activities/RoutingHelper.java +++ b/OsmAnd/src/com/osmand/activities/RoutingHelper.java @@ -6,6 +6,7 @@ import java.util.List; import android.app.Activity; import android.content.Context; +import android.content.Intent; import android.location.Location; import android.util.FloatMath; import android.widget.Toast; @@ -317,6 +318,10 @@ public class RoutingHelper { currentRoute = 0; if(isFollowingMode){ voiceRouter.newRouteIsCalculated(); + } else { + Intent intent = new Intent(context, ShowRouteInfoActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + context.startActivity(intent); } } diff --git a/OsmAnd/src/com/osmand/activities/ShowRouteInfoActivity.java b/OsmAnd/src/com/osmand/activities/ShowRouteInfoActivity.java index dd33cc044e..9d1eb15ef8 100644 --- a/OsmAnd/src/com/osmand/activities/ShowRouteInfoActivity.java +++ b/OsmAnd/src/com/osmand/activities/ShowRouteInfoActivity.java @@ -4,7 +4,6 @@ package com.osmand.activities; import java.text.MessageFormat; -import java.util.Calendar; import java.util.List; import android.app.ListActivity; @@ -19,7 +18,6 @@ import android.graphics.Paint.Style; import android.graphics.drawable.Drawable; import android.location.Location; import android.os.Bundle; -import android.text.format.DateFormat; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -59,11 +57,11 @@ public class ShowRouteInfoActivity extends ListActivity { @Override protected void onResume() { super.onResume(); - Calendar c = Calendar.getInstance(); - int time = helper.getLeftTime() * 1000 - c.getTimeZone().getOffset(0); int dist = helper.getLeftDistance(); + int hours = helper.getLeftTime() / (60 * 60); + int minutes = (helper.getLeftTime() / 60) % 60; header.setText(MessageFormat.format(getString(R.string.route_general_information), MapUtils.getFormattedDistance(dist), - DateFormat.format("kk:mm", time))); //$NON-NLS-1$ + hours, minutes)); setListAdapter(new RouteInfoAdapter(RoutingHelper.getInstance(this).getRouteDirections())); } @@ -142,10 +140,13 @@ public class ShowRouteInfoActivity extends ListActivity { ((RouteDrawable) icon.getDrawable()).setRouteType(model.turnType); distanceLabel.setText(MapUtils.getFormattedDistance(model.distance)); label.setText(model.descriptionRoute); - if(model.expectedTime < 3600){ - timeLabel.setText(DateFormat.format("mm:ss", model.expectedTime * 1000)); //$NON-NLS-1$ + int seconds = model.expectedTime % 60; + int min = (model.expectedTime / 60) % 60; + int hours = (model.expectedTime / 3600); + if (hours == 0) { + timeLabel.setText(String.format("%02d:%02d", min, seconds)); //$NON-NLS-1$ } else { - timeLabel.setText(DateFormat.format("kk:mm:ss", model.expectedTime * 1000)); //$NON-NLS-1$ + timeLabel.setText(String.format("%d:%02d:%02d", hours, min, seconds)); //$NON-NLS-1$ } return row; }