android.widget.ImageView.getRight()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(170)

本文整理了Java中android.widget.ImageView.getRight()方法的一些代码示例,展示了ImageView.getRight()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.getRight()方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:getRight

ImageView.getRight介绍

暂无

代码示例

代码示例来源: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: arvinljw/PictureSelector

public void setScale(float scale, boolean animate) {
  setScale(scale,
      (mImageView.getRight()) / 2,
      (mImageView.getBottom()) / 2,
      animate);
}

代码示例来源: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: 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: xenione/beforeafter-effect

private void calculateSwipeBounds() {
  mRightLimit = mBackgroundImage.getRight() - handlerWidth;
  mForegroundView.anchor(mRightLimit, mBackgroundImage.getLeft());
}

代码示例来源: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: 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: 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: 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: 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());
  }
}

代码示例来源:origin: githubwing/WingUE

private void performEnterAnimation() {
 initLocation();
 final float top = getResources().getDisplayMetrics().density * 20;
 final ValueAnimator translateVa = translateVa(mSearchBGTxt.getY(), top);
 final ValueAnimator scaleVa = scaleVa(1, 0.8f);
 final ValueAnimator alphaVa = alphaVa(0, 1f);
 originX = mHintTxt.getX();
 final float leftSpace = mArrowImg.getRight() * 2;
 final ValueAnimator translateVaX = translateVax(originX, leftSpace);
 setDuration(translateVa, scaleVa, translateVaX, alphaVa);
 star(translateVa, scaleVa, translateVaX, alphaVa);
}

相关文章

ImageView类方法