diff --git a/gpslogger/src/main/java/com/mendhak/gpslogger/ui/fragments/display/GenericViewFragment.java b/gpslogger/src/main/java/com/mendhak/gpslogger/ui/fragments/display/GenericViewFragment.java index cedbc0e4c..ff6f8c223 100644 --- a/gpslogger/src/main/java/com/mendhak/gpslogger/ui/fragments/display/GenericViewFragment.java +++ b/gpslogger/src/main/java/com/mendhak/gpslogger/ui/fragments/display/GenericViewFragment.java @@ -37,9 +37,15 @@ import com.mendhak.gpslogger.ui.Dialogs; import de.greenrobot.event.EventBus; import eltos.simpledialogfragment.SimpleDialog; +import eltos.simpledialogfragment.form.Hint; +import eltos.simpledialogfragment.form.Input; +import eltos.simpledialogfragment.form.SimpleFormDialog; import org.slf4j.Logger; +import java.util.ArrayList; +import java.util.List; + /** * Common class for communicating with the parent for the @@ -108,7 +114,22 @@ public void requestToggleLogging() { if (preferenceHelper.shouldCreateCustomFile() && preferenceHelper.shouldAskCustomFileNameEachTime()) { - Dialogs.autoSuggestDialog( (FragmentActivity) getActivity(),"customfilename", getString(R.string.new_file_custom_title), "", preferenceHelper.getCustomFileName()); + //Result handled in GPSMainactivity onResult. + //Dialogs.autoSuggestDialog( (FragmentActivity) getActivity(),"customfilename", getString(R.string.new_file_custom_title), "", preferenceHelper.getCustomFileName()); + + final List cachedList = Files.getListFromCacheFile("customfilename", getActivity()); + + SimpleFormDialog.build() + .fields( + Hint.plain(R.string.new_file_custom_title), + Hint.plain(R.string.new_file_custom_message), + Input.plain("customfilename") + .suggest(new ArrayList<>(cachedList)) + .text(preferenceHelper.getCustomFileName()) + + ) + //.title(getString(R.string.new_file_custom_title)) + .show(getActivity(), "customfilename"); } else { if(!session.isStarted()){