FIxed bug with wrong directory for app customization
This commit is contained in:
parent
361e7ffd65
commit
fcec2c20f3
3 changed files with 16 additions and 2 deletions
|
@ -178,4 +178,8 @@ public class OsmAndAppCustomization {
|
||||||
public int getWaypointSearchRadius(int searchDeviationRadius, int type) {
|
public int getWaypointSearchRadius(int searchDeviationRadius, int type) {
|
||||||
return searchDeviationRadius;
|
return searchDeviationRadius;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public File getExternalStorageDir() {
|
||||||
|
return osmandSettings.getExternalStorageDirectory();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -750,7 +750,8 @@ public class OsmandApplication extends Application {
|
||||||
if(path == null) {
|
if(path == null) {
|
||||||
path = "";
|
path = "";
|
||||||
}
|
}
|
||||||
return new File(getSettings().getExternalStorageDirectory(), IndexConstants.APP_DIR + path);
|
|
||||||
|
return new File(getAppCustomization().getExternalStorageDir(), IndexConstants.APP_DIR + path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void applyTheme(Context c) {
|
public void applyTheme(Context c) {
|
||||||
|
|
|
@ -10,6 +10,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
|
|
||||||
|
import android.os.Environment;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import net.osmand.IProgress;
|
import net.osmand.IProgress;
|
||||||
import net.osmand.IndexConstants;
|
import net.osmand.IndexConstants;
|
||||||
|
@ -79,7 +80,7 @@ public class SherpafyCustomization extends OsmAndAppCustomization {
|
||||||
private CommonPreference<String> saveGPXFolder;
|
private CommonPreference<String> saveGPXFolder;
|
||||||
public static final String TOUR_SERVER = "download.osmand.net";
|
public static final String TOUR_SERVER = "download.osmand.net";
|
||||||
private static final String SAVE_GPX_FOLDER = "save_gpx_folder";
|
private static final String SAVE_GPX_FOLDER = "save_gpx_folder";
|
||||||
private Object originalGlobal;
|
private Object originalGlobal;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setup(OsmandApplication app) {
|
public void setup(OsmandApplication app) {
|
||||||
|
@ -92,6 +93,14 @@ public class SherpafyCustomization extends OsmAndAppCustomization {
|
||||||
}
|
}
|
||||||
accessCodePref = osmandSettings.registerStringPreference(ACCESS_CODE, "").makeGlobal();
|
accessCodePref = osmandSettings.registerStringPreference(ACCESS_CODE, "").makeGlobal();
|
||||||
toursFolder = new File(osmandSettings.getExternalStorageDirectory(), "osmand/tours");
|
toursFolder = new File(osmandSettings.getExternalStorageDirectory(), "osmand/tours");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public File getExternalStorageDir() {
|
||||||
|
final String defaultLocation = Environment.getExternalStorageDirectory().getAbsolutePath();
|
||||||
|
return new File(originalApi.getString(originalGlobal, OsmandSettings.EXTERNAL_STORAGE_DIR,
|
||||||
|
defaultLocation));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean setAccessCode(String acCode) {
|
public boolean setAccessCode(String acCode) {
|
||||||
|
|
Loading…
Reference in a new issue