Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | Static Package Attributes | List of all members
org.skia.skottie.SkottieActivity Class Reference
Inheritance diagram for org.skia.skottie.SkottieActivity:

Public Member Functions

void onEnterAnimationComplete ()
 
void waitForEnterAnimationComplete () throws TimeoutException, InterruptedException
 
void onClick (View view)
 

Protected Member Functions

void onCreate (Bundle savedInstanceState)
 
void onDestroy ()
 
void onActivityResult (int requestCode, int resultCode, Intent data)
 

Static Package Attributes

static int mInflatedIndex = -1
 
static final int PICK_FILE_REQUEST = 2
 

Detailed Description

Definition at line 31 of file SkottieActivity.java.

Member Function Documentation

◆ onActivityResult()

void org.skia.skottie.SkottieActivity.onActivityResult ( int  requestCode,
int  resultCode,
Intent  data 
)
inlineprotected

Definition at line 287 of file SkottieActivity.java.

287 {
288 super.onActivityResult(requestCode, resultCode, data);
289 if (resultCode == Activity.RESULT_OK) {
290 if (requestCode == PICK_FILE_REQUEST && data != null) {
291 //no data present
292 Uri uri = data.getData();
293
294 try {
295 addLottie(uri);
296 } catch (FileNotFoundException e) {
297 e.printStackTrace();
298 }
299 }
300 }
301 }
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ onClick()

void org.skia.skottie.SkottieActivity.onClick ( View  view)
inline

Definition at line 259 of file SkottieActivity.java.

259 {
260 switch(view.getId()) {
261 case R.id.open_lottie:
262 Intent intent = new Intent();
263 intent.setType("application/json");
264 Intent i = Intent.createChooser(intent, "View Default File Manager");
265 startActivityForResult(i, PICK_FILE_REQUEST);
266 break;
267 case R.id.play:
268 for (SkottieView anim : mAnimations) {
269 anim.play();
270 }
271 break;
272 case R.id.pause:
273 for (SkottieView anim : mAnimations) {
274 anim.pause();
275 }
276 break;
277 case R.id.reset:
278 for (SkottieView anim : mAnimations) {
279 anim.seek(0f);
280 }
281 break;
282 }
283
284 }
#define R(r)

◆ onCreate()

void org.skia.skottie.SkottieActivity.onCreate ( Bundle  savedInstanceState)
inlineprotected

Definition at line 245 of file SkottieActivity.java.

245 {
246 super.onCreate(savedInstanceState);
247
248 createLayout();
249 }

◆ onDestroy()

void org.skia.skottie.SkottieActivity.onDestroy ( )
inlineprotected

Definition at line 252 of file SkottieActivity.java.

252 {
253 super.onDestroy();
254 }

◆ onEnterAnimationComplete()

void org.skia.skottie.SkottieActivity.onEnterAnimationComplete ( )
inline

Definition at line 215 of file SkottieActivity.java.

215 {
216 super.onEnterAnimationComplete();
217 mEnterAnimationFence.countDown();
218 }

◆ waitForEnterAnimationComplete()

void org.skia.skottie.SkottieActivity.waitForEnterAnimationComplete ( ) throws TimeoutException, InterruptedException
inline

Definition at line 220 of file SkottieActivity.java.

220 {
221 if (!mEnterAnimationFence.await(TIME_OUT_MS, TimeUnit.MILLISECONDS)) {
222 throw new TimeoutException();
223 }
224 }

Member Data Documentation

◆ mInflatedIndex

int org.skia.skottie.SkottieActivity.mInflatedIndex = -1
staticpackage

Definition at line 108 of file SkottieActivity.java.

◆ PICK_FILE_REQUEST

final int org.skia.skottie.SkottieActivity.PICK_FILE_REQUEST = 2
staticpackage

Definition at line 256 of file SkottieActivity.java.


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