本文整理了Java中android.widget.ImageView.getPaddingRight()
方法的一些代码示例,展示了ImageView.getPaddingRight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.getPaddingRight()
方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:getPaddingRight
暂无
代码示例来源: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: 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: SwiftyWang/FingerColoring-Android
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: albinmathew/PhotoCrop
private int getImageViewWidth(ImageView imageView) {
if (null == imageView)
return 0;
return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
代码示例来源:origin: xu649526275/MyMVPDemo
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: 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: albert-lii/ImageViewer
private int getImageViewWidth(ImageView imageView) {
return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
代码示例来源:origin: MrWangChong/DragPhotoView
private int getImageViewWidth(ImageView imageView) {
return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
代码示例来源: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: stackoverflow.com
final ImageView iv_YourImage = (ImageView) findViewById(R.id.iv_imageview);
public boolean onTouch(View v, MotionEvent event){
int topParam = iv_YourImage.getPaddingTop();
int rightParam = iv_YourImage.getPaddingRight();
int maxTopParam = topParam+iv_YourImage.getMaxHeight();
int maxRightParam = rightParam + iv_YourImage.getMaxWidth();
if(event.getX>topParam&&event.getX<maxTopParam){
//the x coordinate is in your image... do the same to Y
}
return true;
}
代码示例来源:origin: stackoverflow.com
ImageView imageView = (ImageView) findViewById(R.id.iv_imageview);
imageView.setOnTouchListener(new OnTouchListener(){
@Override
public boolean onTouch(View v, MotionEvent event) {
int topParam = imageView.getPaddingTop();
int rightParam = imageView.getPaddingRight();
int maxTopParam = topParam+imageView.getMaxHeight();
int maxRightParam = rightParam + imageView.getMaxWidth();
if(event.getX>topParam&&event.getX<maxTopParam){
//the x coordinate is in your image... do the same to Y
}
});
return true;
}
内容来源于网络,如有侵权,请联系作者删除!