and issue zoom buttons

git-svn-id: https://osmand.googlecode.com/svn/trunk@564 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
Victor Shcherb 2010-10-13 21:09:55 +00:00
parent d70329b368
commit 565e6659b3
4 changed files with 28 additions and 19 deletions

View file

@ -1,7 +1,5 @@
package net.osmand.osm.io;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.text.DateFormat;
@ -19,7 +17,6 @@ import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import net.osmand.IProgress;
import net.osmand.impl.ConsoleProgressImplementation;
import net.osmand.osm.Entity;
import net.osmand.osm.EntityInfo;
import net.osmand.osm.Node;
@ -27,7 +24,6 @@ import net.osmand.osm.Relation;
import net.osmand.osm.Way;
import net.osmand.osm.Entity.EntityId;
import net.osmand.osm.Entity.EntityType;
import net.osmand.osm.OSMSettings.OSMTagKey;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;

View file

@ -9,15 +9,21 @@
<net.osmand.views.OsmZoomControls android:id="@+id/ZoomControls"
android:layout_marginRight="3dp" android:layout_marginBottom="2dp"
android:layout_width="100dp" android:layout_height="wrap_content" android:layout_gravity="bottom|right"/>
android:layout_width="120dp" android:layout_height="wrap_content" android:layout_gravity="bottom|right"/>
<ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|left" android:id="@+id/BackToMenu" android:background="@drawable/back_menu"></ImageButton>
<ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="top|right" android:layout_marginTop="64dp" android:id="@+id/BackToLocation" android:background="@drawable/back_location"></ImageButton>
<LinearLayout android:layout_width="wrap_content" android:id="@+id/RouteLayout" android:orientation="horizontal" android:layout_height="wrap_content" android:layout_gravity="bottom|center" android:layout_marginBottom="12dp">
<Button android:layout_width="wrap_content" android:id="@+id/PreviousButton" android:layout_height="wrap_content" android:background="@android:drawable/ic_media_previous"/>
<Button android:layout_width="wrap_content" android:id="@+id/InfoButton" android:layout_height="wrap_content" android:background="@android:drawable/ic_dialog_info" android:layout_marginLeft="8dp"/>
<Button android:layout_width="wrap_content" android:id="@+id/NextButton" android:layout_height="wrap_content" android:background="@android:drawable/ic_media_next" android:layout_marginLeft="8dp" android:layout_marginRight="15dp"/>
<ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|left" android:id="@+id/BackToMenu" android:background="@drawable/back_menu"/>
<LinearLayout android:layout_width="wrap_content" android:id="@+id/RouteLayout" android:orientation="horizontal" android:layout_height="wrap_content"
android:layout_marginBottom="12dp" android:layout_gravity="bottom|center" >
<Button android:layout_width="wrap_content" android:id="@+id/PreviousButton" android:layout_height="wrap_content" android:background="@android:drawable/ic_media_previous"
/>
<Button android:layout_width="wrap_content" android:id="@+id/InfoButton" android:layout_height="wrap_content" android:background="@android:drawable/ic_dialog_info"
android:layout_marginLeft="8dp"/>
<Button android:layout_width="wrap_content" android:id="@+id/NextButton" android:layout_height="wrap_content" android:background="@android:drawable/ic_media_next"
android:layout_marginLeft="8dp" android:layout_marginRight="55dp" />
</LinearLayout>
</FrameLayout>

View file

@ -1432,11 +1432,9 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso
list.add(getString(R.string.any_poi));
final PoiFiltersHelper poiFilters = ((OsmandApplication)getApplication()).getPoiFilters();
for(PoiFilter f : poiFilters.getUserDefinedPoiFilters()){
if (!f.getFilterId().equals(PoiFilter.CUSTOM_FILTER_ID)) {
userDefined.add(f);
list.add(f.getName());
}
for (PoiFilter f : poiFilters.getUserDefinedPoiFilters()) {
userDefined.add(f);
list.add(f.getName());
}
for(AmenityType t : AmenityType.values()){
list.add(AmenityType.toPublicString(t));
@ -1454,9 +1452,17 @@ public class MapActivity extends Activity implements IMapLocationListener, Senso
} else {
filterId = PoiFiltersHelper.getOsmDefinedFilterId(AmenityType.values()[which - userDefined.size() - 1]);
}
OsmandSettings.setPoiFilterForMap(MapActivity.this, filterId);
poiMapLayer.setFilter(poiFilters.getFilterById(filterId));
mapView.refreshMap();
if(filterId.equals(PoiFilter.CUSTOM_FILTER_ID)){
Intent newIntent = new Intent(MapActivity.this, EditPOIFilterActivity.class);
newIntent.putExtra(EditPOIFilterActivity.AMENITY_FILTER, filterId);
newIntent.putExtra(EditPOIFilterActivity.SEARCH_LAT, mapView.getLatitude());
newIntent.putExtra(EditPOIFilterActivity.SEARCH_LON, mapView.getLongitude());
startActivity(newIntent);
} else {
OsmandSettings.setPoiFilterForMap(MapActivity.this, filterId);
poiMapLayer.setFilter(poiFilters.getFilterById(filterId));
mapView.refreshMap();
}
}
});

View file

@ -164,11 +164,12 @@ public class RouteInfoLayer implements OsmandMapLayer, IRouteInformationListener
textBorder = new RectF(-2, -1, textSize + 2, 0);
}
public final int shiftCenter = 55;
@Override
public void onDraw(Canvas canvas, RectF latLonBounds) {
if(isVisible()){
border.set(layout.getLeft() - 10 * dm.density, layout.getTop() - 4 * dm.density,
layout.getRight() - 5 * dm.density, layout.getBottom() + 4 * dm.density);
layout.getRight() - (shiftCenter - 5) * dm.density, layout.getBottom() + 4 * dm.density);
canvas.drawRoundRect(border, 5 * dm.density, 5 * dm.density, paintBorder);
canvas.drawRoundRect(border, 5 * dm.density, 5 * dm.density, paintBlack);
List<RouteDirectionInfo> dir = routingHelper.getRouteDirections();