Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2015-08-01 22:45:50 +02:00
commit 04bee061b7
3 changed files with 13 additions and 8 deletions

View file

@ -154,6 +154,7 @@ public class ApplicationMode {
private int arrivalDistance = 90;
private int bearingIcon = R.drawable.map_pedestrian_bearing;
private int locationIcon = R.drawable.map_pedestrian_location;
private static StateChangedListener<String> listener;
private ApplicationMode(int key, String stringKey) {
this.key = key;
@ -162,14 +163,14 @@ public class ApplicationMode {
public static List<ApplicationMode> values(OsmandSettings settings) {
if (cachedFilteredValues.isEmpty()) {
if (!listenerRegistered) {
settings.AVAILABLE_APP_MODES.addListener(new StateChangedListener<String>() {
if (listener == null) {
listener = new StateChangedListener<String>() {
@Override
public void stateChanged(String change) {
cachedFilteredValues = new ArrayList<ApplicationMode>();
}
});
listenerRegistered = true;
};
settings.AVAILABLE_APP_MODES.addListener(listener);
}
String available = settings.AVAILABLE_APP_MODES.get();
cachedFilteredValues = new ArrayList<ApplicationMode>();

View file

@ -47,6 +47,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
private MapTileLayer overlayLayer;
private MapTileLayer underlayLayer;
private StateChangedListener<Integer> overlayLayerListener;
public OsmandRasterMapsPlugin(OsmandApplication app) {
this.app = app;
@ -84,13 +85,14 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
underlayLayer = new MapTileLayer(false);
// mapView.addLayer(underlayLayer, -0.5f);
overlayLayer = new MapTileLayer(false);
// mapView.addLayer(overlayLayer, 0.7f);
settings.MAP_OVERLAY_TRANSPARENCY.addListener(new StateChangedListener<Integer>() {
overlayLayerListener = new StateChangedListener<Integer>() {
@Override
public void stateChanged(Integer change) {
overlayLayer.setAlpha(change);
}
});
};
// mapView.addLayer(overlayLayer, 0.7f);
settings.MAP_OVERLAY_TRANSPARENCY.addListener(overlayLayerListener);
}
@Override

View file

@ -45,6 +45,7 @@ public class IncrementalChangesManager {
for (String month : list) {
RegionUpdate ru = regionUpdateFiles.monthUpdates.get(month);
if (ru.obfCreated < dateCreated) {
log.info("Delete overlapping month update " + ru.file.getName());
resourceManager.closeFile(ru.file.getName());
regionUpdateFiles.monthUpdates.remove(month);
ru.file.delete();
@ -60,6 +61,7 @@ public class IncrementalChangesManager {
while (it.hasNext()) {
RegionUpdate ru = it.next();
if (ru.obfCreated < dateCreated || (monthRu != null && ru.obfCreated < monthRu.obfCreated)) {
log.info("Delete overlapping day update " + ru.file.getName());
resourceManager.closeFile(ru.file.getName());
it.remove();
ru.file.delete();
@ -122,7 +124,7 @@ public class IncrementalChangesManager {
if(date.endsWith("00")) {
monthUpdates.put(monthYear, ru);
} else {
if (!dayUpdates.containsKey(date)) {
if (!dayUpdates.containsKey(monthYear)) {
dayUpdates.put(monthYear, new ArrayList<IncrementalChangesManager.RegionUpdate>());
}
dayUpdates.get(monthYear).add(ru);