Fix menu adapter

This commit is contained in:
Victor Shcherb 2012-05-31 19:40:05 +02:00
parent e20dbeb038
commit ffa149b460
5 changed files with 16 additions and 8 deletions

View file

@ -799,7 +799,8 @@
</groupFilter>
</group>
<!-- no polygons -->
<group>
<!-- Polygon railway -->
<filter minzoom="11" tag="railway" value="station" color="#d4aaaa">
<filter nightMode="true" color="#560000"/>
@ -860,7 +861,6 @@
</group>
<group>
<!-- Forest, night color 000034 -->
<group>
<filter minzoom="9" color="#aed1a0" tag="natural" value="wood"/>
@ -872,7 +872,6 @@
<group>
<filter noPolygons="true" tag="natural" value="land" color="#00ffffff"/>
<filter nightMode="true" tag="natural" value="land" color="#003333"/>
<filter tag="natural" value="land" color="#f1eae4"/>
</group>

View file

@ -62,7 +62,7 @@ public class ContextMenuAdapter {
itemNames.add(pos, ctx.getString(stringResId));
selectedList.insert(pos, selected);
iconList.insert(pos, icon);
listeners.add(listener);
listeners.add(pos, listener);
}
public void registerSelectedItem(int stringResId, int selected, int icon) {

View file

@ -68,6 +68,10 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
}
@Override
public void registerLayers(MapActivity activity) {
createLayers();
}
private void createLayers() {
underlayLayer = new MapTileLayer(false);
// mapView.addLayer(underlayLayer, -0.5f);
overlayLayer = new MapTileLayer(false);
@ -82,6 +86,9 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
public void updateMapLayers(OsmandMapTileView mapView, CommonPreference<String> settingsToWarnAboutMap,
final MapActivityLayers layers) {
if(overlayLayer == null) {
createLayers();
}
overlayLayer.setAlpha(settings.MAP_OVERLAY_TRANSPARENCY.get());
updateLayer(mapView, settings, overlayLayer, settings.MAP_OVERLAY, 0.7f, settings.MAP_OVERLAY == settingsToWarnAboutMap);
updateLayer(mapView, settings, underlayLayer, settings.MAP_UNDERLAY, -0.5f, settings.MAP_UNDERLAY == settingsToWarnAboutMap);

View file

@ -50,6 +50,7 @@ import org.apache.commons.logging.Log;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Bitmap.Config;
import android.graphics.RectF;
import android.os.Handler;
@ -569,11 +570,11 @@ public class MapRenderRepositories {
if (rr != null) {
transparent = renderingReq.getIntPropertyValue(rr) > 0;
}
if(transparent) {
bmp = Bitmap.createBitmap(currentRenderingContext.width, currentRenderingContext.height, Config.ARGB_8888);
} else {
// if(transparent) {
// bmp = Bitmap.createBitmap(currentRenderingContext.width, currentRenderingContext.height, Config.ARGB_8888);
// } else {
bmp = Bitmap.createBitmap(currentRenderingContext.width, currentRenderingContext.height, Config.RGB_565);
}
// }
// 1. generate image step by step
this.prevBmp = this.bmp;

View file

@ -178,6 +178,7 @@ public class TurnPathHelper {
float prev = 90;
float init = 90;
float step = sweepAngle / out;
boolean leftSide = turnType.isLeftSide();
for (int i = 1; i <= out; i++) {
float to = step * i;
if (i == out) {