proper compass icon update upon rotation mode change
This commit is contained in:
parent
64da6b408e
commit
341792b0db
1 changed files with 12 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue