From ae36dc3d9ad14fe1b4dbdb5139a57e4dbae6e6b4 Mon Sep 17 00:00:00 2001 From: zhanduojian Date: Fri, 6 Sep 2019 16:04:41 +0800 Subject: [PATCH] feat: Set parser class variables for demo. --- .../ponycui_home/svgaplayer/AnimationFromAssetsActivity.java | 4 ++-- .../ponycui_home/svgaplayer/AnimationFromClickActivity.java | 2 +- .../ponycui_home/svgaplayer/AnimationFromNetworkActivity.java | 2 +- .../svgaplayer/AnimationWithDynamicImageActivity.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromAssetsActivity.java b/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromAssetsActivity.java index 05232378..694ac58b 100644 --- a/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromAssetsActivity.java +++ b/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromAssetsActivity.java @@ -18,8 +18,9 @@ public class AnimationFromAssetsActivity extends Activity { - SVGAImageView animationView = null; int currentIndex = 0; + SVGAImageView animationView = null; + SVGAParser parser = new SVGAParser(this); @Override protected void onCreate(@Nullable Bundle savedInstanceState) { @@ -37,7 +38,6 @@ public void onClick(View view) { } private void loadAnimation() { - SVGAParser parser = new SVGAParser(this); parser.decodeFromAssets(this.randomSample(), new SVGAParser.ParseCompletion() { @Override public void onComplete(@NotNull SVGAVideoEntity videoItem) { diff --git a/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromClickActivity.java b/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromClickActivity.java index a3a8124a..7de4b33a 100644 --- a/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromClickActivity.java +++ b/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromClickActivity.java @@ -23,6 +23,7 @@ public class AnimationFromClickActivity extends Activity { SVGAImageView animationView = null; + SVGAParser parser = new SVGAParser(this); @Override protected void onCreate(@Nullable Bundle savedInstanceState) { @@ -40,7 +41,6 @@ public void onClick(@NotNull String clickKey) { } private void loadAnimation() { - SVGAParser parser = new SVGAParser(this); parser.decodeFromAssets("test2.svga",new SVGAParser.ParseCompletion() { @Override public void onComplete(@NotNull SVGAVideoEntity videoItem) { diff --git a/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromNetworkActivity.java b/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromNetworkActivity.java index 00c4c00d..c8e2af50 100644 --- a/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromNetworkActivity.java +++ b/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromNetworkActivity.java @@ -17,6 +17,7 @@ public class AnimationFromNetworkActivity extends Activity { SVGAImageView animationView = null; + SVGAParser parser = new SVGAParser(this); @Override protected void onCreate(@Nullable Bundle savedInstanceState) { @@ -28,7 +29,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { } private void loadAnimation() { - SVGAParser parser = new SVGAParser(this); try { // new URL needs try catch. parser.decodeFromURL(new URL("https://github.com/yyued/SVGA-Samples/blob/master/posche.svga?raw=true"), new SVGAParser.ParseCompletion() { @Override diff --git a/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationWithDynamicImageActivity.java b/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationWithDynamicImageActivity.java index 15b02b6c..381dfe5f 100644 --- a/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationWithDynamicImageActivity.java +++ b/app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationWithDynamicImageActivity.java @@ -19,6 +19,7 @@ public class AnimationWithDynamicImageActivity extends Activity { SVGAImageView animationView = null; + SVGAParser parser = new SVGAParser(this); @Override protected void onCreate(@Nullable Bundle savedInstanceState) { @@ -30,7 +31,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { } private void loadAnimation() { - SVGAParser parser = new SVGAParser(this); try { // new URL needs try catch. parser.decodeFromURL(new URL("https://github.com/yyued/SVGA-Samples/blob/master/kingset.svga?raw=true"), new SVGAParser.ParseCompletion() { @Override