PullToZoomBase.java 文件源码

java
阅读 17 收藏 0 点赞 0 评论 0

项目:letv 作者:
@SuppressLint({"NewApi"})
private void init(Context context, AttributeSet attrs) {
    setGravity(17);
    this.mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    DisplayMetrics localDisplayMetrics = new DisplayMetrics();
    ((Activity) getContext()).getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics);
    this.mScreenHeight = localDisplayMetrics.heightPixels;
    this.mScreenWidth = localDisplayMetrics.widthPixels;
    this.mRootView = createRootView(context, attrs);
    if (attrs != null) {
        LayoutInflater mLayoutInflater = LayoutInflater.from(getContext());
        TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.PullToZoomView);
        int zoomViewResId = a.getResourceId(2, 0);
        if (zoomViewResId > 0) {
            this.mZoomView = mLayoutInflater.inflate(zoomViewResId, null, false);
        }
        int headerViewResId = a.getResourceId(0, 0);
        if (headerViewResId > 0) {
            this.mHeaderView = mLayoutInflater.inflate(headerViewResId, null, false);
        }
        this.isParallax = a.getBoolean(1, true);
        handleStyledAttributes(a);
        a.recycle();
    }
    addView(this.mRootView, -1, -1);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号