fix string assignment

This commit is contained in:
sonora 2016-02-12 16:51:28 +01:00
parent df12c29f62
commit 5dc376e891

View file

@ -38,16 +38,19 @@ public class RasterMapMenu {
final OsmandSettings.CommonPreference<Integer> mapTransparencyPreference;
final OsmandSettings.CommonPreference<String> mapTypePreference;
@StringRes final int mapTypeString;
@StringRes final int mapTypeStringTransparency;
if (type == OsmandRasterMapsPlugin.RasterMapType.OVERLAY) {
rasterMapLayer = plugin.getOverlayLayer();
mapTransparencyPreference = settings.MAP_OVERLAY_TRANSPARENCY;
mapTypePreference = settings.MAP_OVERLAY;
mapTypeString = R.string.map_overlay;
mapTypeString = R.string.overlay_transparency;
} else if (type == OsmandRasterMapsPlugin.RasterMapType.UNDERLAY){
rasterMapLayer = plugin.getUnderlayLayer();
mapTransparencyPreference = settings.MAP_TRANSPARENCY;
mapTypePreference = settings.MAP_UNDERLAY;
mapTypeString = R.string.map_underlay;
mapTypeString = R.string.map_transparency;
} else {
throw new RuntimeException("Unexpected raster map type");
}
@ -97,8 +100,7 @@ public class RasterMapMenu {
}
};
// android:max="255" in layout is expected
// FIXME: For case of "Overlay menu" string needs to display overlay_transparency, for case of "Underlay menu" string needs to be map_transparency, as this then modifies the base map transparency, of course!
contextMenuAdapter.item(R.string.map_transparency).layout(R.layout.progress_list_item)
contextMenuAdapter.item(mapTypeStringTransparency).layout(R.layout.progress_list_item)
.progress(mapTransparencyPreference.get()).listenInteger(integerListener).reg();
contextMenuAdapter.item(mapTypeString).layout(R.layout.two_line_list_item).description(mapTypePreference.get()).reg();
contextMenuAdapter.item(R.string.show_polygons).listen(l).selected(hidePolygonsPref.get() ? 0 : 1).reg();