forked from upstream-mirrors/OpenTracks
Code cleanup: use trackFileFormat.getExtension
This commit is contained in:
@@ -33,8 +33,6 @@ import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.RadioGroup.OnCheckedChangeListener;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* A DialogFragment to export a track.
|
||||
*
|
||||
@@ -172,9 +170,8 @@ public class ExportDialogFragment extends DialogFragment {
|
||||
* @param trackFileFormat the track file format
|
||||
*/
|
||||
private void setExternalStorageOption(RadioButton radioButton, TrackFileFormat trackFileFormat) {
|
||||
String format = trackFileFormat.name();
|
||||
radioButton.setText(getString(R.string.export_external_storage_option, format,
|
||||
FileUtils.getDisplayDirectory(format.toLowerCase(Locale.US))));
|
||||
radioButton.setText(getString(R.string.export_external_storage_option, trackFileFormat.name(),
|
||||
FileUtils.getDisplayDirectory(trackFileFormat.getExtension())));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,8 +28,6 @@ import android.content.DialogInterface.OnClickListener;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* A DialogFragment to select a file type, gpx, kml, etc.
|
||||
*
|
||||
@@ -92,9 +90,9 @@ public class FileTypeDialogFragment extends DialogFragment {
|
||||
String[] choices = new String[size];
|
||||
TrackFileFormat[] trackFileFormats = TrackFileFormat.values();
|
||||
for (int i = 0; i < choices.length; i++) {
|
||||
String format = trackFileFormats[i].name();
|
||||
choices[i] = getString(
|
||||
optionId, format, FileUtils.getDisplayDirectory(format.toLowerCase(Locale.US)));
|
||||
TrackFileFormat trackFileFormat = trackFileFormats[i];
|
||||
choices[i] = getString(optionId, trackFileFormat.name(),
|
||||
FileUtils.getDisplayDirectory(trackFileFormat.getExtension()));
|
||||
}
|
||||
return new AlertDialog.Builder(getActivity()).setNegativeButton(R.string.generic_cancel, null)
|
||||
.setPositiveButton(R.string.generic_ok, new OnClickListener() {
|
||||
|
||||
Reference in New Issue
Block a user