Added KMZ without photos, photo details to export picker.

This commit is contained in:
Nathan Hearnsberger
2020-01-06 22:00:41 -05:00
committed by Dennis Guse
parent bbb2f874ee
commit 79f5ed4dc3
3 changed files with 35 additions and 2 deletions
@@ -67,12 +67,14 @@ public class FileTypeDialogFragment extends DialogFragment {
@Override
@NonNull
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];
for (int i = 0; i < choices.length; i++) {
TrackFileFormat trackFileFormat = trackFileFormats[i];
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())
.setNegativeButton(R.string.generic_cancel, new OnClickListener() {
@@ -86,6 +86,11 @@ public enum TrackFileFormat {
public String getExtension() {
return "kmz";
}
@Override
public boolean includesPhotos() {
return exportPhotos;
}
},
KMZ_WITH_TRACKDETAIL {
@@ -108,6 +113,12 @@ public enum TrackFileFormat {
public String getExtension() {
return "kmz";
}
@Override
public boolean includesPhotos() {
return exportPhotos;
}
},
KMZ_WITH_TRACKDETAIL_AND_SENSORDATA {
@@ -130,6 +141,13 @@ public enum TrackFileFormat {
public String getExtension() {
return "kmz";
}
@Override
public boolean includesPhotos() {
return exportPhotos;
}
},
KMZ_WITH_TRACKDETAIL_AND_SENSORDATA_AND_PICTURES {
@@ -152,6 +170,12 @@ public enum TrackFileFormat {
public String getExtension() {
return "kmz";
}
@Override
public boolean includesPhotos() {
return exportPhotos;
}
},
GPX {
@Override
@@ -205,6 +229,11 @@ public enum TrackFileFormat {
*/
public abstract String getExtension();
/**
* Returns whether the format supports photos.
*/
public boolean includesPhotos() { return false; };
/**
* Returns the name of for each format.
*/
+2
View File
@@ -167,6 +167,8 @@ At the moment, the recorded locations as well as the timestamps are send to an A
<!-- Export -->
<string name="export_all_option">All as %1$s</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_error">Exported %1$d of %2$s to %3$s</string>
<string name="export_external_storage_option">as %1$s to %2$s</string>