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

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

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

ImageView.getPaddingLeft介绍

暂无

代码示例

代码示例来源:origin: chrisbanes/PhotoView

private int getImageViewWidth(ImageView imageView) {
  return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}

代码示例来源:origin: androidquery/androidquery

private int getWidth(ImageView iv){
  
  int width = 0;
  
  LayoutParams lp = iv.getLayoutParams();
  if(lp != null) width = lp.width;
  
  if(width <= 0){
    width = iv.getWidth();
  }
  
  if(width > 0){
    width = width - iv.getPaddingLeft() - iv.getPaddingRight();
  }
  
  return width;
}

代码示例来源:origin: androidquery/androidquery

private void draw(Canvas canvas, ImageView iv, Bitmap bm){
  
  
  Matrix m = getMatrix(iv, bm);    
  
  if(m != null){
    int vpad = iv.getPaddingTop() + iv.getPaddingBottom();
    int hpad = iv.getPaddingLeft() + iv.getPaddingRight();
    if(vpad > 0 || hpad > 0){
      canvas.clipRect(0, 0, iv.getWidth() - hpad, iv.getHeight() - vpad);
    }
    canvas.drawBitmap(bm, m, getPaint());
  }
  
  if(!adjusted){
    adjust(iv, bm, true);
  }
  
}

代码示例来源:origin: stackoverflow.com

public static int[] getBitmapOffset(ImageView img,  Boolean includeLayout) {
   int[] offset = new int[2];
   float[] values = new float[9];
   Matrix m = img.getImageMatrix();
   m.getValues(values);
   offset[0] = (int) values[5];
   offset[1] = (int) values[2];
   if (includeLayout) {
     ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) img.getLayoutParams();
     int paddingTop = (int) (img.getPaddingTop() );
     int paddingLeft = (int) (img.getPaddingLeft() );
     offset[0] += paddingTop + lp.topMargin;
     offset[1] += paddingLeft + lp.leftMargin;
   }
   return offset;
 }

代码示例来源:origin: wangdan/AisenWeiBo

lp.height = defHeight + coverHeight;
imgCover.setLayoutParams(lp);
imgCover.setPadding(imgCover.getPaddingLeft(), imgCover.getPaddingTop(), imgCover.getPaddingRight(), defHeight);

代码示例来源:origin: recruit-lifestyle/FloatingView

/**
 * 削除アイコンの中心X座標を取得します。
 *
 * @return 削除アイコンの中心X座標
 */
float getTrashIconCenterX() {
  final ImageView iconView = hasActionTrashIcon() ? mActionTrashIconView : mFixedTrashIconView;
  final float iconViewPaddingLeft = iconView.getPaddingLeft();
  final float iconWidth = iconView.getWidth() - iconViewPaddingLeft - iconView.getPaddingRight();
  final float x = mTrashIconRootView.getX() + iconViewPaddingLeft;
  return x + iconWidth / 2;
}

代码示例来源:origin: recruit-lifestyle/FloatingView

/**
 * Window上での描画領域を取得します。
 * 当たり判定の矩形を表します。
 *
 * @param outRect 変更を加えるRect
 */
void getWindowDrawingRect(Rect outRect) {
  // Gravityが逆向きなので、矩形の当たり判定も上下逆転(top/bottom)
  // top(画面上で下方向)の判定を多めに設定
  final ImageView iconView = hasActionTrashIcon() ? mActionTrashIconView : mFixedTrashIconView;
  final float iconPaddingLeft = iconView.getPaddingLeft();
  final float iconPaddingTop = iconView.getPaddingTop();
  final float iconWidth = iconView.getWidth() - iconPaddingLeft - iconView.getPaddingRight();
  final float iconHeight = iconView.getHeight() - iconPaddingTop - iconView.getPaddingBottom();
  final float x = mTrashIconRootView.getX() + iconPaddingLeft;
  final float y = mRootView.getHeight() - mTrashIconRootView.getY() - iconPaddingTop - iconHeight;
  final int left = (int) (x - TARGET_CAPTURE_HORIZONTAL_REGION * mMetrics.density);
  final int top = -mRootView.getHeight();
  final int right = (int) (x + iconWidth + TARGET_CAPTURE_HORIZONTAL_REGION * mMetrics.density);
  final int bottom = (int) (y + iconHeight + TARGET_CAPTURE_VERTICAL_REGION * mMetrics.density);
  outRect.set(left, top, right, bottom);
}

代码示例来源:origin: com.googlecode.android-query/android-query

private int getWidth(ImageView iv){
  
  int width = 0;
  
  LayoutParams lp = iv.getLayoutParams();
  if(lp != null) width = lp.width;
  
  if(width <= 0){
    width = iv.getWidth();
  }
  
  if(width > 0){
    width = width - iv.getPaddingLeft() - iv.getPaddingRight();
  }
  
  return width;
}

代码示例来源:origin: xu649526275/MyMVPDemo

private int getImageViewWidth(ImageView imageView) {
  if (null == imageView)
    return 0;
  return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}

代码示例来源:origin: SwiftyWang/FingerColoring-Android

private int getImageViewWidth(ImageView imageView) {
  if (null == imageView)
    return 0;
  return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}

代码示例来源:origin: MukeshKumar009/EcomSample

private int getImageViewWidth(ImageView imageView) {
  if (null == imageView)
    return 0;
  return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}

代码示例来源:origin: albinmathew/PhotoCrop

private int getImageViewWidth(ImageView imageView) {
  if (null == imageView)
    return 0;
  return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}

代码示例来源:origin: Meiqia/MeiqiaSDK-Android

protected int getImageViewWidth(ImageView imageView) {
  if (null == imageView)
    return 0;
  return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}

代码示例来源:origin: SuperKotlin/PictureViewer

private int getImageViewWidth(ImageView imageView) {
  if (null == imageView)
    return 0;
  return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}

代码示例来源:origin: albert-lii/ImageViewer

private int getImageViewWidth(ImageView imageView) {
  return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}

代码示例来源:origin: arvinljw/PictureSelector

private int getImageViewWidth(ImageView imageView) {
  return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}

代码示例来源:origin: wufenglincheng/ImageTrans

private int getImageViewWidth(ImageView imageView) {
  return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}

代码示例来源:origin: derry/delion

/**
 * @return The left offset for the suggestion type icon that aligns it with the url bar.
 */
private int getSuggestionIconLeftPosition() {
  if (mNavigationButton == null) return 0;
  // Ensure the suggestion icon matches the location of the navigation icon in the omnibox
  // perfectly.
  mNavigationButton.getLocationOnScreen(mViewPositionHolder);
  int navButtonXPosition = mViewPositionHolder[0] + mNavigationButton.getPaddingLeft();
  getLocationOnScreen(mViewPositionHolder);
  return navButtonXPosition - mViewPositionHolder[0];
}

代码示例来源:origin: com.googlecode.android-query/android-query

private void draw(Canvas canvas, ImageView iv, Bitmap bm){
  
  
  Matrix m = getMatrix(iv, bm);    
  
  if(m != null){
    int vpad = iv.getPaddingTop() + iv.getPaddingBottom();
    int hpad = iv.getPaddingLeft() + iv.getPaddingRight();
    if(vpad > 0 || hpad > 0){
      canvas.clipRect(0, 0, iv.getWidth() - hpad, iv.getHeight() - vpad);
    }
    canvas.drawBitmap(bm, m, getPaint());
  }
  
  if(!adjusted){
    adjust(iv, bm, true);
  }
  
}

代码示例来源:origin: ianhanniballake/TripleSolitaire

/**
 * Gets the screen location for the top card in the waste
 *
 * @return The exact (x,y) position of the top card in the waste
 */
private Point getWasteLoc() {
  final RelativeLayout waste = findViewById(R.id.waste);
  final ImageView waste1View = findViewById(R.id.waste1);
  final float x = waste.getX() + waste.getPaddingLeft() + waste1View.getX() + waste1View.getPaddingLeft();
  final float y = waste.getY() + waste.getPaddingTop() + waste1View.getY() + waste1View.getPaddingTop();
  return new Point((int) x, (int) y);
}

相关文章

ImageView类方法