use of org.odk.collect.android.logic.FormController in project collect by opendatakit.
the class QuestionWidget method isWaitingForData.
@Override
public final boolean isWaitingForData() {
Collect collect = Collect.getInstance();
if (collect == null) {
throw new IllegalStateException("Collect application instance is null.");
}
FormController formController = collect.getFormController();
if (formController == null) {
return false;
}
FormIndex index = getFormEntryPrompt().getIndex();
return index.equals(formController.getIndexWaitingForData());
}
use of org.odk.collect.android.logic.FormController in project collect by opendatakit.
the class QuestionWidget method waitForData.
// region Data waiting
@Override
public final void waitForData() {
Collect collect = Collect.getInstance();
if (collect == null) {
throw new IllegalStateException("Collect application instance is null.");
}
FormController formController = collect.getFormController();
if (formController == null) {
return;
}
formController.setIndexWaitingForData(getFormEntryPrompt().getIndex());
}
use of org.odk.collect.android.logic.FormController in project collect by opendatakit.
the class QuestionWidget method cancelWaitingForData.
@Override
public final void cancelWaitingForData() {
Collect collect = Collect.getInstance();
if (collect == null) {
throw new IllegalStateException("Collect application instance is null.");
}
FormController formController = collect.getFormController();
if (formController == null) {
return;
}
formController.setIndexWaitingForData(null);
}
use of org.odk.collect.android.logic.FormController in project collect by opendatakit.
the class QuestionWidget method getInstanceFolder.
// region Accessors
@Nullable
public final String getInstanceFolder() {
Collect collect = Collect.getInstance();
if (collect == null) {
throw new IllegalStateException("Collect application instance is null.");
}
FormController formController = collect.getFormController();
if (formController == null) {
return null;
}
return formController.getInstanceFile().getParent();
}
use of org.odk.collect.android.logic.FormController in project collect by opendatakit.
the class SaveFormIndexTask method doInBackground.
@Override
protected String doInBackground(Void... params) {
long start = System.currentTimeMillis();
FormController formController = Collect.getInstance().getFormController();
try {
File tempFormIndexFile = SaveToDiskTask.getFormIndexFile(formController.getInstanceFile().getName());
exportFormIndexToFile(formIndex, tempFormIndexFile);
long end = System.currentTimeMillis();
Timber.i("SaveFormIndex ms: %s to %s", Long.toString(end - start), tempFormIndexFile.toString());
return null;
} catch (Exception e) {
String msg = e.getMessage();
Timber.e(e);
return msg;
}
}
Aggregations