Skip to content

Commit ae36dc3

Browse files
committed
feat: Set parser class variables for demo.
1 parent ef1f232 commit ae36dc3

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromAssetsActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818

1919
public class AnimationFromAssetsActivity extends Activity {
2020

21-
SVGAImageView animationView = null;
2221
int currentIndex = 0;
22+
SVGAImageView animationView = null;
23+
SVGAParser parser = new SVGAParser(this);
2324

2425
@Override
2526
protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -37,7 +38,6 @@ public void onClick(View view) {
3738
}
3839

3940
private void loadAnimation() {
40-
SVGAParser parser = new SVGAParser(this);
4141
parser.decodeFromAssets(this.randomSample(), new SVGAParser.ParseCompletion() {
4242
@Override
4343
public void onComplete(@NotNull SVGAVideoEntity videoItem) {

app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromClickActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
public class AnimationFromClickActivity extends Activity {
2424

2525
SVGAImageView animationView = null;
26+
SVGAParser parser = new SVGAParser(this);
2627

2728
@Override
2829
protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -40,7 +41,6 @@ public void onClick(@NotNull String clickKey) {
4041
}
4142

4243
private void loadAnimation() {
43-
SVGAParser parser = new SVGAParser(this);
4444
parser.decodeFromAssets("test2.svga",new SVGAParser.ParseCompletion() {
4545
@Override
4646
public void onComplete(@NotNull SVGAVideoEntity videoItem) {

app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromNetworkActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
public class AnimationFromNetworkActivity extends Activity {
1818

1919
SVGAImageView animationView = null;
20+
SVGAParser parser = new SVGAParser(this);
2021

2122
@Override
2223
protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -28,7 +29,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
2829
}
2930

3031
private void loadAnimation() {
31-
SVGAParser parser = new SVGAParser(this);
3232
try { // new URL needs try catch.
3333
parser.decodeFromURL(new URL("https://github.com/yyued/SVGA-Samples/blob/master/posche.svga?raw=true"), new SVGAParser.ParseCompletion() {
3434
@Override

app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationWithDynamicImageActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
public class AnimationWithDynamicImageActivity extends Activity {
2020

2121
SVGAImageView animationView = null;
22+
SVGAParser parser = new SVGAParser(this);
2223

2324
@Override
2425
protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -30,7 +31,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
3031
}
3132

3233
private void loadAnimation() {
33-
SVGAParser parser = new SVGAParser(this);
3434
try { // new URL needs try catch.
3535
parser.decodeFromURL(new URL("https://github.com/yyued/SVGA-Samples/blob/master/kingset.svga?raw=true"), new SVGAParser.ParseCompletion() {
3636
@Override

0 commit comments

Comments
 (0)