Example usage for android.widget ImageView getRight

List of usage examples for android.widget ImageView getRight

Introduction

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

Prototype

@ViewDebug.CapturedViewProperty
public final int getRight() 

Source Link

Document

Right 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:com.quran.labs.androidquran.widgets.IconPageIndicator.java

@Override
protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    int count = mIconsLayout.getChildCount();
    ImageView v = (ImageView) mIconsLayout.getChildAt(mSelectedIndex);
    final int bottom = v.getHeight();
    final int top = bottom - mIndicatorHeight;
    int left = v.getLeft();
    int right = v.getRight();

    if (mSelectedIndex + 1 < count) {
        View nextIcon = mIconsLayout.getChildAt(mSelectedIndex + 1);
        left = (int) (mSelectionOffset * nextIcon.getLeft() + (1.0f - mSelectionOffset) * left);
        right = (int) (mSelectionOffset * nextIcon.getRight() + (1.0f - mSelectionOffset) * right);
    }/*w ww . jav  a 2  s.c o  m*/

    mIndicatorPaint.setColor(mIndicatorColor);
    canvas.drawRect(left, top, right, bottom, mIndicatorPaint);
}

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();

        /**/*from  w  w  w . jav a2s .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  a  va 2 s  .com*/
}

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 ww  w  .j  a va  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  ww w . java 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();

                // 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();

            /**/*from   w w w.  jav  a 2  s.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  w  w w  .j  ava 2s .  co m
             * 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  .java  2 s . 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;
            }
        } 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();

            /**/*  ww w .  ja  va 2s . 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());
        }
    }
}