MCPcopy Create free account
hub / github.com/Tencent/libpag / setPath

Method setPath

android/libpag/src/main/java/org/libpag/PAGView.java:236–246  ·  view source on GitHub ↗

Loads a pag file from the specified path, returns false if the file does not exist or the data is not a pag file. The path starts with "assets://" means that it is located in assets directory. Note: All PAGFiles loaded by the same path share the same internal cache. The internal cache remains alive

(String path)

Source from the content-addressed store, hash-verified

234 * instead if you don't want to load a PAGFile from the internal caches.
235 */
236 public boolean setPath(String path) {
237 PAGFile pagFile;
238 if (path != null && path.startsWith("assets://")) {
239 pagFile = PAGFile.Load(getContext().getAssets(), path.substring(9));
240 } else {
241 pagFile = PAGFile.Load(path);
242 }
243 setComposition(pagFile);
244 filePath = path;
245 return pagFile != null;
246 }
247
248 /**
249 * Asynchronously load a pag file from the specific path.

Callers 1

setPathAsyncMethod · 0.95

Calls 3

LoadMethod · 0.95
setCompositionMethod · 0.95
getContextMethod · 0.45

Tested by

no test coverage detected