Example usage for android.widget ImageView getBottom

List of usage examples for android.widget ImageView getBottom

Introduction

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

Prototype

@ViewDebug.CapturedViewProperty
public final int getBottom() 

Source Link

Document

Bottom position of this view relative to its parent.

Usage

From source file:Main.java

private static void updateImageViewAfterScaleTypeChange(ImageView imageView) {
    // enforcing imageView to update its internal bounds/matrix immediately
    imageView.measure(MeasureSpec.makeMeasureSpec(imageView.getMeasuredWidth(), MeasureSpec.EXACTLY),
            MeasureSpec.makeMeasureSpec(imageView.getMeasuredHeight(), MeasureSpec.EXACTLY));
    imageView.layout(imageView.getLeft(), imageView.getTop(), imageView.getRight(), imageView.getBottom());
}

From source file:it.configure.imageloader.zoom.PhotoViewAttacher.java

@Override
public final void onGlobalLayout() {
    ImageView imageView = getImageView();

    if (null != imageView && mZoomEnabled) {
        final int top = imageView.getTop();
        final int right = imageView.getRight();
        final int bottom = imageView.getBottom();
        final int left = imageView.getLeft();

        /**// w  w w  . j a v  a 2s  .co m
         * We need to check whether the ImageView's bounds have changed.
         * This would be easier if we targeted API 11+ as we could just use
         * View.OnLayoutChangeListener. Instead we have to replicate the
         * work, keeping track of the ImageView's bounds and then checking
         * if the values change.
         */
        if (top != mIvTop || bottom != mIvBottom || left != mIvLeft || right != mIvRight) {
            // Update our base matrix, as the bounds have changed
            updateBaseMatrix(imageView.getDrawable());

            // Update values as something has changed
            mIvTop = top;
            mIvRight = right;
            mIvBottom = bottom;
            mIvLeft = left;
        }
    }
}

From source file:uk.co.senab.photoview.PhotoViewAttacher.java

public void setScale(float scale, boolean animate) {
    ImageView imageView = getImageView();

    if (null != imageView) {
        setScale(scale, (imageView.getRight()) / 2, (imageView.getBottom()) / 2, animate);
    }//  ww w  .j av a  2s  .c  om
}

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

@Override
public void setScale(float scale, boolean animate) {
    ImageView imageView = getImageView();

    if (null != imageView) {
        setScale(scale, (imageView.getRight()) / 2, (imageView.getBottom()) / 2, animate);
    }/*from w w  w  .j  a v a  2 s  .  c  o  m*/
}

From source file:uk.co.senab.photoview.PhotoViewAttacher.java

@Override
public void onGlobalLayout() {
    ImageView imageView = getImageView();

    if (null != imageView) {
        if (mZoomEnabled) {
            final int top = imageView.getTop();
            final int right = imageView.getRight();
            final int bottom = imageView.getBottom();
            final int left = imageView.getLeft();

            /**/*from w w  w  .j  a  v a 2  s  .  c  om*/
             * We need to check whether the ImageView's bounds have changed.
             * This would be easier if we targeted API 11+ as we could just use
             * View.OnLayoutChangeListener. Instead we have to replicate the
             * work, keeping track of the ImageView's bounds and then checking
             * if the values change.
             */
            if (top != mIvTop || bottom != mIvBottom || left != mIvLeft || right != mIvRight) {
                // Update our base matrix, as the bounds have changed
                updateBaseMatrix();

                // Update values as something has changed
                mIvTop = top;
                mIvRight = right;
                mIvBottom = bottom;
                mIvLeft = left;
            }
        } else {
            updateBaseMatrix();
        }

        if (!firstTimeRendered) {
            firstTimeRendered = true;
            renderBitmap();
        }
        calculateCurrentImageMatrix();
        imageView.setImageMatrix(currentImageMatrix);
    }
}

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

@Override
public void onGlobalLayout() {
    ImageView imageView = getImageView();

    if (null != imageView) {
        if (mZoomEnabled) {
            final int top = imageView.getTop();
            final int right = imageView.getRight();
            final int bottom = imageView.getBottom();
            final int left = imageView.getLeft();

            /**//  ww  w.  ja va  2s  .co m
             * We need to check whether the ImageView's bounds have changed.
             * This would be easier if we targeted IChatModel 11+ as we could just use
             * View.OnLayoutChangeListener. Instead we have to replicate the
             * work, keeping track of the ImageView's bounds and then checking
             * if the values change.
             */
            if (top != mIvTop || bottom != mIvBottom || left != mIvLeft || right != mIvRight) {
                // Update our base matrix, as the bounds have changed
                updateBaseMatrix(imageView.getDrawable());

                // Update values as something has changed
                mIvTop = top;
                mIvRight = right;
                mIvBottom = bottom;
                mIvLeft = left;
            }
        } else {
            updateBaseMatrix(imageView.getDrawable());
        }
    }
}

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

@Override
public void onGlobalLayout() {
    ImageView imageView = getImageView();

    if (null != imageView) {
        if (mZoomEnabled) {
            final int top = imageView.getTop();
            final int right = imageView.getRight();
            final int bottom = imageView.getBottom();
            final int left = imageView.getLeft();

            /**//from  ww w.  j a v a 2s  .  com
             * We need to check whether the ImageView'account bounds have changed.
             * This would be easier if we targeted API 11+ as we could just use
             * View.OnLayoutChangeListener. Instead we have to replicate the
             * work, keeping track of the ImageView'account bounds and then checking
             * if the values change.
             */
            if (top != mIvTop || bottom != mIvBottom || left != mIvLeft || right != mIvRight) {
                // Update our base matrix, as the bounds have changed
                updateBaseMatrix(imageView.getDrawable());

                // Update values as something has changed
                mIvTop = top;
                mIvRight = right;
                mIvBottom = bottom;
                mIvLeft = left;
            }
        } else {
            updateBaseMatrix(imageView.getDrawable());
        }
    }
}

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

@Override
public void onGlobalLayout() {
    ImageView imageView = getImageView();
    if (null != imageView) {
        if (mZoomEnabled) {
            final int top = imageView.getTop();
            final int right = imageView.getRight();
            final int bottom = imageView.getBottom();
            final int left = imageView.getLeft();

            /**/*from w  w w  .  j  a  va2  s .c  om*/
             * We need to check whether the ImageView's bounds have changed.
             * This would be easier if we targeted API 11+ as we could just use
             * View.OnLayoutChangeListener. Instead we have to replicate the
             * work, keeping track of the ImageView's bounds and then checking
             * if the values change.
             */
            if (top != mIvTop || bottom != mIvBottom || left != mIvLeft || right != mIvRight) {
                // Update our base matrix, as the bounds have changed
                updateBaseMatrix(imageView.getDrawable());

                // Update values as something has changed
                mIvTop = top;
                mIvRight = right;
                mIvBottom = bottom;
                mIvLeft = left;
            }
        } else {
            if (!isInEdit) {
                updateBaseMatrix(imageView.getDrawable());
            }
        }
    }
}

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

@Override
public void onGlobalLayout() {
    ImageView imageView = getImageView();

    if (null != imageView) {
        if (mZoomEnabled) {
            final int top = imageView.getTop();
            final int right = imageView.getRight();
            final int bottom = imageView.getBottom();
            final int left = imageView.getLeft();

            /**/*from   w  ww . jav  a  2 s .c  o m*/
             * We need to check whether the ImageView's bounds have changed.
             * This would be easier if we targeted API 11+ as we could just use
             * View.OnLayoutChangeListener. Instead we have to replicate the
             * work, keeping track of the ImageView's bounds and then checking
             * if the values change.
             */
            if (top != mIvTop || bottom != mIvBottom || left != mIvLeft || right != mIvRight) {
                // Update our base matrix, as the bounds have changed
                updateBaseMatrix(imageView.getDrawable());

                // Update values as something has changed
                mIvTop = top;
                mIvRight = right;
                mIvBottom = bottom;
                mIvLeft = left;
            }
        } else {
            updateBaseMatrix(imageView.getDrawable());
        }
    }
}

From source file:com.mooc.viewpage_photoview_circleindicator.photoview.PhotoViewAttacher.java

@Override
public void onGlobalLayout() {
    ImageView imageView = getImageView();

    if (null != imageView) {
        if (mZoomEnabled) {
            final int top = imageView.getTop();
            final int right = imageView.getRight();
            final int bottom = imageView.getBottom();
            final int left = imageView.getLeft();

            /**//  ww  w  . j a v  a 2  s.com
             * We need to check whether the ImageView's bounds have changed.
             * This would be easier if we targeted API 11+ as we could just use
             * View.OnLayoutChangeListener. Instead we have to replicate the
             * work, keeping track of the ImageView's bounds and then checking
             * if the values change.
             * ?
             */

            if (top != mIvTop || bottom != mIvBottom || left != mIvLeft || right != mIvRight) {
                // Update our base matrix, as the bounds have changed
                updateBaseMatrix(imageView.getDrawable(), false);

                // Update values as something has changed
                mIvTop = top;
                mIvRight = right;
                mIvBottom = bottom;
                mIvLeft = left;
            }
        } else {
            updateBaseMatrix(imageView.getDrawable(), false);
        }
    }
}