Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
org.skia.skottie.SkottieView Class Reference
Inheritance diagram for org.skia.skottie.SkottieView:

Public Member Functions

SkottieView buildAsTexture (Context context)
 
SkottieView buildAsSurface (Context context, int backgroundColor)
 
 SkottieView (Context context)
 
 SkottieView (Context context, AttributeSet attrs)
 
 SkottieView (Context context, AttributeSet attrs, int defStyleAttr)
 
 SkottieView (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
 
void setSource (InputStream inputStream)
 
void setSource (int resId)
 
void setSource (Context context, Uri uri) throws FileNotFoundException
 
void removeListener (Animator.AnimatorListener listener)
 
void addListener (Animator.AnimatorListener listener)
 
void seek (float progress)
 
void play ()
 
void pause ()
 
void start ()
 
void stop ()
 
float getProgress ()
 
void setRepeatCount (int repeatCount)
 
void setBackgroundColor (int colorRGB)
 

Static Public Member Functions

static void setMaxCacheSize (int maxCacheSize)
 

Protected Member Functions

SkottieAnimation getSkottieAnimation ()
 

Detailed Description

Definition at line 28 of file SkottieView.java.

Constructor & Destructor Documentation

◆ SkottieView() [1/4]

org.skia.skottie.SkottieView.SkottieView ( Context  context)
inline

Definition at line 59 of file SkottieView.java.

59 {
60 super(context);
61 mBackingView = new TextureView(context);
62 initBackingView();
63 }

◆ SkottieView() [2/4]

org.skia.skottie.SkottieView.SkottieView ( Context  context,
AttributeSet  attrs 
)
inline

Definition at line 65 of file SkottieView.java.

65 {
66 this(context, attrs, 0, 0);
67 }

◆ SkottieView() [3/4]

org.skia.skottie.SkottieView.SkottieView ( Context  context,
AttributeSet  attrs,
int  defStyleAttr 
)
inline

Definition at line 69 of file SkottieView.java.

69 {
70 this(context, attrs, defStyleAttr, 0);
71 }

◆ SkottieView() [4/4]

org.skia.skottie.SkottieView.SkottieView ( Context  context,
AttributeSet  attrs,
int  defStyleAttr,
int  defStyleRes 
)
inline

Definition at line 74 of file SkottieView.java.

74 {
75 super(context, attrs);
76 TypedArray a = context.getTheme()
77 .obtainStyledAttributes(attrs, R.styleable.SkottieView, defStyleAttr, defStyleRes);
78 try {
79 // set mRepeatCount
80 mRepeatCount = a.getInteger(R.styleable.SkottieView_android_repeatCount, 0);
81 // set backing view and background color
82 switch (a.getInteger(R.styleable.SkottieView_backing_view, -1)) {
83 case BACKING_VIEW_TEXTURE:
84 mBackingView = new TextureView(context);
85 ((TextureView) mBackingView).setOpaque(false);
86 mBackgroundColor = a.getColor(R.styleable.SkottieView_background_color, 0);
87 break;
88 case BACKING_VIEW_SURFACE:
89 if (!a.hasValue(R.styleable.SkottieView_background_color)) {
90 throw new RuntimeException("background_color attribute "
91 + "needed for SurfaceView");
92 }
93 mBackingView = new SurfaceView(context);
94 mBackgroundColor = a.getColor(R.styleable.SkottieView_background_color, -1);
95 if (Color.alpha(mBackgroundColor) != 255) {
96 throw new RuntimeException("background_color cannot be transparent");
97 }
98 break;
99 default:
100 throw new RuntimeException("backing_view attribute needed to "
101 + "specify between texture_view or surface_view");
102 }
103 // set source
104 int src = a.getResourceId(R.styleable.SkottieView_src, -1);
105 if (src != -1) {
106 setSource(src);
107 }
108 } finally {
109 a.recycle();
110 }
111 initBackingView();
112 }
emscripten::val TypedArray
Definition WasmCommon.h:31
void setSource(InputStream inputStream)
struct MyStruct a[10]
#define R(r)

Member Function Documentation

◆ addListener()

void org.skia.skottie.SkottieView.addListener ( Animator.AnimatorListener  listener)
inline

Definition at line 170 of file SkottieView.java.

170 {
171 mAnimation.addListener(listener);
172 }

◆ buildAsSurface()

SkottieView org.skia.skottie.SkottieView.buildAsSurface ( Context  context,
int  backgroundColor 
)
inline

Definition at line 51 of file SkottieView.java.

51 {
52 SkottieView s = new SkottieView(context);
53 s.mBackingView = new SurfaceView(context);
54 s.mBackgroundColor = backgroundColor;
55 return s;
56 }
struct MyStruct s

◆ buildAsTexture()

SkottieView org.skia.skottie.SkottieView.buildAsTexture ( Context  context)
inline

Definition at line 43 of file SkottieView.java.

43 {
44 return new SkottieView(context);
45 }

◆ getProgress()

float org.skia.skottie.SkottieView.getProgress ( )
inline

Definition at line 205 of file SkottieView.java.

205 {
206 if(mAnimation != null) {
207 return mAnimation.getProgress();
208 }
209 return -1;
210 }

◆ getSkottieAnimation()

SkottieAnimation org.skia.skottie.SkottieView.getSkottieAnimation ( )
inlineprotected

Definition at line 162 of file SkottieView.java.

162 {
163 return mAnimation;
164 }

◆ pause()

void org.skia.skottie.SkottieView.pause ( )
inline

Definition at line 187 of file SkottieView.java.

187 {
188 if(mAnimation != null) {
189 mAnimation.pause();
190 }
191 }

◆ play()

void org.skia.skottie.SkottieView.play ( )
inline

Definition at line 181 of file SkottieView.java.

181 {
182 if(mAnimation != null) {
183 mAnimation.resume();
184 }
185 }

◆ removeListener()

void org.skia.skottie.SkottieView.removeListener ( Animator.AnimatorListener  listener)
inline

Definition at line 166 of file SkottieView.java.

166 {
167 mAnimation.removeListener(listener);
168 }

◆ seek()

void org.skia.skottie.SkottieView.seek ( float  progress)
inline

Definition at line 175 of file SkottieView.java.

175 {
176 if(mAnimation != null) {
177 mAnimation.setProgress(progress);
178 }
179 }

◆ setBackgroundColor()

void org.skia.skottie.SkottieView.setBackgroundColor ( int  colorRGB)
inline

Definition at line 216 of file SkottieView.java.

216 {
217 mBackgroundColor = colorRGB;
218 }

◆ setMaxCacheSize()

static void org.skia.skottie.SkottieView.setMaxCacheSize ( int  maxCacheSize)
inlinestatic

Definition at line 220 of file SkottieView.java.

220 {
221 SkottieRunner.getInstance().setMaxCacheSize(maxCacheSize);
222 }

◆ setRepeatCount()

void org.skia.skottie.SkottieView.setRepeatCount ( int  repeatCount)
inline

Definition at line 212 of file SkottieView.java.

212 {
213 mRepeatCount = repeatCount;
214 }

◆ setSource() [1/3]

void org.skia.skottie.SkottieView.setSource ( Context  context,
Uri  uri 
) throws FileNotFoundException
inline

Definition at line 130 of file SkottieView.java.

130 {
131 InputStream inputStream = context.getContentResolver().openInputStream(uri);
132 mAnimation = setSourceHelper(inputStream);
133 }

◆ setSource() [2/3]

void org.skia.skottie.SkottieView.setSource ( InputStream  inputStream)
inline

Definition at line 121 of file SkottieView.java.

121 {
122 mAnimation = setSourceHelper(inputStream);
123 }

◆ setSource() [3/3]

void org.skia.skottie.SkottieView.setSource ( int  resId)
inline

Definition at line 125 of file SkottieView.java.

125 {
126 InputStream inputStream = mBackingView.getResources().openRawResource(resId);
127 mAnimation = setSourceHelper(inputStream);
128 }

◆ start()

void org.skia.skottie.SkottieView.start ( )
inline

Definition at line 193 of file SkottieView.java.

193 {
194 if(mAnimation != null) {
195 mAnimation.start();
196 }
197 }

◆ stop()

void org.skia.skottie.SkottieView.stop ( )
inline

Definition at line 199 of file SkottieView.java.

199 {
200 if(mAnimation != null) {
201 mAnimation.end();
202 }
203 }

The documentation for this class was generated from the following file: