123 {
124 super(context, attrs);
126 .obtainStyledAttributes(attrs,
R.styleable.SkottieView, defStyleAttr, defStyleRes);
127 try {
128
129 mBackingView = new SurfaceView(context);
130 initBackingView();
131 int backgroundColor =
a.getColor(
R.styleable.SkottieView_background_color, -1);
132 if (backgroundColor == -1) {
133 throw new RuntimeException("background_color attribute "
134 + "needed for SurfaceView");
135 }
136 if (
android.graphics.Color.alpha(backgroundColor) != 255) {
137 throw new RuntimeException("background_color cannot be transparent");
138 }
139
140 int src =
a.getResourceId(
R.styleable.SkottieView_src, -1);
143 } finally {
145 }
146 }
emscripten::val TypedArray
void setSource(int resID, Context context, Color background)
SK_API sk_sp< SkShader > Color(SkColor)