文件名称:PullScrollView
文件大小:9KB
文件格式:JAVA
更新时间:2018-08-19 04:33:13
ScrollView
/** * Created by kaiyi.cky on 2015/7/24. */ public class PullBlurScrollView extends ScrollView { /**头部**/ private View mHeader; /**主体**/ private View mContentView; /** 模糊图片 **/ private BlurDrawable mBlurDrawable; /** 阻尼系数,越小阻力就越大. */ private static final float SCROLL_RATIO = 0.5f; /** 当前头部状态 */ private State mState = State.NORMAL; /** 头部总高度 */ private int mHeaderHeight; /** 头部可视高 */ private int mHeaderVisibleHeight; /** 头部图片初始顶部和底部. */ private int mInitTop, mInitBottom; /** 头部图片拖动时顶部和底部. */ private int mCurrentTop, mCurrentBottom; /** 首次点击的Y坐标. */ private PointF mStartPoint = new PointF(); /** ScrollView的content view矩形,用于记录content的初始位置情况 */ private Rect mContentRect = new Rect(); /** 是否移动到顶部位置. */ private boolean isTop = false; /** 是否关闭ScrollView的滑动. */ private boolean mEnableTouch = false; /** 是否开始移动. */ private boolean isMoving = false; private enum State { /**顶部*/ UP, /**底部*/ DOWN, /**正常*/ NORMAL } public PullBlurScrollView(Context context) { super(context); init(context,null); }