Code example for WindowManager

Methods: updateViewLayout

0
     *    */ 
    public void onDrag(int y){
        if (mDragImageView != null) {
            mWindowParams.alpha = 0.8f;
            mWindowParams.y = y - mDragPoint + mDragOffset;
            mWindowManager.updateViewLayout(mDragImageView, mWindowParams);
        } 
        //为了避免滑动到分割线的时候,返回-1的问题 
        int tempPosition = pointToPosition(0, y);
        if (tempPosition != INVALID_POSITION) {
            mDragPosition = tempPosition;
        } 
 
        //滚动 
        int scrollHeight = 0;
        if (y < mUpScrollBounce) {
            scrollHeight = 8;//定义向上滚动8个像素,如果可以向上滚动的话
        } else if (y > mDownScrollBounce){
            scrollHeight = -8;//定义向下滚动8个像素,,如果可以向上滚动的话
        }