use of com.ichi2.libanki.TemplateManager.TemplateRenderContext.TemplateRenderOutput in project Anki-Android by ankidroid.
the class Collection method render_output_legacy.
@NonNull
@RustCleanup("Hack for Card Template Previewer, needs review")
public TemplateRenderOutput render_output_legacy(@NonNull Card c, boolean reload, boolean browser) {
Note f = c.note(reload);
Model m = c.model();
JSONObject t = c.template();
long did;
if (c.isInDynamicDeck()) {
did = c.getODid();
} else {
did = c.getDid();
}
HashMap<String, String> qa;
if (browser) {
String bqfmt = t.getString("bqfmt");
String bafmt = t.getString("bafmt");
qa = _renderQA(c.getId(), m, did, c.getOrd(), f.stringTags(), f.getFields(), c.internalGetFlags(), browser, bqfmt, bafmt);
} else {
qa = _renderQA(c.getId(), m, did, c.getOrd(), f.stringTags(), f.getFields(), c.internalGetFlags());
}
return new TemplateRenderOutput(qa.get("q"), qa.get("a"), null, null, c.model().getString("css"));
}
Aggregations