Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-03-22 07:29:13 +01:00
commit 3c663b8561
4 changed files with 16 additions and 5 deletions

View file

@ -1217,6 +1217,7 @@ public class OsmandSettings {
// this value string is synchronized with settings_pref.xml preference name
public static final int CENTER_CONSTANT = 0;
public static final int BOTTOM_CONSTANT = 1;
public static final int MIDDLE_CONSTANT = 2;
public final CommonPreference<Boolean> CENTER_POSITION_ON_MAP = new BooleanPreference("center_position_on_map", false).makeProfile();
// this value string is synchronized with settings_pref.xml preference name

View file

@ -4,6 +4,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
@ -34,6 +35,8 @@ public class NavAutoZoomMapAction extends QuickAction {
settings.AUTO_ZOOM_MAP_PREV.set(settings.AUTO_ZOOM_MAP.get());
settings.AUTO_ZOOM_MAP.set(AutoZoomMap.NONE);
}
Toast.makeText(activity, activity.getString(settings.AUTO_ZOOM_MAP.get() == AutoZoomMap.NONE
? R.string.quick_action_auto_zoom_off : R.string.quick_action_auto_zoom_on), Toast.LENGTH_SHORT).show();
}
@Override

View file

@ -198,18 +198,18 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
private void enterMovingMode(RotatedTileBox tileBox) {
previousMapPosition = view.getMapPosition();
view.setMapPosition(OsmandSettings.BOTTOM_CONSTANT);
view.setMapPosition(OsmandSettings.MIDDLE_CONSTANT);
MapContextMenu menu = mapActivity.getContextMenu();
LatLon ll = menu.isActive() && tileBox.containsLatLon(menu.getLatLon()) ? menu.getLatLon() : tileBox.getCenterLatLon();
Boolean isFollowPoint = isFolowPoint(tileBox, menu);
LatLon ll = menu.isActive() && tileBox.containsLatLon(menu.getLatLon()) ? menu.getLatLon() : tileBox.getCenterLatLon();
boolean isFollowPoint = isFolowPoint(tileBox, menu);
menu.updateMapCenter(null);
menu.close();
RotatedTileBox rb = new RotatedTileBox(tileBox);
if (!isFollowPoint && previousMapPosition != OsmandSettings.BOTTOM_CONSTANT)
rb.setCenterLocation(0.5f, 0.15f);
rb.setCenterLocation(0.5f, 0.3f);
rb.setLatLonCenter(ll.getLatitude(), ll.getLongitude());
double lat = rb.getLatFromPixel(tileBox.getCenterPixelX(), tileBox.getCenterPixelY());

View file

@ -513,7 +513,14 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
if (view == null) {
return;
}
final float ratioy = mapPosition == OsmandSettings.BOTTOM_CONSTANT ? 0.85f : 0.5f;
final float ratioy;
if (mapPosition == OsmandSettings.BOTTOM_CONSTANT) {
ratioy = 0.85f;
} else if (mapPosition == OsmandSettings.MIDDLE_CONSTANT) {
ratioy = 0.70f;
} else {
ratioy = 0.5f;
}
final float ratiox = mapPositionX == 0 ? 0.5f : 0.75f;
final int cy = (int) (ratioy * view.getHeight());
final int cx = (int) (ratiox * view.getWidth());