android.widget.ImageView#getTop ( )源码实例Demo

下面列出了android.widget.ImageView#getTop ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: UltimateAndroid   文件: 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();

            /**
             * 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());
        }
    }
}
 
源代码2 项目: iBeebo   文件: 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();

        /**
         * 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;
        }
    }
}
 
源代码3 项目: OmniList   文件: 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();

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

		/**
		 * 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;
		}
	}
}
 
源代码5 项目: MultiView   文件: ImageViewScaler.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();

            /**
             * 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());
        }
    }
}
 
源代码6 项目: ZoomPreviewPicture   文件: 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();

            /**
             * 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());
        }
    }
}
 
源代码7 项目: UltimateAndroid   文件: PanningViewAttacher.java
@Override
public void onGlobalLayout() {
	ImageView imageView = getImageView();

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

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

			// Update values as something has changed
			mIvTop = top;
			mIvRight = right;
			mIvBottom = bottom;
			mIvLeft = left;
		}
	}
}
 
源代码8 项目: Social   文件: 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();

		/**
		 * 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;
		}
	}
}
 
源代码9 项目: ViewPagerHelper   文件: CircleIndicator.java
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
    super.onLayout(changed, l, t, r, b);

    ImageView child = (ImageView) getChildAt(0);
    if (child != null) {
        float cl;
        float cr;
        if (mType == CircleIndicatorType.CIRTORECT) {
            int offset = (mRectWidth - mSize) / 2;
            cl = child.getLeft() - offset;
            cr = cl + mRectWidth;
        } else {
            cl = child.getLeft();
            cr = cl + child.getMeasuredWidth();

        }
        float ct = child.getTop();

        float cb = ct + child.getMeasuredHeight();
        mRect.set(cl, ct, cr, cb);
        mMoveSize = mMargin + mSize;

        int currentItem = mViewPager.getCurrentItem();
        if (mType == CircleIndicatorType.SCALE) {
            if (currentItem % mCount == 0) {
                doScaleAnim(child, ANIM_OUT);
            }
        }

        moveToPosition(mViewPager.getCurrentItem());

    }
}
 
源代码10 项目: Dashboard   文件: 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();

        /**
         * 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;
        }
    }
}
 
源代码11 项目: RotatePhotoView   文件: 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();

            /**
             * 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());
        }
    }
}
 
源代码12 项目: narrate-android   文件: 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();

            /**
             * 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());
        }
    }
}
 
源代码13 项目: BlackLight   文件: 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();

            /**
             * 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());
        }
    }
}
 
源代码14 项目: LLApp   文件: 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();

		/**
		 * 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;
		}
	}
}
 
源代码15 项目: android-project-wo2b   文件: PhotoViewAttacher.java
@Override
public final 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();

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

            /**
             * 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());
        }
    }
}
 
源代码17 项目: Study_Android_Demo   文件: 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();

		/**
		 * 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;
		}
	}
}
 
源代码18 项目: aurora-imui   文件: 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();

		/**
		 * 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;
		}
	}
}
 
源代码19 项目: Album   文件: 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();

            /**
             * 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());
        }
    }
}
 
源代码20 项目: FanXin-based-HuanXin   文件: 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();

		/**
		 * 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;
		}
	}
}