Example usage for android.widget ImageView getParent

List of usage examples for android.widget ImageView getParent

Introduction

In this page you can find the example usage for android.widget ImageView getParent.

Prototype

public final ViewParent getParent() 

Source Link

Document

Gets the parent of this view.

Usage

From source file:com.neo.duan.ui.widget.photoview.PhotoViewAttacher.java

@Override
public void onDrag(float dx, float dy) {
    if (mScaleDragDetector.isScaling()) {
        return; // Do not drag if we are already scaling
    }/* w  ww .  j  a v a 2s .  com*/

    //        if (DEBUG) {
    //            LogManager.getLogger().d(LOG_TAG,
    //                    String.format("onDrag: dx: %.2f. dy: %.2f", dx, dy));
    //        }

    ImageView imageView = getImageView();
    mSuppMatrix.postTranslate(dx, dy);
    checkAndDisplayMatrix();

    /**
     * Here we decide whether to let the ImageView's parent to start taking
     * over the touch event.
     *
     * First we check whether this function is enabled. We never want the
     * parent to take over if we're scaling. We then check the edge we're
     * on, and the direction of the scroll (i.e. if we're pulling against
     * the edge, aka 'overscrolling', let the parent take over).
     */
    ViewParent parent = imageView.getParent();
    if (mAllowParentInterceptOnEdge && !mScaleDragDetector.isScaling() && !mBlockParentIntercept) {
        if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f)
                || (mScrollEdge == EDGE_RIGHT && dx <= -1f)) {
            if (null != parent) {
                parent.requestDisallowInterceptTouchEvent(false);
            }
        }
    } else {
        if (null != parent) {
            parent.requestDisallowInterceptTouchEvent(true);
        }
    }
}

From source file:xue.myapp.common.photoview.PhotoViewAttacher.java

@Override
public void onDrag(float dx, float dy) {
    if (mScaleDragDetector.isScaling()) {
        return; // Do not drag if we are already scaling
    }/*from  w  w  w  .  jav a  2 s .co m*/

    if (DEBUG) {
        LogUtil.d(LOG_TAG, String.format("onDrag: dx: %.2f. dy: %.2f", dx, dy));
    }

    ImageView imageView = getImageView();
    mSuppMatrix.postTranslate(dx, dy);
    checkAndDisplayMatrix();

    /**
     * Here we decide whether to let the ImageView's parent to start taking
     * over the touch event.
     *
     * First we check whether this function is enabled. We never want the
     * parent to take over if we're scaling. We then check the edge we're
     * on, and the direction of the scroll (i.e. if we're pulling against
     * the edge, aka 'overscrolling', let the parent take over).
     */
    ViewParent parent = imageView.getParent();
    if (mAllowParentInterceptOnEdge && !mScaleDragDetector.isScaling() && !mBlockParentIntercept) {
        if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f)
                || (mScrollEdge == EDGE_RIGHT && dx <= -1f)) {
            if (null != parent) {
                parent.requestDisallowInterceptTouchEvent(false);
            }
        }
    } else {
        if (null != parent) {
            parent.requestDisallowInterceptTouchEvent(true);
        }
    }
}

From source file:com.kf5.sdk.system.photoview.PhotoViewAttacher.java

@Override
public void onDrag(float dx, float dy) {
    if (mScaleDragDetector.isScaling()) {
        return; // Do not drag if we are already scaling
    }//  w w w  .  j a v  a2 s .  co m

    if (DEBUG) {
    }

    ImageView imageView = getImageView();
    mSuppMatrix.postTranslate(dx, dy);
    checkAndDisplayMatrix();

    /**
     * Here we decide whether to let the ImageView's parent to start taking
     * over the touch event.
     *
     * First we check whether this function is enabled. We never want the
     * parent to take over if we're scaling. We then check the edge we're
     * on, and the direction of the scroll (i.e. if we're pulling against
     * the edge, aka 'overscrolling', let the parent take over).
     */
    ViewParent parent = imageView.getParent();
    if (mAllowParentInterceptOnEdge && !mScaleDragDetector.isScaling() && !mBlockParentIntercept) {
        if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f)
                || (mScrollEdge == EDGE_RIGHT && dx <= -1f)) {
            if (null != parent)
                parent.requestDisallowInterceptTouchEvent(false);
        }
    } else {
        if (null != parent) {
            parent.requestDisallowInterceptTouchEvent(true);
        }
    }
}

From source file:com.github.lakeshire.photoview.PhotoViewAttacher.java

@Override
public void onDrag(float dx, float dy) {
    if (mScaleDragDetector.isScaling()) {
        return; // Do not drag if we are already scaling
    }/*from   w w  w. j a v a 2  s  .c  o m*/

    if (DEBUG) {
        //            LogManager.getLogger().d(LOG_TAG, String.format("onDrag: dx: %.2f. dy: %.2f", dx, dy));
    }

    ImageView imageView = getImageView();
    mSuppMatrix.postTranslate(dx, dy);
    checkAndDisplayMatrix();

    /**
     * Here we decide whether to let the ImageView's parent to start taking
     * over the touch event.
     *
     * First we check whether this function is enabled. We never want the
     * parent to take over if we're scaling. We then check the edge we're
     * on, and the direction of the scroll (i.e. if we're pulling against
     * the edge, aka 'overscrolling', let the parent take over).
     */
    ViewParent parent = imageView.getParent();
    if (mAllowParentInterceptOnEdge && !mScaleDragDetector.isScaling() && !mBlockParentIntercept) {
        if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f)
                || (mScrollEdge == EDGE_RIGHT && dx <= -1f)) {
            if (null != parent) {
                parent.requestDisallowInterceptTouchEvent(false);
            }
        }
    } else {
        if (null != parent) {
            parent.requestDisallowInterceptTouchEvent(true);
        }
    }
}

From source file:com.example.g40_70m.framedemo.view.photoview.PhotoViewAttacher.java

@Override
public void onDrag(float dx, float dy) {
    if (mScaleDragDetector.isScaling()) {
        return; // Do not drag if we are already scaling
    }//from w ww. jav  a  2  s .c  o m

    if (DEBUG) {
        L.w(String.format("onDrag: dx: %.2f. dy: %.2f", dx, dy));
    }

    ImageView imageView = getImageView();
    mSuppMatrix.postTranslate(dx, dy);
    checkAndDisplayMatrix();

    /**
     * Here we decide whether to let the ImageView's parent to start taking
     * over the touch event.
     *
     * First we check whether this function is enabled. We never want the
     * parent to take over if we're scaling. We then check the edge we're
     * on, and the direction of the scroll (i.e. if we're pulling against
     * the edge, aka 'overscrolling', let the parent take over).
     */
    ViewParent parent = imageView.getParent();
    if (mAllowParentInterceptOnEdge && !mScaleDragDetector.isScaling() && !mBlockParentIntercept) {
        if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f)
                || (mScrollEdge == EDGE_RIGHT && dx <= -1f)) {
            if (null != parent) {
                parent.requestDisallowInterceptTouchEvent(false);
            }
        }
    } else {
        if (null != parent) {
            parent.requestDisallowInterceptTouchEvent(true);
        }
    }
}

From source file:cn.golden.pinchzoomcanvasview.PinchZoomCanvasViewAttacher.java

@Override
public void onDrag(float dx, float dy) {
    if (mScaleDragDetector.isScaling()) {
        return; // Do not drag if we are already scaling
    }// www  .j a  va  2s .com

    if (DEBUG) {
        LogManager.getLogger().d(LOG_TAG, String.format("onDrag: dx: %.2f. dy: %.2f", dx, dy));
    }

    ImageView imageView = getImageView();
    mSuppMatrix.postTranslate(dx, dy);
    checkAndDisplayMatrix();

    /**
     * Here we decide whether to let the ImageView's parent to start taking
     * over the touch event.
     *
     * First we check whether this function is enabled. We never want the
     * parent to take over if we're scaling. We then check the edge we're
     * on, and the direction of the scroll (i.e. if we're pulling against
     * the edge, aka 'overscrolling', let the parent take over).
     */
    ViewParent parent = imageView.getParent();
    if (mAllowParentInterceptOnEdge && !mScaleDragDetector.isScaling() && !mBlockParentIntercept) {
        if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f)
                || (mScrollEdge == EDGE_RIGHT && dx <= -1f)) {
            if (null != parent)
                parent.requestDisallowInterceptTouchEvent(false);
        }
    } else {
        if (null != parent) {
            parent.requestDisallowInterceptTouchEvent(true);
        }
    }
}

From source file:com.zero.pictureselect.Photoview.PhotoViewAttacher.java

@Override
public void onDrag(float dx, float dy) {
    if (mScaleDragDetector.isScaling()) {
        return; // Do not drag if we are already scaling
    }/*from  w ww  . jav a2 s  .c o  m*/

    if (DEBUG) {
        LogManager.getLogger().d(LOG_TAG, String.format("onDrag: dx: %.2f. dy: %.2f", dx, dy));
    }

    ImageView imageView = getImageView();
    mSuppMatrix.postTranslate(dx, dy);
    checkAndDisplayMatrix();

    /**
     * Here we decide whether to let the ImageView's parent to startSelect taking
     * over the touch event.
     *
     * First we check whether this function is enabled. We never want the
     * parent to take over if we're scaling. We then check the edge we're
     * on, and the direction of the scroll (i.e. if we're pulling against
     * the edge, aka 'overscrolling', let the parent take over).
     */
    ViewParent parent = imageView.getParent();
    if (mAllowParentInterceptOnEdge && !mScaleDragDetector.isScaling() && !mBlockParentIntercept) {
        if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f)
                || (mScrollEdge == EDGE_RIGHT && dx <= -1f)) {
            if (null != parent)
                parent.requestDisallowInterceptTouchEvent(false);
        }
    } else {
        if (null != parent) {
            parent.requestDisallowInterceptTouchEvent(true);
        }
    }
}

From source file:com.cylan.jiafeigou.support.photoview.PhotoViewAttacher.java

@Override
public void onDrag(float dx, float dy) {
    if (mScaleDragDetector.isScaling()) {
        return; // Do not drag if we are already scaling
    }//  ww  w. j av a2 s .  c  o  m

    if (DEBUG) {
        //            LogManager.getLogger().d(LOG_TAG,
        //                    String.format("onDrag: dx: %.2f. dy: %.2f", dx, dy));
    }

    ImageView imageView = getImageView();
    mSuppMatrix.postTranslate(dx, dy);
    checkAndDisplayMatrix();

    /**
     * Here we decide whether to let the ImageView'account parent to initSubscription taking
     * over the touch event.
     *
     * First we check whether this function is enabled. We never want the
     * parent to take over if we're scaling. We then check the edge we're
     * on, and the direction of the scroll (i.e. if we're pulling against
     * the edge, aka 'overscrolling', let the parent take over).
     */
    ViewParent parent = imageView.getParent();
    if (mAllowParentInterceptOnEdge && !mScaleDragDetector.isScaling() && !mBlockParentIntercept) {
        if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f)
                || (mScrollEdge == EDGE_RIGHT && dx <= -1f)) {
            if (null != parent) {
                parent.requestDisallowInterceptTouchEvent(false);
            }
        }
    } else {
        if (null != parent) {
            parent.requestDisallowInterceptTouchEvent(true);
        }
    }
}

From source file:com.org.lengend.photoview.library.PhotoViewAttacher.java

@Override
public void onDrag(float dx, float dy) {
    if (mScaleDragDetector.isScaling()) {
        return; // Do not drag if we are already scaling
    }/*  ww w .j av a2  s.  c  om*/

    Logger.d(LOG_TAG, String.format("onDrag: dx: %.2f. dy: %.2f", dx, dy));

    ImageView imageView = getImageView();
    mSuppMatrix.postTranslate(dx, dy);
    checkAndDisplayMatrix();

    /**
     * Here we decide whether to let the ImageView's parent to start taking
     * over the touch event.
     *
     * First we check whether this function is enabled. We never want the
     * parent to take over if we're scaling. We then check the edge we're
     * on, and the direction of the scroll (i.e. if we're pulling against
     * the edge, aka 'overscrolling', let the parent take over).
     */
    ViewParent parent = imageView.getParent();
    if (mAllowParentInterceptOnEdge && !mScaleDragDetector.isScaling() && !mBlockParentIntercept) {
        if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f)
                || (mScrollEdge == EDGE_RIGHT && dx <= -1f)) {
            if (null != parent) {
                parent.requestDisallowInterceptTouchEvent(false);
            }
        }
    } else {
        if (null != parent) {
            parent.requestDisallowInterceptTouchEvent(true);
        }
    }
}

From source file:baizhuan.hangzhou.com.gankcopy.view.customview.photoview.PhotoViewAttacher.java

@Override
public void onDrag(float dx, float dy) {
    if (mScaleDragDetector.isScaling()) {
        return; // Do not drag if we are already scaling
    }/*from   w  w w .j  a  v  a2  s.c  om*/

    if (DEBUG) {
        LogManager.getLogger().d(LOG_TAG, String.format("onDrag: dx: %.2f. dy: %.2f", dx, dy));
    }

    ImageView imageView = getImageView();
    mSuppMatrix.postTranslate(dx, dy);
    checkAndDisplayMatrix();

    /**
     * Here we decide whether to let the ImageView's parent to start taking
     * over the touch event.
     *
     * First we check whether this function is enabled. We never want the
     * parent to take over if we're scaling. We then check the edge we're
     * on, and the direction of the scroll (i.e. if we're pulling against
     * the edge, aka 'overscrolling', let the parent take over).
     */
    ViewParent parent = imageView.getParent();
    if (mAllowParentInterceptOnEdge && !mScaleDragDetector.isScaling() && !mBlockParentIntercept) {
        if (mScrollEdge == EDGE_BOTH || (mScrollEdge == EDGE_LEFT && dx >= 1f)
                || (mScrollEdge == EDGE_RIGHT && dx <= -1f)) {
            if (null != parent) {
                parent.requestDisallowInterceptTouchEvent(false);
            }
        }
    } else {
        if (null != parent) {
            parent.requestDisallowInterceptTouchEvent(true);
        }
    }
}