forked from upstream-mirrors/OpenTracks
Added KMZ without photos, photo details to export picker.
This commit is contained in:
committed by
Dennis Guse
parent
bbb2f874ee
commit
79f5ed4dc3
@@ -67,12 +67,14 @@ public class FileTypeDialogFragment extends DialogFragment {
|
|||||||
@Override
|
@Override
|
||||||
@NonNull
|
@NonNull
|
||||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
final TrackFileFormat[] trackFileFormats = {TrackFileFormat.KMZ_WITH_TRACKDETAIL_AND_SENSORDATA_AND_PICTURES, TrackFileFormat.KML_WITH_TRACKDETAIL_AND_SENSORDATA, TrackFileFormat.GPX};
|
final TrackFileFormat[] trackFileFormats = {TrackFileFormat.KMZ_WITH_TRACKDETAIL_AND_SENSORDATA_AND_PICTURES, TrackFileFormat.KMZ_WITH_TRACKDETAIL_AND_SENSORDATA, TrackFileFormat.KML_WITH_TRACKDETAIL_AND_SENSORDATA, TrackFileFormat.GPX};
|
||||||
String[] choices = new String[trackFileFormats.length];
|
String[] choices = new String[trackFileFormats.length];
|
||||||
for (int i = 0; i < choices.length; i++) {
|
for (int i = 0; i < choices.length; i++) {
|
||||||
TrackFileFormat trackFileFormat = trackFileFormats[i];
|
TrackFileFormat trackFileFormat = trackFileFormats[i];
|
||||||
String trackFileFormatUpperCase = trackFileFormat.getExtension().toUpperCase(Locale.US); //ASCII upper case
|
String trackFileFormatUpperCase = trackFileFormat.getExtension().toUpperCase(Locale.US); //ASCII upper case
|
||||||
choices[i] = getString(optionId, trackFileFormatUpperCase);
|
int photoMessageId = trackFileFormat.includesPhotos() ? R.string.export_with_photos : R.string.export_without_photos;
|
||||||
|
String trackFileFormatDisplayName = String.format("%s (%s)", trackFileFormatUpperCase, getString(photoMessageId));
|
||||||
|
choices[i] = getString(optionId, trackFileFormatDisplayName);
|
||||||
}
|
}
|
||||||
return new AlertDialog.Builder(getActivity())
|
return new AlertDialog.Builder(getActivity())
|
||||||
.setNegativeButton(R.string.generic_cancel, new OnClickListener() {
|
.setNegativeButton(R.string.generic_cancel, new OnClickListener() {
|
||||||
|
|||||||
@@ -86,6 +86,11 @@ public enum TrackFileFormat {
|
|||||||
public String getExtension() {
|
public String getExtension() {
|
||||||
return "kmz";
|
return "kmz";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean includesPhotos() {
|
||||||
|
return exportPhotos;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
KMZ_WITH_TRACKDETAIL {
|
KMZ_WITH_TRACKDETAIL {
|
||||||
|
|
||||||
@@ -108,6 +113,12 @@ public enum TrackFileFormat {
|
|||||||
public String getExtension() {
|
public String getExtension() {
|
||||||
return "kmz";
|
return "kmz";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean includesPhotos() {
|
||||||
|
return exportPhotos;
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
KMZ_WITH_TRACKDETAIL_AND_SENSORDATA {
|
KMZ_WITH_TRACKDETAIL_AND_SENSORDATA {
|
||||||
|
|
||||||
@@ -130,6 +141,13 @@ public enum TrackFileFormat {
|
|||||||
public String getExtension() {
|
public String getExtension() {
|
||||||
return "kmz";
|
return "kmz";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean includesPhotos() {
|
||||||
|
return exportPhotos;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
KMZ_WITH_TRACKDETAIL_AND_SENSORDATA_AND_PICTURES {
|
KMZ_WITH_TRACKDETAIL_AND_SENSORDATA_AND_PICTURES {
|
||||||
|
|
||||||
@@ -152,6 +170,12 @@ public enum TrackFileFormat {
|
|||||||
public String getExtension() {
|
public String getExtension() {
|
||||||
return "kmz";
|
return "kmz";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean includesPhotos() {
|
||||||
|
return exportPhotos;
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
GPX {
|
GPX {
|
||||||
@Override
|
@Override
|
||||||
@@ -205,6 +229,11 @@ public enum TrackFileFormat {
|
|||||||
*/
|
*/
|
||||||
public abstract String getExtension();
|
public abstract String getExtension();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the format supports photos.
|
||||||
|
*/
|
||||||
|
public boolean includesPhotos() { return false; };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name of for each format.
|
* Returns the name of for each format.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -167,6 +167,8 @@ At the moment, the recorded locations as well as the timestamps are send to an A
|
|||||||
<!-- Export -->
|
<!-- Export -->
|
||||||
<string name="export_all_option">All as %1$s</string>
|
<string name="export_all_option">All as %1$s</string>
|
||||||
<string name="export_all_title">Export to external storage</string>
|
<string name="export_all_title">Export to external storage</string>
|
||||||
|
<string name="export_with_photos">with photos</string>
|
||||||
|
<string name="export_without_photos">without photos</string>
|
||||||
<string name="export_external_storage">External storage</string>
|
<string name="export_external_storage">External storage</string>
|
||||||
<string name="export_external_storage_error">Exported %1$d of %2$s to %3$s</string>
|
<string name="export_external_storage_error">Exported %1$d of %2$s to %3$s</string>
|
||||||
<string name="export_external_storage_option">as %1$s to %2$s</string>
|
<string name="export_external_storage_option">as %1$s to %2$s</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user