36 {
37 super.onCreate(savedInstanceState);
38 setContentView(
R.layout.activity_main);
39
41 p.setColor(
new Color(0, 1, 0, 1));
42
43
44
45
46
47
48 Bitmap.Config conf = Bitmap.Config.ARGB_8888;
49 Bitmap bmp = Bitmap.createBitmap(400, 400, conf);
52
54
55 float[]
m = {1, 0, 0, 100,
56 0, 1, 0, 100,
57 0, 0, 1, 0,
58 0, 0, 0, 1};
59 p.setColor(
new Color(0, 0, 1, 1));
64
67
68 try {
70
73 }
catch (Exception
e) {
74 Log.e(
"JetSki Demo",
"Could not load Image resource: " +
R.raw.brickwork_texture);
75 }
76 bitmapImage = findViewById(
R.id.bitmapImage);
77 bitmapImage.setImageBitmap(bmp);
78
79
80
81
82
83 SurfaceView surfaceView = findViewById(
R.id.threadedSurface);
84 surfaceView.getHolder().addCallback(new ThreadedSurfaceHandler());
85
86
87
88
89
90 SurfaceView runtimeEffectView = findViewById(
R.id.runtimeEffect);
91 runtimeEffectView.getHolder().addCallback(new DemoRuntimeShaderRenderer());
92
93
94
95
96 SkottieView skottieView =
new SkottieView(
this,
R.raw.im_thirsty,
new Color(1, 1, 1, 1));
97 skottieView.setLayoutParams(new ViewGroup.LayoutParams(400, 400));
98 skottieView.setOnClickListener((View v) -> {
99 SkottieView
s = (SkottieView)v;
101 });
102 LinearLayout skottieContainer = findViewById(
R.id.skottie_container);
103 skottieContainer.addView(skottieView);
104 }
void drawImage(Image image, float x, float y)
void drawRect(float left, float top, float right, float bottom, Paint paint)
static Image fromStream(InputStream encodedStream)
static SamplingOptions CATMULLROM()
Image makeImageSnapshot()
sk_sp< const SkImage > image
SK_API sk_sp< SkShader > Color(SkColor)
void Log(const char *format,...) SK_PRINTF_LIKE(1
SK_API sk_sp< PrecompileColorFilter > Matrix()