Merge pull request #9863 from osmandapp/Transparency_seekbar
Transparency seekbar on the map and UI are not synchronized
This commit is contained in:
commit
24bcb17339
2 changed files with 12 additions and 0 deletions
|
@ -149,6 +149,7 @@ public class RasterMapMenu {
|
||||||
@Override
|
@Override
|
||||||
public boolean onIntegerValueChangedListener(int newValue) {
|
public boolean onIntegerValueChangedListener(int newValue) {
|
||||||
mapTransparencyPreference.set(newValue);
|
mapTransparencyPreference.set(newValue);
|
||||||
|
mapActivity.getMapLayers().getMapControlsLayer().updateTransparencySlider();
|
||||||
mapActivity.getMapView().refreshMap();
|
mapActivity.getMapView().refreshMap();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1068,6 +1068,17 @@ public class MapControlsLayer extends OsmandMapLayer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateTransparencySlider () {
|
||||||
|
LayerTransparencySeekbarMode seekbarMode = settings.LAYER_TRANSPARENCY_SEEKBAR_MODE.get();
|
||||||
|
if (OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class) != null) {
|
||||||
|
if (seekbarMode == LayerTransparencySeekbarMode.OVERLAY && settings.MAP_OVERLAY.get() != null) {
|
||||||
|
transparencySlider.setValue(settings.MAP_OVERLAY_TRANSPARENCY.get());
|
||||||
|
} else if (seekbarMode == LayerTransparencySeekbarMode.UNDERLAY && settings.MAP_UNDERLAY.get() != null) {
|
||||||
|
transparencySlider.setValue(settings.MAP_TRANSPARENCY.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void showTransparencyBar(CommonPreference<Integer> transparenPreference,
|
public void showTransparencyBar(CommonPreference<Integer> transparenPreference,
|
||||||
boolean isTransparencyBarEnabled) {
|
boolean isTransparencyBarEnabled) {
|
||||||
this.isTransparencyBarEnabled = isTransparencyBarEnabled;
|
this.isTransparencyBarEnabled = isTransparencyBarEnabled;
|
||||||
|
|
Loading…
Reference in a new issue