@SuppressLint("NewApi")
private void setViewAttributes(Context context, AttributeSet attrs, int defStyle) {
/**
* Starting from HONEYCOMB have to turn off HW acceleration to draw
* Movie on Canvas.
*/
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
final TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.GifMoviewView, defStyle,
R.style.Widget_GifMoviewView);
mMovieResourceId = array.getResourceId(R.styleable.GifMoviewView_gif, -1);
mPaused = array.getBoolean(R.styleable.GifMoviewView_paused, false);
array.recycle();
if (mMovieResourceId != -1) {
mMovie = Movie.decodeStream(getResources().openRawResource(mMovieResourceId));
}
}
GifMovieView.java 文件源码
java
阅读 46
收藏 0
点赞 0
评论 0
项目:Simpler
作者:
评论列表
文章目录