74 {
75 super(context, attrs);
77 .obtainStyledAttributes(attrs,
R.styleable.SkottieView, defStyleAttr, defStyleRes);
78 try {
79
80 mRepeatCount =
a.getInteger(
R.styleable.SkottieView_android_repeatCount, 0);
81
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
104 int src =
a.getResourceId(
R.styleable.SkottieView_src, -1);
107 }
108 } finally {
110 }
111 initBackingView();
112 }
emscripten::val TypedArray
void setSource(InputStream inputStream)
SK_API sk_sp< SkShader > Color(SkColor)