How to use PagView:
1. Import the aar package
dependecies{
complie(name:libpag_4.2.17,ext:'aar')
}
2. Create a PagPlayer, set the data source (PagComposition), and bind the canvas
3、PagPlayer.play();
方式1. 手动绑定Surface
PAGFile pagFile = PAGFile.Load(getContext().getAssets(), "xxx.pag");
PAGSurface pagSurface = PAGSurface.FromSurface(mEncoder.createInputSurface());
pagPlayer = new PAGPlayer();
pagPlayer.setSurface(pagSurface);
pagPlayer.setComposition(pagFile);
方式2. 直接使用PagView
PAGFile pagFile = PAGFile.Load(getContext().getAssets(), "xxx.pag");
pagView.setComposition(pagFile);
pagView.setRepeatCount(0)
Demo download address
iOS DEMO download: https://github.com/libpag/pag-ios.git
Android DEMO download: https://github.com/libpag/pag-android.git