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

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

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

ImageView.getPaddingBottom介绍

暂无

代码示例

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

private int getImageViewHeight(ImageView imageView) {
  return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}

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

private void adjust(ImageView iv, Bitmap bm, boolean done){
  
  int vw = getWidth(iv);
  if(vw <= 0) return;
  
  int dw = bm.getWidth();
  int dh = bm.getHeight();
  
  
  int th = targetHeight(dw, dh, vw) + iv.getPaddingTop() + iv.getPaddingBottom();
    
  LayoutParams lp = iv.getLayoutParams();
  if(lp == null) return;
  
  int vh = lp.height;
  
  
  if(th != vh){
    
    lp.height = th;
    iv.setLayoutParams(lp);
        
  }
  
  if(done) adjusted = true;	
}

代码示例来源: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: recruit-lifestyle/FloatingView

/**
 * 削除アイコンの中心Y座標を取得します。
 *
 * @return 削除アイコンの中心Y座標
 */
float getTrashIconCenterY() {
  final ImageView iconView = hasActionTrashIcon() ? mActionTrashIconView : mFixedTrashIconView;
  final float iconViewHeight = iconView.getHeight();
  final float iconViewPaddingBottom = iconView.getPaddingBottom();
  final float iconHeight = iconViewHeight - iconView.getPaddingTop() - iconViewPaddingBottom;
  final float y = mRootView.getHeight() - mTrashIconRootView.getY() - iconViewHeight + iconViewPaddingBottom;
  return y + iconHeight / 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: albinmathew/PhotoCrop

private int getImageViewHeight(ImageView imageView) {
  if (null == imageView)
    return 0;
  return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}

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

private int getImageViewHeight(ImageView imageView) {
  if (null == imageView)
    return 0;
  return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}

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

protected int getImageViewHeight(ImageView imageView) {
  if (null == imageView)
    return 0;
  return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}

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

private int getImageViewHeight(ImageView imageView) {
  if (null == imageView)
    return 0;
  return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}

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

private int getImageViewHeight(ImageView imageView) {
  if (null == imageView)
    return 0;
  return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}

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

private int getImageViewHeight(ImageView imageView) {
  if (null == imageView)
    return 0;
  return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}

代码示例来源:origin: MrWangChong/DragPhotoView

private int getImageViewHeight(ImageView imageView) {
  return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}

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

private int getImageViewHeight(ImageView imageView) {
  return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}

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

private int getImageViewHeight(ImageView imageView) {
  return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}

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

private int getImageViewHeight(ImageView imageView) {
  return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}

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

private int getImageViewHeight(ImageView imageView) {
  return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}

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

private void adjust(ImageView iv, Bitmap bm, boolean done){
  
  int vw = getWidth(iv);
  if(vw <= 0) return;
  
  int dw = bm.getWidth();
  int dh = bm.getHeight();
  
  
  int th = targetHeight(dw, dh, vw) + iv.getPaddingTop() + iv.getPaddingBottom();
    
  LayoutParams lp = iv.getLayoutParams();
  if(lp == null) return;
  
  int vh = lp.height;
  
  
  if(th != vh){
    
    lp.height = th;
    iv.setLayoutParams(lp);
        
  }
  
  if(done) adjusted = true;	
}

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

@Override
  protected void onBindView(View view) {
    super.onBindView(view);

    int padding = getContext().getResources().getDimensionPixelSize(
        R.dimen.site_setttings_icon_padding);
    ImageView icon = (ImageView) view.findViewById(android.R.id.icon);
    icon.setPadding(padding, icon.getPaddingTop(), 0, icon.getPaddingBottom());
  }
}

代码示例来源:origin: adolfAn/FBReader_AS

protected final void setIcon(ImageView imageView, ZLTree<?> tree) {
    if (tree.hasChildren()) {
      if (isOpen(tree)) {
        imageView.setImageResource(R.drawable.ic_list_group_open);
      } else {
        imageView.setImageResource(R.drawable.ic_list_group_closed);
      }
    } else {
      imageView.setImageResource(R.drawable.ic_list_group_empty);
    }
    imageView.setPadding(25 * (tree.Level - 1), imageView.getPaddingTop(), 0, imageView.getPaddingBottom());
  }
}

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

相关文章

ImageView类方法