fix transport

build issues

git-svn-id: https://osmand.googlecode.com/svn/trunk@543 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-10-06 15:25:06 +00:00
parent 5961abdf23
commit 9454618ddb
16 changed files with 89 additions and 59 deletions

View file

@ -7,7 +7,7 @@ package net.osmand;
*/
public class ToDoConstants {
// TODO max 97
// TODO max 99
// FOR 0.4 beta RELEASE
// POI
@ -17,15 +17,11 @@ public class ToDoConstants {
// railway( station, subway?) - issue 17
// !_22. Verify all POI has a point_type (in order to search them)
// +!_29. Fix memory for netherlands map creator
// ! 89. Transport redesign UI (enable run from context menu, switch go to goal/not) !
// !_30. Fix rotate
///+-!!PROFILE AND REVIEW Rendering and map creator!!!
// !_30. Fix rotate (_)
// Outside base 0.4 release
// 97. For voice navigation consider current speed of vehicle. Especially when speed > 50 pronounce more than 200 m
// 98. Implement rendering of different app mode. For Car render streets name with large font.
// 86. Allow to add/edit custom tags to POI objects (Issue)
// 91. Invent binary format (minimize disk space, maximize speed)
// 92. Replace poi index with standard map index and unify POI categories
@ -55,6 +51,7 @@ public class ToDoConstants {
// 96. Download voice data through UI interface (Issue)
// 95. Show progress while map rendered and loaded (Issue)
// 87. Use network availability for defining loading tiles from internet.
// 89. Transport redesign UI (enable run from context menu, switch go to goal/not) !
// DONE SWING
// 12. Reinvent UI of swing app (remove Region object and clear other MapObject)

View file

@ -2,9 +2,9 @@ package net.osmand;
public class Version {
public static final String APP_VERSION = "0.4"; //$NON-NLS-1$
public static final String APP_VERSION = "0.4.1"; //$NON-NLS-1$
public static final String APP_NAME = "OsmAnd"; //$NON-NLS-1$
public static final String APP_DESCRIPTION = "alpha (b2)"; //$NON-NLS-1$
public static final String APP_DESCRIPTION = "beta (b1)"; //$NON-NLS-1$
public static final boolean VELCOM_EDITION = true;
public static final String APP_NAME_VERSION = APP_NAME + " " + APP_VERSION; //$NON-NLS-1$

View file

@ -461,6 +461,7 @@ public class IndexBatchCreator {
MessageFormat format = new MessageFormat("{0,date,dd.MM.yyyy} : {1, number,##.#} MB", Locale.US);
String summary;
double mbLengh = (double)f.length() / MB;
boolean zip = true;
String regionName;
if(f.getName().endsWith(IndexConstants.POI_INDEX_EXT) || f.getName().endsWith(IndexConstants.POI_INDEX_EXT_ZIP)){
regionName = f.getName().substring(0, f.getName().length() - IndexConstants.POI_INDEX_EXT.length() - 2);
@ -481,7 +482,7 @@ public class IndexBatchCreator {
// do not upload small files
return;
}
if(mbLengh > 3 && f.getName().endsWith(".odb")){
if(mbLengh > 3 && f.getName().endsWith(".odb") && zip){
String zipFileName = f.getName().subSequence(0, f.getName().length() - 4)+".zip";
File zFile = new File(f.getParentFile(), zipFileName);
log.info("Zipping file " + f.getName());

View file

@ -244,7 +244,7 @@ public class TileSourceManager {
}
public static TileSourceTemplate getGoogleMapsSatelliteSource(){
return new TileSourceTemplate("GoogleMaps Satellite", "http://khm1.google.com/kh/v=59&x={1}&y={2}&z={0}", ".jpg", 20, 0, 256, 32, 18000); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
return new TileSourceTemplate("GoogleMaps Satellite", "http://khm1.google.com/kh/v=65&x={1}&y={2}&z={0}", ".jpg", 20, 0, 256, 32, 18000); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
public static TileSourceTemplate getGoogleMapsTerrainSource(){

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.osmand" android:versionName="0.4" android:versionCode="14">
package="net.osmand" android:versionName="0.4.1" android:versionCode="15">
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:debuggable="true" android:name=".activities.OsmandApplication" android:description="@string/app_description">
<activity android:name=".activities.MainMenuActivity"

View file

@ -5,7 +5,7 @@
android:layout_height="fill_parent" android:id="@+id/RootLayout">
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">
<ProgressBar android:id="@+id/ProgressBar" android:layout_width="wrap_content" android:layout_height="wrap_content"></ProgressBar>
<Button android:text="@string/search_POI_level_btn" android:id="@+id/SearchPOILevelButton" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_weight="1"></Button>
<Button android:id="@+id/SearchTransportLevelButton" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_weight="1"></Button>
<TextView android:layout_width="wrap_content" android:text="" android:id="@+id/SearchAreaText" android:layout_height="wrap_content"/>
</LinearLayout>
<RelativeLayout android:id="@+id/RelativeLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center">

View file

@ -14,7 +14,6 @@
<item android:id="@+id/map_get_directions" android:title="@string/get_directions" android:icon="@android:drawable/ic_menu_directions"></item>
<item android:title="@string/map_specify_point" android:id="@+id/map_specify_point" android:icon="@android:drawable/ic_menu_search"></item>
<item android:id="@+id/map_transport" android:title="@string/transport"></item>
<item android:title="@string/show_gps_status" android:id="@+id/map_show_gps_status" android:icon="@android:drawable/ic_menu_compass"></item>
<item android:title="@string/map_route_by_gpx" android:id="@+id/map_gpx_routing"></item>
</group>

View file

@ -1,5 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="context_menu_item_search_transport">Искать транспорт</string>
<string name="transport_context_menu">Искать транспорт на остановке</string>
<string name="transport_searching_transport">Искать транспорт (нет цели)</string>
<string name="transport_searching_route">Искать транспорт (до цели {0})</string>
<string name="transport_search_again">Искать транспорт заново</string>
<string name="map_index">Карта</string>
<string name="voice">Голосовые данные</string>
<string name="no_vector_map_loaded">Векторные карты не загружены в приложение</string>
@ -10,7 +16,7 @@
<string name="layer_gpx_layer">GPX треки</string>
<string name="error_reading_gpx">Ошибка при чтении gpx файла</string>
<string name="vector_data">Векторные osm карты</string>
<string name="transport_context_menu">Искать транспорт на остановке</string>
<string name="point_on_map">Точка на карте\n Ш {0,number,#.####} Д {1,number,#.####}</string>
<string name="osb_bug_name">Bug</string>
<string name="poi_context_menu_modify">Редактировать POI</string>
@ -105,8 +111,7 @@
<string name="transport_Routes">Маршруты</string>
<string name="transport_Stop">Остановка</string>
<string name="transport_stops">остановок</string>
<string name="transport_searching_transport">Искать транспорт (нет цели)</string>
<string name="transport_searching_route">Искать {0} маршрут </string>
<string name="transport_search_none">нету</string>
<string name="transport_search_after">Маршрут после</string>
<string name="transport_search_before">Маршрут до</string>

View file

@ -1,5 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<resources>
<string name="context_menu_item_search_transport">Search transport</string>
<string name="transport_searching_transport">Searching transport (no target)</string>
<string name="transport_searching_route">Searching transport ({0} for target)</string>
<string name="transport_search_none">none</string>
<string name="transport_search_again">Transport search again</string>
<string name="map_index">Map</string>
<string name="voice">Voice</string>
<string name="no_vector_map_loaded">Vector maps were not loaded</string>
@ -107,9 +113,7 @@
<string name="transport_Routes">Routes</string>
<string name="transport_Stop">Stop</string>
<string name="transport_stops">stops</string>
<string name="transport_searching_transport">Searching transport (no target)</string>
<string name="transport_searching_route">Searching for {0} route</string>
<string name="transport_search_none">none</string>
<string name="transport_search_after">Search route after</string>
<string name="transport_search_before">Search route before</string>
<string name="transport_finish_search">Finish search</string>

View file

@ -379,6 +379,10 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso
Intent newIntent = new Intent(MapActivity.this, SearchActivity.class);
startActivity(newIntent);
return true;
} else if (keyCode == KeyEvent.KEYCODE_R) {
// Is it needed
mapView.setRotate(mapView.getRotate() + 45);
return true;
}
return super.onKeyDown(keyCode, event);
}
@ -955,12 +959,6 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso
Toast.makeText(this, getString(R.string.gps_status_app_not_found), Toast.LENGTH_LONG).show();
}
return true;
} else if (item.getItemId() == R.id.map_transport) {
Intent intent = new Intent(this, SearchTransportActivity.class);
intent.putExtra(SearchTransportActivity.LAT_KEY, mapView.getLatitude());
intent.putExtra(SearchTransportActivity.LON_KEY, mapView.getLongitude());
startActivity(intent);
return true;
// } else if (item.getItemId() == R.id.map_mark_point) {
// contextMenuPoint(mapView.getLatitude(), mapView.getLongitude());
// return true;
@ -1509,6 +1507,7 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso
actions.add(resources.getString(R.string.context_menu_item_navigate_point));
actions.add(resources.getString(R.string.context_menu_item_search_poi));
actions.add(resources.getString(R.string.context_menu_item_show_route));
actions.add(resources.getString(R.string.context_menu_item_search_transport));
actions.add(resources.getString(R.string.context_menu_item_add_favorite));
actions.add(resources.getString(R.string.context_menu_item_create_poi));
actions.add(resources.getString(R.string.context_menu_item_open_bug));
@ -1533,13 +1532,18 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso
} else if(which == 2){
getDirections(latitude, longitude, false);
} else if(which == 3){
addFavouritePoint(latitude, longitude);
Intent intent = new Intent(MapActivity.this, SearchTransportActivity.class);
intent.putExtra(SearchTransportActivity.LAT_KEY, latitude);
intent.putExtra(SearchTransportActivity.LON_KEY, longitude);
startActivity(intent);
} else if(which == 4){
addFavouritePoint(latitude, longitude);
} else if(which == 5){
EditingPOIActivity activity = new EditingPOIActivity(MapActivity.this, (OsmandApplication) getApplication(), mapView);
activity.showCreateDialog(latitude, longitude);
} else if(which == 5){
osmBugsLayer.openBug(MapActivity.this, getLayoutInflater(), mapView, latitude, longitude);
} else if(which == 6){
osmBugsLayer.openBug(MapActivity.this, getLayoutInflater(), mapView, latitude, longitude);
} else if(which == 7){
reloadTile(mapView.getZoom(), latitude, longitude);
}
}

View file

@ -14,6 +14,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListView;
@ -31,6 +32,7 @@ public abstract class SearchByNameAbstractActivity<T> extends ListActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.search_by_name);
NamesAdapter namesAdapter = new NamesAdapter(getObjects("")); //$NON-NLS-1$
setListAdapter(namesAdapter);
@ -50,6 +52,8 @@ public abstract class SearchByNameAbstractActivity<T> extends ListActivity {
}
});
searchText.requestFocus();
progress.setVisibility(View.INVISIBLE);
findViewById(R.id.ResetButton).setOnClickListener(new View.OnClickListener(){
@ -59,6 +63,7 @@ public abstract class SearchByNameAbstractActivity<T> extends ListActivity {
}
});
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
}
public boolean isFilterableByDefault(){

View file

@ -59,9 +59,9 @@ public class SearchTransportActivity extends ListActivity {
private Thread thread;
// TODO test when these args null
private LatLon lastKnownMapLocation;
private LatLon destinationLocation;
private LatLon selectedDestinationLocation;
private TransportStopAdapter stopsAdapter;
private TransportRouteAdapter intermediateListAdapater;
@ -79,17 +79,25 @@ public class SearchTransportActivity extends ListActivity {
lastKnownMapLocation = OsmandSettings.getLastKnownMapLocation(this);
}
setContentView(R.layout.search_transport);
searchTransportLevel = (Button) findViewById(R.id.SearchPOILevelButton);
searchArea = (TextView) findViewById(R.id.SearchAreaText);
searchTransportLevel = (Button) findViewById(R.id.SearchTransportLevelButton);
searchTransportLevel.setText(R.string.search_POI_level_btn);
searchTransportLevel.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if(isSearchFurtherAvailable()){
zoom --;
if (!isRouteCalculated()) {
if (isSearchFurtherAvailable()) {
zoom--;
searchTransport();
}
} else {
intermediateListAdapater.clear();
intermediateListAdapater.add(null);
searchTransport();
}
}
});
searchArea = (TextView) findViewById(R.id.SearchAreaText);
progress = (ProgressBar) findViewById(R.id.ProgressBar);
progress.setVisibility(View.INVISIBLE);
stopsAdapter = new TransportStopAdapter(new ArrayList<RouteInfoLocation>());
@ -123,6 +131,7 @@ public class SearchTransportActivity extends ListActivity {
super.onResume();
if(!Algoritms.objectEquals(OsmandSettings.getPointToNavigate(this), this.destinationLocation)){
destinationLocation = OsmandSettings.getPointToNavigate(this);
selectedDestinationLocation = destinationLocation;
searchTransport();
}
@ -138,9 +147,9 @@ public class SearchTransportActivity extends ListActivity {
public void searchTransport(){
// use progress
stopsAdapter.clear();
searchTransportLevel.setEnabled(false);
searchArea.setText(getSearchArea());
boolean routeCalculated = isRouteCalculated();
searchTransportLevel.setEnabled(false);
if (!routeCalculated && getLocationToStart() != null) {
final LatLon locationToStart = getLocationToStart();
final LatLon locationToGo = getLocationToGo();
@ -171,6 +180,8 @@ public class SearchTransportActivity extends ListActivity {
} else {
repo = null;
}
} else {
updateSearchMoreButton();
}
}
@ -179,11 +190,20 @@ public class SearchTransportActivity extends ListActivity {
@Override
public void run() {
stopsAdapter.setNewModel(stopsList);
searchTransportLevel.setEnabled(isSearchFurtherAvailable());
updateSearchMoreButton();
searchArea.setText(getSearchArea());
progress.setVisibility(View.INVISIBLE);
}
});
}});
}
private void updateSearchMoreButton() {
if (!isRouteCalculated()) {
searchTransportLevel.setEnabled(isSearchFurtherAvailable());
searchTransportLevel.setText(R.string.search_POI_level_btn);
} else {
searchTransportLevel.setEnabled(true);
searchTransportLevel.setText(R.string.transport_search_again);
}
}
public String getInformation(RouteInfoLocation route, List<TransportStop> stops, int position, boolean part){
@ -368,7 +388,7 @@ public class SearchTransportActivity extends ListActivity {
public LatLon getStartStop(int position){
if(position == intermediateListAdapater.getCount()){
return destinationLocation;
return selectedDestinationLocation;
}
RouteInfoLocation item = intermediateListAdapater.getItem(position);
if(item == null){
@ -480,6 +500,13 @@ public class SearchTransportActivity extends ListActivity {
if(intermediateListAdapater.getCount() > 1){
intermediateListAdapater.remove(null);
searchTransport();
} else {
if(selectedDestinationLocation == null){
selectedDestinationLocation = destinationLocation;
} else {
selectedDestinationLocation = null;
}
searchTransport();
}
}

View file

@ -218,7 +218,7 @@ public class MapRenderRepositories {
rotate += 360;
}
return !inside || Math.abs(rotate - cRotate) > 15; // leave only 15 to find that UI box out of searched
return !inside || Math.abs(rotate - cRotate) > 45; // leave only 15 to find that UI box out of searched
}

View file

@ -11,7 +11,6 @@ import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import net.osmand.LogUtil;
import net.osmand.R;

View file

@ -133,6 +133,10 @@ public class TransportInfoLayer implements OsmandMapLayer {
int ey = (int) point.y;
if (visible && !routeHelper.getRoute().isEmpty()) {
for (RouteInfoLocation l : routeHelper.getRoute()) {
if(l == null){
// once l is null in list
continue;
}
TransportRoute route = l.getRoute();
boolean start = false;
boolean end = false;

View file

@ -6,13 +6,10 @@ import java.util.List;
import net.osmand.OsmandSettings;
import net.osmand.R;
import net.osmand.TransportIndexRepository;
import net.osmand.activities.search.SearchTransportActivity;
import net.osmand.data.TransportStop;
import net.osmand.osm.LatLon;
import net.osmand.osm.MapUtils;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.DialogInterface.OnClickListener;
import android.graphics.Canvas;
import android.graphics.Color;
@ -161,19 +158,7 @@ public class TransportStopsLayer implements OsmandMapLayer, ContextMenuLayer.ICo
@Override
public OnClickListener getActionListener(List<String> actionsList, Object o) {
final TransportStop stop = (TransportStop) o;
actionsList.add(view.getContext().getString(R.string.transport_context_menu));
return new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (which == 0) {
Intent intent = new Intent(view.getContext(), SearchTransportActivity.class);
intent.putExtra(SearchTransportActivity.LAT_KEY, stop.getLocation().getLatitude());
intent.putExtra(SearchTransportActivity.LON_KEY, stop.getLocation().getLongitude());
view.getContext().startActivity(intent);
}
}
};
return null;
}