use of com.ichi2.anki.multimediacard.fields.TextField in project Anki-Android by Ramblurr.
the class EditFieldActivity method done.
protected void done() {
mFieldController.onDone();
Intent resultData = new Intent();
boolean bChangeToText = false;
if (mField.getType() == EFieldType.IMAGE) {
if (mField.getImagePath() == null) {
bChangeToText = true;
}
if (!bChangeToText) {
File f = new File(mField.getImagePath());
if (!f.exists()) {
bChangeToText = true;
}
}
} else if (mField.getType() == EFieldType.AUDIO) {
if (mField.getAudioPath() == null) {
bChangeToText = true;
}
if (!bChangeToText) {
File f = new File(mField.getAudioPath());
if (!f.exists()) {
bChangeToText = true;
}
}
}
if (bChangeToText) {
mField = new TextField();
mField.setText(" - ");
}
resultData.putExtra(EXTRA_RESULT_FIELD, mField);
resultData.putExtra(EXTRA_RESULT_FIELD_INDEX, mFieldIndex);
setResult(RESULT_OK, resultData);
finish();
}
Aggregations