This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 490
Dynamic Hidden
PonyCui edited this page Dec 19, 2018
·
1 revision
Sometimes, you may wonder how to hides an element, try this.
You can download a sample file from SVGA-Samples to try.
// Setup a SVGAImageView by yourself.
try {
parser.parse(new URL("https://github.com/yyued/SVGA-Samples/blob/master/kingset.svga?raw=true"),
new SVGAParser.ParseCompletion() {
@Override
public void onComplete(@NotNull SVGAVideoEntity videoItem) {
}
@Override
public void onError() {
}
}
);
} catch (Exception e) {
System.out.print(true);
}
try {
parser.parse(new URL("https://github.com/yyued/SVGA-Samples/blob/master/kingset.svga?raw=true"),
new SVGAParser.ParseCompletion() {
@Override
public void onComplete(@NotNull SVGAVideoEntity videoItem) {
SVGADynamicEntity dynamicEntity = new SVGADynamicEntity();
dynamicEntity.setHidden(true, "banner");
SVGADrawable drawable = new SVGADrawable(videoItem, dynamicEntity);
testView.setImageDrawable(drawable);
testView.startAnimation();
}
@Override
public void onError() {
}
}
);
} catch (Exception e) {
System.out.print(true);
}
The banner element has been hidden.
The imageKey
is the name of png file, ask your designer tell you the file name.
For example, the layer png image file name is xxx.png
, imageKey
is xxx
. File name should always use English name, do not use Chinese or Japanese etc.