icons for screen rotation mode

This commit is contained in:
sonora 2014-08-29 12:26:50 +02:00
parent 1991341f73
commit b847c0690f
11 changed files with 13 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

@ -8,6 +8,7 @@ import net.osmand.access.AccessibleToast;
import net.osmand.binary.RouteDataObject; import net.osmand.binary.RouteDataObject;
import net.osmand.plus.*; import net.osmand.plus.*;
import net.osmand.plus.OsmAndLocationProvider.GPSInfo; import net.osmand.plus.OsmAndLocationProvider.GPSInfo;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.monitoring.OsmandMonitoringPlugin; import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
import net.osmand.plus.routing.RouteDirectionInfo; import net.osmand.plus.routing.RouteDirectionInfo;
@ -283,6 +284,11 @@ public class MapInfoWidgetsFactory {
public ImageViewWidget createCompassView(final MapActivity map){ public ImageViewWidget createCompassView(final MapActivity map){
final OsmandMapTileView view = map.getMapView(); final OsmandMapTileView view = map.getMapView();
final OsmandApplication app = map.getMyApplication();
final Drawable compassNiu = map.getResources().getDrawable(R.drawable.map_compass_niu);
final Drawable compassNiuWhite = map.getResources().getDrawable(R.drawable.map_compass_niu_white);
final Drawable compassBearing = map.getResources().getDrawable(R.drawable.map_compass_bearing);
final Drawable compassBearingWhite = map.getResources().getDrawable(R.drawable.map_compass_bearing_white);
final Drawable compass = map.getResources().getDrawable(R.drawable.map_compass); final Drawable compass = map.getResources().getDrawable(R.drawable.map_compass);
final Drawable compassWhite = map.getResources().getDrawable(R.drawable.map_compass_white); final Drawable compassWhite = map.getResources().getDrawable(R.drawable.map_compass_white);
final int mw = (int) compass.getMinimumWidth() ; final int mw = (int) compass.getMinimumWidth() ;
@ -303,7 +309,13 @@ public class MapInfoWidgetsFactory {
boolean nightMode = drawSettings != null && drawSettings.isNightMode(); boolean nightMode = drawSettings != null && drawSettings.isNightMode();
if(nightMode != this.nm) { if(nightMode != this.nm) {
this.nm = nightMode; this.nm = nightMode;
setImageDrawable(nightMode ? compassWhite : compass); if (app.getSetings().ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_NONE) {
setImageDrawable(nightMode ? compassNiuWhite : compassNiu);
} else if (app.getSetings().ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING) {
setImageDrawable(nightMode ? compassBearingWhite : compassBearing);
} else {
setImageDrawable(nightMode ? compassWhite : compass);
}
return true; return true;
} }
if(view.getRotate() != cachedRotate) { if(view.getRotate() != cachedRotate) {