Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2014-08-29 14:32:28 +02:00
commit eab84e28fb

View file

@ -295,6 +295,7 @@ public class MapInfoWidgetsFactory {
final int mh = (int) compass.getMinimumHeight() ;
ImageViewWidget compassView = new ImageViewWidget(map) {
private float cachedRotate = 0;
private int cachedRotateMap = 0;
private boolean nm;
@Override
protected void onDraw(Canvas canvas) {
@ -323,6 +324,17 @@ public class MapInfoWidgetsFactory {
invalidate();
return true;
}
if(app.getSettings().ROTATE_MAP.get() != cachedRotateMap) {
cachedRotateMap = app.getSettings().ROTATE_MAP.get();
if (app.getSettings().ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_NONE) {
setImageDrawable(drawSettings.isNightMode() ? compassNiuWhite : compassNiu);
} else if (app.getSettings().ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING) {
setImageDrawable(drawSettings.isNightMode() ? compassBearingWhite : compassBearing);
} else {
setImageDrawable(drawSettings.isNightMode() ? compassWhite : compass);
}
return true;
}
return false;
}
};