pr fixes
This commit is contained in:
parent
b4c61ae254
commit
4097cb587d
2 changed files with 3 additions and 13 deletions
|
@ -22,6 +22,7 @@ import android.support.v7.widget.ListPopupWindow;
|
||||||
import android.support.v7.widget.SwitchCompat;
|
import android.support.v7.widget.SwitchCompat;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.text.style.StyleSpan;
|
import android.text.style.StyleSpan;
|
||||||
|
import android.util.Log;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -958,6 +959,7 @@ public class GpxUiHelper {
|
||||||
final File f = new File(dir, fname);
|
final File f = new File(dir, fname);
|
||||||
GPXFile res = GPXUtilities.loadGPXFile(f);
|
GPXFile res = GPXUtilities.loadGPXFile(f);
|
||||||
if (res.error != null && res.error.getMessage().length() > 0) {
|
if (res.error != null && res.error.getMessage().length() > 0) {
|
||||||
|
Log.d("GpxUiHelper", res.error.getMessage() + "\n");
|
||||||
w += res.error.getMessage() + "\n";
|
w += res.error.getMessage() + "\n";
|
||||||
}
|
}
|
||||||
result[k++] = res;
|
result[k++] = res;
|
||||||
|
|
|
@ -40,22 +40,10 @@ public class ShowHideGpxTracksAction extends QuickAction {
|
||||||
} else {
|
} else {
|
||||||
selectedGpxHelper.restoreSelectedGpxFiles();
|
selectedGpxHelper.restoreSelectedGpxFiles();
|
||||||
|
|
||||||
final OsmandSettings setting = activity.getMyApplication().getSettings();
|
|
||||||
final File dir = activity.getMyApplication().getAppPath(IndexConstants.GPX_INDEX_DIR);
|
final File dir = activity.getMyApplication().getAppPath(IndexConstants.GPX_INDEX_DIR);
|
||||||
CallbackWithObject<GPXFile[]> callbackWithObject = new CallbackWithObject<GPXFile[]>() {
|
CallbackWithObject<GPXFile[]> callbackWithObject = new CallbackWithObject<GPXFile[]>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean processResult(GPXFile[] result) {
|
public boolean processResult(GPXFile[] result) {
|
||||||
for (GPXFile g : result) {
|
|
||||||
if (g.showCurrentTrack) {
|
|
||||||
if (!setting.SAVE_TRACK_TO_GPX.get()
|
|
||||||
&& !setting.SAVE_GLOBAL_TRACK_TO_GPX.get()) {
|
|
||||||
Toast.makeText(activity,
|
|
||||||
R.string.gpx_monitoring_disabled_warn, Toast.LENGTH_LONG)
|
|
||||||
.show();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -64,7 +52,7 @@ public class ShowHideGpxTracksAction extends QuickAction {
|
||||||
.getSelectedGPXFiles();
|
.getSelectedGPXFiles();
|
||||||
List<String> files = new ArrayList<>();
|
List<String> files = new ArrayList<>();
|
||||||
for (GpxSelectionHelper.SelectedGpxFile file : selectedGpxFiles) {
|
for (GpxSelectionHelper.SelectedGpxFile file : selectedGpxFiles) {
|
||||||
files.add(file.getGpxFile().path);
|
files.add(file.getGpxFile().path.substring(file.getGpxFile().path.lastIndexOf("/")));
|
||||||
}
|
}
|
||||||
|
|
||||||
GpxUiHelper.loadFileInDifferentThread(activity, callbackWithObject, dir,
|
GpxUiHelper.loadFileInDifferentThread(activity, callbackWithObject, dir,
|
||||||
|
|
Loading…
Reference in a new issue