use of com.ichi2.anki.multimediacard.fields.AudioField in project Anki-Android by Ramblurr.
the class NoteService method updateMultimediaNoteFromJsonNote.
public static void updateMultimediaNoteFromJsonNote(final Note editorNoteSrc, final IMultimediaEditableNote noteDst) {
if (noteDst instanceof MultimediaEditableNote) {
MultimediaEditableNote mmNote = (MultimediaEditableNote) noteDst;
String[] values = editorNoteSrc.getFields();
for (int i = 0; i < values.length; i++) {
String value = values[i];
IField field = null;
if (value.startsWith("<img")) {
field = new ImageField();
} else if (value.startsWith("[sound:")) {
field = new AudioField();
} else {
field = new TextField();
}
field.setFormattedString(value);
mmNote.setField(i, field);
}
mmNote.setModelId(editorNoteSrc.getMid());
// TODO: set current id of the note as well
}
}
use of com.ichi2.anki.multimediacard.fields.AudioField in project Anki-Android by Ramblurr.
the class EditFieldActivity method toAudioField.
protected void toAudioField() {
if (mField.getType() != EFieldType.AUDIO) {
mField = new AudioField();
recreateEditingUi();
}
}
Aggregations