Fix for xxhdpi devices with density>=3, zoom magnifier didn't work as expected
This commit is contained in:
parent
3c1104b1d0
commit
8f69f6f55d
3 changed files with 8 additions and 8 deletions
|
@ -651,7 +651,7 @@ public class OsmandSettings {
|
|||
|
||||
public float getSettingsZoomScale(float density){
|
||||
// by default scale between [0, 1[ density (because of lots map complains)
|
||||
return MAP_ZOOM_SCALE_BY_DENSITY.get() + (float)Math.min(Math.sqrt(Math.max(0, density - 1)), 1);
|
||||
return MAP_ZOOM_SCALE_BY_DENSITY.get() + (float)Math.sqrt(Math.max(0, density - 1));
|
||||
}
|
||||
|
||||
|
||||
|
@ -993,7 +993,10 @@ public class OsmandSettings {
|
|||
public static final String EXTERNAL_STORAGE_DIR = "external_storage_dir"; //$NON-NLS-1$
|
||||
|
||||
public File getExternalStorageDirectory() {
|
||||
String defaultLocation = getDefaultExternalStorageLocation();
|
||||
String defaultLocation = ctx.getExternalServiceAPI().getExternalStorageDirectory();
|
||||
if(Build.VERSION.SDK_INT >= VERSION_DEFAULTLOCATION_CHANGED && !new File(defaultLocation, IndexConstants.APP_DIR).exists()) {
|
||||
defaultLocation += "/Android/data/" + ctx.getPackageName();
|
||||
}
|
||||
return new File(settingsAPI.getString(globalPreferences, EXTERNAL_STORAGE_DIR,
|
||||
defaultLocation));
|
||||
}
|
||||
|
|
|
@ -4,30 +4,27 @@ package net.osmand.plus.activities;
|
|||
import java.io.File;
|
||||
import java.util.Date;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.widget.ScrollView;
|
||||
import net.osmand.IndexConstants;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.Version;
|
||||
import net.osmand.plus.rastermaps.SettingsRasterMapsActivity;
|
||||
import net.osmand.util.Algorithms;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.AlertDialog.Builder;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.preference.Preference;
|
||||
import android.preference.PreferenceScreen;
|
||||
import android.preference.Preference.OnPreferenceClickListener;
|
||||
import android.text.SpannableString;
|
||||
import android.text.format.DateFormat;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.ClickableSpan;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class SettingsActivity extends SettingsBaseActivity {
|
||||
|
|
|
@ -393,7 +393,7 @@ public class MapControlsLayer extends OsmandMapLayer {
|
|||
final AlertDialog.Builder bld = new AlertDialog.Builder(view.getContext());
|
||||
float scale = view.getZoomScale();
|
||||
int p = (int) ((scale > 0 ? 1 : -1) * Math.round(scale * scale * 100)) + 100;
|
||||
final TIntArrayList tlist = new TIntArrayList(new int[] { 75, 100, 150, 200, 300, 400 });
|
||||
final TIntArrayList tlist = new TIntArrayList(new int[] { 75, 100, 150, 200, 300, 400, 500 });
|
||||
final List<String> values = new ArrayList<String>();
|
||||
int i = -1;
|
||||
for (int k = 0; k <= tlist.size(); k++) {
|
||||
|
|
Loading…
Reference in a new issue