forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skottie Android demo app improvements
Changed SkottieView base class to TextureView. Implemented new SkottieAnimation interface, which allows to get animation duration, set and get animation progress. SkottieView will draw correctly even if animation is stopped. Test: Ran Skottie app Bug: skia: Change-Id: I952793b75518107f515ddec8ad6524f4048f42e7 Reviewed-on: https://skia-review.googlesource.com/c/167945 Commit-Queue: Stan Iliev <stani@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
- Loading branch information
Showing
5 changed files
with
156 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
platform_tools/android/apps/skottie/src/main/java/org/skia/skottie/SkottieAnimation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.skia.skottie; | ||
|
||
import android.graphics.drawable.Animatable; | ||
import android.support.annotation.FloatRange; | ||
|
||
public interface SkottieAnimation extends Animatable { | ||
/** | ||
* Gets animation duration. | ||
* | ||
* @return Animation duration in milliseconds. | ||
*/ | ||
long getDuration(); | ||
|
||
/** | ||
* Sets current animation progress. | ||
* | ||
* @param progress animation progress | ||
* | ||
*/ | ||
void setProgress(@FloatRange(from = 0, to = 1) float progress); | ||
|
||
|
||
/** | ||
* Gets current animation progress. | ||
* | ||
* @return animation progress. | ||
*/ | ||
@FloatRange(from = 0, to = 1) float getProgress(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.