Interface Class Name | Description |
TAVEditor | SDK operation entry class. |
TAVTemplateConfig | Template configuration class. |
Method | Parameters | Return Value | Description |
setTemplateDir(String path) | path: absolute path to the template directory. | int0: Success -1: Invalid path -2: Invalid authorization | Set the template working directory. |
getTemplateDir() | - | String | Get the current template directory. |
getTemplateConfig(String templatePath) | templatePath: template path. | TAVTemplateConfig | Get the template configuration information. |
/*** Set template path** @param path Absolute path to the template directory* @return Operation result code:* 0: Success* -1: Invalid path* -2: Invalid authorization*/int setTemplateDir(String path);
/*** Get the currently set template path** @return Absolute path to the template directory*/String getTemplateDir();
/*** Get template slot information** @param templatePath Template path* @return Template configuration object containing slot information*/TAVTemplateConfig getTemplateConfig(String templatePath);
TAVTemplateConfig class contains the following key information:// Set template pathint result = editor.setTemplateDir("/sdcard/templates/project1");if (result == 0) {// Get template pathString templateDir = editor.getTemplateDir();// Get template configurationTAVTemplateConfig config = editor.getTemplateConfig(templateDir);// Use configuration infoList<TAVTemplateSlot> slots = config.getSlots();for (TAVTemplateSlot slot : slots) {// Process each slot}} else {// Handle errorswitch (result) {case -1:Log.e("Template", "Invalid template path");break;case -2:Log.e("Template", "Invalid template authorization");break;}}
Error Code | Meaning | Solution |
-1 | Invalid path | Check whether the path exists and has read permission. |
-2 | Invalid authorization | Check whether the template authorization file is valid. |
フィードバック