Java 类com.facebook.drawee.view.DraweeView 实例源码

项目:PicKing    文件:Attacher.java   
public Attacher(DraweeView<GenericDraweeHierarchy> draweeView) {
    mDraweeView = new WeakReference<>(draweeView);
    draweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
    draweeView.setOnTouchListener(this);
    mScaleDragDetector = new ScaleDragDetector(draweeView.getContext(), this);
    mGestureDetector = new GestureDetectorCompat(draweeView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {
                @Override public void onLongPress(MotionEvent e) {
                    super.onLongPress(e);
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getDraweeView());
                    }
                }
            });
    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
}
项目:PicKing    文件:Attacher.java   
@Override public void run() {

            DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();
            if (draweeView == null) {
                return;
            }

            float t = interpolate();
            float scale = mZoomStart + t * (mZoomEnd - mZoomStart);
            float deltaScale = scale / getScale();

            onScale(deltaScale, mFocalX, mFocalY);

            if (t < 1f) {
                postOnAnimation(draweeView, this);
            }
        }
项目:PicKing    文件:Attacher.java   
@Override public void run() {
    if (mScroller.isFinished()) {
        return;
    }

    DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

    if (draweeView != null && mScroller.computeScrollOffset()) {
        final int newX = mScroller.getCurrX();
        final int newY = mScroller.getCurrY();
        mMatrix.postTranslate(mCurrentX - newX, mCurrentY - newY);
        draweeView.invalidate();
        mCurrentX = newX;
        mCurrentY = newY;
        postOnAnimation(draweeView, this);
    }
}
项目:android-photo-picker    文件:Attacher.java   
public Attacher(DraweeView<GenericDraweeHierarchy> draweeView) {
    mDraweeView = new WeakReference<>(draweeView);
    draweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
    draweeView.setOnTouchListener(this);
    mScaleDragDetector = new ScaleDragDetector(draweeView.getContext(), this);
    mGestureDetector = new GestureDetectorCompat(draweeView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {
                @Override public void onLongPress(MotionEvent e) {
                    super.onLongPress(e);
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getDraweeView());
                    }
                }
            });
    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
}
项目:android-photo-picker    文件:Attacher.java   
@Override public void onDrag(float dx, float dy) {

        DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

        if (draweeView != null && !mScaleDragDetector.isScaling()) {
            mMatrix.postTranslate(dx, dy);
            checkMatrixAndInvalidate();

            ViewParent parent = draweeView.getParent();
            if (parent == null) {
                return;
            }

            if (mAllowParentInterceptOnEdge
                    && !mScaleDragDetector.isScaling()
                    && !mBlockParentIntercept) {
                if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f) || (
                        mScrollEdge == EDGE_RIGHT
                                && dx <= -1f)) {
                    parent.requestDisallowInterceptTouchEvent(false);
                }
            } else {
                parent.requestDisallowInterceptTouchEvent(true);
            }
        }
    }
项目:android-photo-picker    文件:Attacher.java   
@Override public void run() {

            DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();
            if (draweeView == null) {
                return;
            }

            float t = interpolate();
            float scale = mZoomStart + t * (mZoomEnd - mZoomStart);
            float deltaScale = scale / getScale();

            onScale(deltaScale, mFocalX, mFocalY);

            if (t < 1f) {
                postOnAnimation(draweeView, this);
            }
        }
项目:android-photo-picker    文件:Attacher.java   
@Override public void run() {
    if (mScroller.isFinished()) {
        return;
    }

    DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

    if (draweeView != null && mScroller.computeScrollOffset()) {
        final int newX = mScroller.getCurrX();
        final int newY = mScroller.getCurrY();
        mMatrix.postTranslate(mCurrentX - newX, mCurrentY - newY);
        draweeView.invalidate();
        mCurrentX = newX;
        mCurrentY = newY;
        postOnAnimation(draweeView, this);
    }
}
项目:CanPhotos    文件:Attacher.java   
public Attacher(DraweeView<GenericDraweeHierarchy> draweeView) {
    mDraweeView = new WeakReference<>(draweeView);
    draweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
    draweeView.setOnTouchListener(this);
    mScaleDragDetector = new ScaleDragDetector(draweeView.getContext(), this);
    mGestureDetector = new GestureDetectorCompat(draweeView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {
                @Override public void onLongPress(MotionEvent e) {
                    super.onLongPress(e);
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getDraweeView());
                    }
                }
            });
    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
}
项目:CanPhotos    文件:Attacher.java   
@Override public void onDrag(float dx, float dy) {

        DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

        if (draweeView != null && !mScaleDragDetector.isScaling()) {
            mMatrix.postTranslate(dx, dy);
            checkMatrixAndInvalidate();

            ViewParent parent = draweeView.getParent();
            if (parent == null) {
                return;
            }

            if (mAllowParentInterceptOnEdge
                    && !mScaleDragDetector.isScaling()
                    && !mBlockParentIntercept) {
                if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f) || (
                        mScrollEdge == EDGE_RIGHT
                                && dx <= -1f)) {
                    parent.requestDisallowInterceptTouchEvent(false);
                }
            } else {
                parent.requestDisallowInterceptTouchEvent(true);
            }
        }
    }
项目:CanPhotos    文件:Attacher.java   
@Override public void run() {

            DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();
            if (draweeView == null) {
                return;
            }

            float t = interpolate();
            float scale = mZoomStart + t * (mZoomEnd - mZoomStart);
            float deltaScale = scale / getScale();

            onScale(deltaScale, mFocalX, mFocalY);

            if (t < 1f) {
                postOnAnimation(draweeView, this);
            }
        }
项目:CanPhotos    文件:Attacher.java   
@Override public void run() {
    if (mScroller.isFinished()) {
        return;
    }

    DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

    if (draweeView != null && mScroller.computeScrollOffset()) {
        final int newX = mScroller.getCurrX();
        final int newY = mScroller.getCurrY();
        mMatrix.postTranslate(mCurrentX - newX, mCurrentY - newY);
        draweeView.invalidate();
        mCurrentX = newX;
        mCurrentY = newY;
        postOnAnimation(draweeView, this);
    }
}
项目:SprintNBA    文件:Attacher.java   
public Attacher(DraweeView<GenericDraweeHierarchy> draweeView) {
    mDraweeView = new WeakReference<>(draweeView);
    draweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
    draweeView.setOnTouchListener(this);
    mScaleDragDetector = new ScaleDragDetector(draweeView.getContext(), this);
    mGestureDetector = new GestureDetectorCompat(draweeView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {
                @Override public void onLongPress(MotionEvent e) {
                    super.onLongPress(e);
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getDraweeView());
                    }
                }
            });
    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
}
项目:SprintNBA    文件:Attacher.java   
@Override public void onDrag(float dx, float dy) {

        DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

        if (draweeView != null && !mScaleDragDetector.isScaling()) {
            mMatrix.postTranslate(dx, dy);
            checkMatrixAndInvalidate();

            ViewParent parent = draweeView.getParent();
            if (parent == null) {
                return;
            }

            if (mAllowParentInterceptOnEdge
                    && !mScaleDragDetector.isScaling()
                    && !mBlockParentIntercept) {
                if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f) || (
                        mScrollEdge == EDGE_RIGHT
                                && dx <= -1f)) {
                    parent.requestDisallowInterceptTouchEvent(false);
                }
            } else {
                parent.requestDisallowInterceptTouchEvent(true);
            }
        }
    }
项目:SprintNBA    文件:Attacher.java   
@Override public void run() {

            DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();
            if (draweeView == null) {
                return;
            }

            float t = interpolate();
            float scale = mZoomStart + t * (mZoomEnd - mZoomStart);
            float deltaScale = scale / getScale();

            onScale(deltaScale, mFocalX, mFocalY);

            if (t < 1f) {
                postOnAnimation(draweeView, this);
            }
        }
项目:SprintNBA    文件:Attacher.java   
@Override public void run() {
    if (mScroller.isFinished()) {
        return;
    }

    DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

    if (draweeView != null && mScroller.computeScrollOffset()) {
        final int newX = mScroller.getCurrX();
        final int newY = mScroller.getCurrY();
        mMatrix.postTranslate(mCurrentX - newX, mCurrentY - newY);
        draweeView.invalidate();
        mCurrentX = newX;
        mCurrentY = newY;
        postOnAnimation(draweeView, this);
    }
}
项目:AyoSunny    文件:Attacher.java   
public Attacher(DraweeView<GenericDraweeHierarchy> draweeView) {
    mDraweeView = new WeakReference<>(draweeView);
    draweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
    draweeView.setOnTouchListener(this);
    mScaleDragDetector = new ScaleDragDetector(draweeView.getContext(), this);
    mGestureDetector = new GestureDetectorCompat(draweeView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {
                @Override public void onLongPress(MotionEvent e) {
                    super.onLongPress(e);
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getDraweeView());
                    }
                }
            });
    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
}
项目:AyoSunny    文件:Attacher.java   
@Override public void onDrag(float dx, float dy) {

        DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

        if (draweeView != null && !mScaleDragDetector.isScaling()) {
            mMatrix.postTranslate(dx, dy);
            checkMatrixAndInvalidate();

            ViewParent parent = draweeView.getParent();
            if (parent == null) {
                return;
            }

            if (mAllowParentInterceptOnEdge
                    && !mScaleDragDetector.isScaling()
                    && !mBlockParentIntercept) {
                if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f) || (
                        mScrollEdge == EDGE_RIGHT
                                && dx <= -1f)) {
                    parent.requestDisallowInterceptTouchEvent(false);
                }
            } else {
                parent.requestDisallowInterceptTouchEvent(true);
            }
        }
    }
项目:AyoSunny    文件:Attacher.java   
@Override public void run() {

            DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();
            if (draweeView == null) {
                return;
            }

            float t = interpolate();
            float scale = mZoomStart + t * (mZoomEnd - mZoomStart);
            float deltaScale = scale / getScale();

            onScale(deltaScale, mFocalX, mFocalY);

            if (t < 1f) {
                postOnAnimation(draweeView, this);
            }
        }
项目:AyoSunny    文件:Attacher.java   
@Override public void run() {
    if (mScroller.isFinished()) {
        return;
    }

    DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

    if (draweeView != null && mScroller.computeScrollOffset()) {
        final int newX = mScroller.getCurrX();
        final int newY = mScroller.getCurrY();
        mMatrix.postTranslate(mCurrentX - newX, mCurrentY - newY);
        draweeView.invalidate();
        mCurrentX = newX;
        mCurrentY = newY;
        postOnAnimation(draweeView, this);
    }
}
项目:android-jungle-framework    文件:FrescoImageLoaderEngine.java   
private DraweeController createDraweeController(
        DraweeView draweeView, Uri uri, ControllerListener<ImageInfo> listener) {

    JungleSize size = ImageLoaderUtils.getAppropriateSize(draweeView);
    ImageRequest request = ImageRequestBuilder
            .newBuilderWithSource(uri)
            .setResizeOptions(new ResizeOptions(size.mWidth, size.mHeight))
            .setAutoRotateEnabled(true)
            .build();

    return Fresco.newDraweeControllerBuilder()
            .setUri(uri)
            .setImageRequest(request)
            .setControllerListener(listener)
            .setAutoPlayAnimations(true)
            .setOldController(draweeView.getController())
            .build();
}
项目:android-jungle-framework    文件:FrescoImageLoaderEngine.java   
@Override
public JungleSize getAppropriateSize(View view, int width, int height) {
    if (!(view instanceof DraweeView)) {
        return null;
    }

    DraweeView draweeView = (DraweeView) view;
    float ratio = draweeView.getAspectRatio();
    if (ratio > 0) {
        if (width > 0) {
            height = (int) (width / ratio);
        } else if (height > 0) {
            width = (int) (height * ratio);
        }
    }

    return new JungleSize(width, height);
}
项目:droidddle    文件:FrescoUtils.java   
public static final void setShotUrl(DraweeView view, String url, String thumbnail/*, BaseControllerListener listener*/) {
        ImageRequest imageRequest = ImageRequestBuilder.newBuilderWithSource(Uri.parse(url))
//                .setResizeOptions(
//                        new ResizeOptions(300, 400))
                .setProgressiveRenderingEnabled(true)
                .build();
        ImageRequest lowRequest = null;
        if (!TextUtils.isEmpty(thumbnail)) {
            lowRequest = ImageRequest.fromUri(thumbnail);
        }
        DraweeController draweeController = Fresco.newDraweeControllerBuilder()
                .setImageRequest(imageRequest)
                .setLowResImageRequest(lowRequest)
                .setOldController(view.getController())
                .setAutoPlayAnimations(true)
//                .setControllerListener(listener)
                .build();
        view.setController(draweeController);
    }
项目:AndroidImageSelect    文件:Attacher.java   
public Attacher(DraweeView<GenericDraweeHierarchy> draweeView) {
    mDraweeView = new WeakReference<>(draweeView);
    draweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
    draweeView.setOnTouchListener(this);
    mScaleDragDetector = new ScaleDragDetector(draweeView.getContext(), this);
    mGestureDetector = new GestureDetectorCompat(draweeView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {
                @Override public void onLongPress(MotionEvent e) {
                    super.onLongPress(e);
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getDraweeView());
                    }
                }
            });
    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
}
项目:AndroidImageSelect    文件:Attacher.java   
@Override public void onDrag(float dx, float dy) {

        DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

        if (draweeView != null && !mScaleDragDetector.isScaling()) {
            mMatrix.postTranslate(dx, dy);
            checkMatrixAndInvalidate();

            ViewParent parent = draweeView.getParent();
            if (parent == null) {
                return;
            }

            if (mAllowParentInterceptOnEdge
                    && !mScaleDragDetector.isScaling()
                    && !mBlockParentIntercept) {
                if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f) || (
                        mScrollEdge == EDGE_RIGHT
                                && dx <= -1f)) {
                    parent.requestDisallowInterceptTouchEvent(false);
                }
            } else {
                parent.requestDisallowInterceptTouchEvent(true);
            }
        }
    }
项目:AndroidImageSelect    文件:Attacher.java   
@Override public void run() {

            DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();
            if (draweeView == null) {
                return;
            }

            float t = interpolate();
            float scale = mZoomStart + t * (mZoomEnd - mZoomStart);
            float deltaScale = scale / getScale();

            onScale(deltaScale, mFocalX, mFocalY);

            if (t < 1f) {
                postOnAnimation(draweeView, this);
            }
        }
项目:AndroidImageSelect    文件:Attacher.java   
@Override public void run() {
    if (mScroller.isFinished()) {
        return;
    }

    DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

    if (draweeView != null && mScroller.computeScrollOffset()) {
        final int newX = mScroller.getCurrX();
        final int newY = mScroller.getCurrY();
        mMatrix.postTranslate(mCurrentX - newX, mCurrentY - newY);
        draweeView.invalidate();
        mCurrentX = newX;
        mCurrentY = newY;
        postOnAnimation(draweeView, this);
    }
}
项目:TLint    文件:Attacher.java   
public Attacher(DraweeView<GenericDraweeHierarchy> draweeView) {
    mDraweeView = new WeakReference<>(draweeView);
    draweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
    draweeView.setOnTouchListener(this);
    mScaleDragDetector = new ScaleDragDetector(draweeView.getContext(), this);
    mGestureDetector = new GestureDetectorCompat(draweeView.getContext(),
            new GestureDetector.SimpleOnGestureListener() {
                @Override
                public void onLongPress(MotionEvent e) {
                    super.onLongPress(e);
                    if (null != mLongClickListener) {
                        mLongClickListener.onLongClick(getDraweeView());
                    }
                }
            });
    mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
}
项目:TLint    文件:Attacher.java   
@Override
public void onDrag(float dx, float dy) {

    DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

    if (draweeView != null && !mScaleDragDetector.isScaling()) {
        mMatrix.postTranslate(dx, dy);
        checkMatrixAndInvalidate();

        ViewParent parent = draweeView.getParent();
        if (parent == null) {
            return;
        }

        if (mAllowParentInterceptOnEdge
                && !mScaleDragDetector.isScaling()
                && !mBlockParentIntercept) {
            if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f) || (mScrollEdge
                    == EDGE_RIGHT && dx <= -1f)) {
                parent.requestDisallowInterceptTouchEvent(false);
            }
        } else {
            parent.requestDisallowInterceptTouchEvent(true);
        }
    }
}
项目:TLint    文件:Attacher.java   
@Override
public void run() {

    DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();
    if (draweeView == null) {
        return;
    }

    float t = interpolate();
    float scale = mZoomStart + t * (mZoomEnd - mZoomStart);
    float deltaScale = scale / getScale();

    onScale(deltaScale, mFocalX, mFocalY);

    if (t < 1f) {
        postOnAnimation(draweeView, this);
    }
}
项目:TLint    文件:Attacher.java   
@Override
public void run() {
    if (mScroller.isFinished()) {
        return;
    }

    DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

    if (draweeView != null && mScroller.computeScrollOffset()) {
        final int newX = mScroller.getCurrX();
        final int newY = mScroller.getCurrY();
        mMatrix.postTranslate(mCurrentX - newX, mCurrentY - newY);
        draweeView.invalidate();
        mCurrentX = newX;
        mCurrentY = newY;
        postOnAnimation(draweeView, this);
    }
}
项目:PicKing    文件:DefaultOnDoubleTapListener.java   
@Override public boolean onSingleTapConfirmed(MotionEvent e) {

        if (mAttacher == null) {
            return false;
        }
        DraweeView<GenericDraweeHierarchy> draweeView = mAttacher.getDraweeView();
        if (draweeView == null) {
            return false;
        }

        if (mAttacher.getOnPhotoTapListener() != null) {
            final RectF displayRect = mAttacher.getDisplayRect();

            if (null != displayRect) {
                final float x = e.getX(), y = e.getY();
                if (displayRect.contains(x, y)) {
                    float xResult = (x - displayRect.left) / displayRect.width();
                    float yResult = (y - displayRect.top) / displayRect.height();
                    mAttacher.getOnPhotoTapListener().onPhotoTap(draweeView, xResult, yResult);
                    return true;
                }
            }
        }

        if (mAttacher.getOnViewTapListener() != null) {
            mAttacher.getOnViewTapListener().onViewTap(draweeView, e.getX(), e.getY());
            return true;
        }

        return false;
    }
项目:PicKing    文件:Attacher.java   
@Override public void setScale(float scale, float focalX, float focalY, boolean animate) {
    DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

    if (draweeView == null || scale < mMinScale || scale > mMaxScale) {
        return;
    }

    if (animate) {
        draweeView.post(new AnimatedZoomRunnable(getScale(), scale, focalX, focalY));
    } else {
        mMatrix.setScale(scale, scale, focalX, focalY);
        checkMatrixAndInvalidate();
    }
}
项目:PicKing    文件:Attacher.java   
private int getViewHeight() {
    DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();
    if (draweeView != null) {
        return draweeView.getHeight()
                - draweeView.getPaddingTop()
                - draweeView.getPaddingBottom();
    }
    return 0;
}
项目:PicKing    文件:Attacher.java   
public void checkMatrixAndInvalidate() {

        DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

        if (draweeView == null) {
            return;
        }

        if (checkMatrixBounds()) {
            draweeView.invalidate();
        }
    }
项目:PicKing    文件:Attacher.java   
private RectF getDisplayRect(Matrix matrix) {
    DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();
    if (draweeView == null || (mImageInfoWidth == -1 && mImageInfoHeight == -1)) {
        return null;
    }
    mDisplayRect.set(0.0F, 0.0F, mImageInfoWidth, mImageInfoHeight);
    draweeView.getHierarchy().getActualImageBounds(mDisplayRect);
    matrix.mapRect(mDisplayRect);
    return mDisplayRect;
}
项目:PicKing    文件:Attacher.java   
private void resetMatrix() {
    mMatrix.reset();
    checkMatrixBounds();
    DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();
    if (draweeView != null) {
        draweeView.invalidate();
    }
}
项目:PicKing    文件:Attacher.java   
private void checkMinScale() {
    DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();
    if (draweeView == null) {
        return;
    }

    if (getScale() < mMinScale) {
        RectF rect = getDisplayRect();
        if (null != rect) {
            draweeView.post(new AnimatedZoomRunnable(getScale(), mMinScale, rect.centerX(),
                    rect.centerY()));
        }
    }
}
项目:PicKing    文件:Attacher.java   
@Override public void onDrag(float dx, float dy) {

        DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();

        if (draweeView != null && !mScaleDragDetector.isScaling()) {
            mMatrix.postTranslate(dx, dy);
            checkMatrixAndInvalidate();

            ViewParent parent = draweeView.getParent();
            if (parent == null) {
                return;
            }
            if (mAllowParentInterceptOnEdge
                    && !mScaleDragDetector.isScaling()
                    && !mBlockParentIntercept) {
                if (mOrientation == HORIZONTAL && (mScrollEdgeX == EDGE_BOTH || (mScrollEdgeX
                        == EDGE_LEFT && dx >= 1f) || (mScrollEdgeX == EDGE_RIGHT && dx <= -1f))) {
                    parent.requestDisallowInterceptTouchEvent(false);
                } else if (mOrientation == VERTICAL && (mScrollEdgeY == EDGE_BOTH || (mScrollEdgeY
                        == EDGE_TOP && dy >= 1f) || (mScrollEdgeY == EDGE_BOTTOM && dy <= -1f))) {
                    parent.requestDisallowInterceptTouchEvent(false);
                }
            } else {
                parent.requestDisallowInterceptTouchEvent(true);
            }
        }
    }
项目:PicKing    文件:Attacher.java   
@Override public void onFling(float startX, float startY, float velocityX, float velocityY) {
    DraweeView<GenericDraweeHierarchy> draweeView = getDraweeView();
    if (draweeView == null) {
        return;
    }

    mCurrentFlingRunnable = new FlingRunnable(draweeView.getContext());
    mCurrentFlingRunnable.fling(getViewWidth(), getViewHeight(), (int) velocityX,
            (int) velocityY);
    draweeView.post(mCurrentFlingRunnable);
}
项目:GongXianSheng    文件:FrecoFactory.java   
public void setDefaultHierarchy(DraweeView draweeView, Drawable defaultDrawable, ScalingUtils.ScaleType defaultScaleType, ScalingUtils.ScaleType targerScaleType, boolean isCircle) {
        GenericDraweeHierarchy gdh = new GenericDraweeHierarchyBuilder( mContext.getResources())
                .setPlaceholderImage(defaultDrawable, defaultScaleType)
                .setFailureImage(defaultDrawable, ScalingUtils.ScaleType.CENTER_CROP)
//              .setProgressBarImage(new ProgressBarDrawable())
                .setActualImageScaleType(targerScaleType)
                .build();
        if ( isCircle ) {
            gdh.setRoundingParams(RoundingParams.asCircle());
        }
        draweeView.setHierarchy(gdh);
    }