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

Protected Member Functions

void onCreate (Bundle savedInstanceState)
 

Package Functions

void runSkottie (int id)
 
void runLottie (int id, boolean useHardware)
 

Package Attributes

int[] rawAssets
 

Detailed Description

Definition at line 13 of file PerfActivity.java.

Member Function Documentation

◆ onCreate()

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

Definition at line 37 of file PerfActivity.java.

37 {
38 //Remove title bar
39 this.requestWindowFeature(Window.FEATURE_NO_TITLE);
40
41 //Remove notification bar
42 this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
43 WindowManager.LayoutParams.FLAG_FULLSCREEN);
44
45 super.onCreate(savedInstanceState);
46 // Run activity with:
47 // adb shell am start -n org.skia.skottie/.PerfActivity --ei renderer 0 --ei file 0
48 // renderer is 0 to 2, file is 0 to 14
49 Intent intent = getIntent();
50 int renderer = intent.getIntExtra("renderer", 0);
51 int file = intent.getIntExtra("file", 0);
52 if (file < 0 || file >= rawAssets.length) {
53 return;
54 }
55 switch (renderer) {
56 case 0:
57 // render with airbnb hardware lottie player
58 runLottie(rawAssets[file], true);
59 break;
60 case 1:
61 // render with airbnb software lottie player
62 runLottie(rawAssets[file], false);
63 break;
64 case 2:
65 // render with skottie player
67 break;
68 default:
69 break;
70 }
71
72 }
void runLottie(int id, boolean useHardware)

◆ runLottie()

void org.skia.skottie.PerfActivity.runLottie ( int  id,
boolean  useHardware 
)
inlinepackage

Definition at line 81 of file PerfActivity.java.

81 {
82 LottieAnimationView lottie = new LottieAnimationView(this);
83 lottie.setAnimation(id);
84 if (useHardware) {
85 lottie.setRenderMode(RenderMode.HARDWARE);
86 } else {
87 lottie.setRenderMode(RenderMode.SOFTWARE);
88 }
89 lottie.setRepeatMode(LottieDrawable.RESTART);
90 lottie.setRepeatCount(LottieDrawable.INFINITE);
91 lottie.playAnimation();
92 setContentView(lottie);
93 }

◆ runSkottie()

void org.skia.skottie.PerfActivity.runSkottie ( int  id)
inlinepackage

Definition at line 74 of file PerfActivity.java.

74 {
75 SkottieView view = new SkottieView(this);
76 view.setSource(getResources().openRawResource(id));
77 view.start();
78 setContentView(view);
79 }

Member Data Documentation

◆ rawAssets

int [] org.skia.skottie.PerfActivity.rawAssets
package
Initial value:
= {
R.raw.star,
R.raw.movie_loading,
R.raw.uk,
R.raw.white_material_wave_loading,
R.raw.check_animation,
R.raw.confetti,
R.raw.gears,
R.raw.hand_sanitizer,
R.raw.heart_preloader,
R.raw.i_was_scared_after_that_brouhaha,
R.raw.im_thirsty,
R.raw.true_will,
R.raw.workout_monkey_stay_healthy,
R.raw.ripple_loading_animation,
R.raw.signature,
R.raw.asdasd,
R.raw.celebration,
R.raw.check
}
#define R(r)

Definition at line 15 of file PerfActivity.java.


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