本文整理了Java中android.widget.ImageView.getBottom()
方法的一些代码示例,展示了ImageView.getBottom()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.getBottom()
方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:getBottom
暂无
代码示例来源:origin: chrisbanes/PhotoView
public void setScale(float scale, boolean animate) {
setScale(scale,
(mImageView.getRight()) / 2,
(mImageView.getBottom()) / 2,
animate);
}
代码示例来源:origin: jiangqqlmj/FastDev4Android
@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;
}
}
}
代码示例来源:origin: wangdan/AisenWeiBo
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;
}
}
}
代码示例来源:origin: wangdan/AisenWeiBo
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;
}
}
}
代码示例来源:origin: stackoverflow.com
//any image view
//must be assigned before use by findViewByID(int id)
ImageView image_view = null;
@Override
public boolean onTouchEvent(MotionEvent event) {
//boundary of your image view
Rect rect = new Rect(image_view.getLeft(),image_view.getTop(),image_view.getRight(),image_view.getBottom());
//if point is inside rect then test_collision = true, else test_collision = false
boolean test_collision = rect.contains((int)event.getX(), (int)event.getY());
return super.onTouchEvent(event);
}
代码示例来源:origin: stackoverflow.com
Rect rect = new Rect();
ImageView iV = new ImageView();
rect.left = iV.getLeft();
rect.top = iV.getTop();
rect.bottom = iV.getBottom();
rect.right = iV.getRight();
代码示例来源:origin: arvinljw/PictureSelector
public void setScale(float scale, boolean animate) {
setScale(scale,
(mImageView.getRight()) / 2,
(mImageView.getBottom()) / 2,
animate);
}
代码示例来源:origin: albert-lii/ImageViewer
public void setScale(float scale, boolean animate) {
setScale(scale,
(mImageView.getRight()) / 2,
(mImageView.getBottom()) / 2,
animate);
}
代码示例来源:origin: MrWangChong/DragPhotoView
public void setScale(float scale, boolean animate) {
setScale(scale,
(mImageView.getRight()) / 2,
(mImageView.getBottom()) / 2,
animate);
}
代码示例来源:origin: stackoverflow.com
ImageView iv = //Code to find the image view
Rect rect = new Rect(iv.getLeft(), iv.getTop(), iv.getRight(), iv.getBottom());
lv.requestChildRectangleOnScreen(lv, rect, false);
代码示例来源:origin: SwiftyWang/FingerColoring-Android
@Override
public void setScale(float scale, boolean animate) {
ImageView imageView = getImageView();
if (null != imageView) {
setScale(scale,
(imageView.getRight()) / 2,
(imageView.getBottom()) / 2,
animate);
}
}
代码示例来源:origin: SuperKotlin/PictureViewer
@Override
public void setScale(float scale, boolean animate) {
ImageView imageView = getImageView();
if (null != imageView) {
setScale(scale,
(imageView.getRight()) / 2,
(imageView.getBottom()) / 2,
animate);
}
}
代码示例来源:origin: MukeshKumar009/EcomSample
@Override
public void setScale(float scale, boolean animate) {
ImageView imageView = getImageView();
if (null != imageView) {
setScale(scale,
(imageView.getRight()) / 2,
(imageView.getBottom()) / 2,
animate);
}
}
代码示例来源:origin: xu649526275/MyMVPDemo
@Override
public void setScale(float scale, boolean animate) {
ImageView imageView = getImageView();
if (null != imageView) {
setScale(scale,
(imageView.getRight()) / 2,
(imageView.getBottom()) / 2,
animate);
}
}
代码示例来源:origin: albinmathew/PhotoCrop
@Override
public void setScale(float scale, boolean animate) {
ImageView imageView = getImageView();
if (null != imageView) {
setScale(scale,
(imageView.getRight()) / 2,
(imageView.getBottom()) / 2,
animate);
}
}
代码示例来源:origin: Meiqia/MeiqiaSDK-Android
@Override
public void setScale(float scale, boolean animate) {
ImageView imageView = getImageView();
if (null != imageView) {
setScale(scale,
(imageView.getRight()) / 2,
(imageView.getBottom()) / 2,
animate);
}
}
代码示例来源:origin: ckj375/Android-Sticker
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_FOR_PICTURE && resultCode == RESULT_OK) {
String imgPath = data.getStringExtra(MaterialActivity.MATERIAL_PATH);
// 贴图容器中心点
int centerX = (img.getLeft() + img.getRight()) / 2;
int centerY = (img.getTop() + img.getBottom()) / 2;
Log.v(TAG, "centerX=" + centerX + " centerY=" + centerY);
StickerView view = new StickerView(mContext, imgPath);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.CENTER_IN_PARENT);
view.setLayoutParams(params);
mStickerLayout.addView(view);
}
}
代码示例来源:origin: stackoverflow.com
ImageView view = .....
int centerX = (view.getLeft() + view.getRight())/2;
int centerY = (view.getTop() + view.getBottom())/2;
代码示例来源:origin: stackoverflow.com
ImageView imageView=(ImageView)findViewById(R.id.dot_image);
int x=imageView.getRight()-imageView.getLeft();
int y=imageView.getBottom()-imageView.getTop();
TranslateAnimation translate = new TranslateAnimation(
Animation.ABSOLUTE,x, Animation.ABSOLUTE,
x, Animation.ABSOLUTE,y,
Animation.ABSOLUTE,yPosition);
translate.setDuration(150);
translate.setFillEnabled(true);
translate.setFillAfter(true);
imageView.startAnimation(translate);
代码示例来源:origin: wuyr/CatchPiggy
private void layoutDropView(Item item) {
MyLayoutParams layoutParams = (MyLayoutParams) mDropView.getLayoutParams();
if (layoutParams.isDrag) {
mDropView.layout(mDropView.getLeft() + layoutParams.x, mDropView.getTop() + layoutParams.y,
mDropView.getRight() + layoutParams.x, mDropView.getBottom() + layoutParams.y);
} else {
mDropView.layout(0, 0, mDropView.getLayoutParams().width, mDropView.getLayoutParams().height);
mDropView.layout((int) item.getX() - (mDropView.getWidth() - item.getWidth()),
item.getBottom() - mDropView.getHeight(), (int) item.getX() + mDropView.getWidth(), item.getBottom());
}
}
内容来源于网络,如有侵权,请联系作者删除!