本文整理汇总了Java中android.widget.ImageView.getX方法的典型用法代码示例。如果您正苦于以下问题:Java ImageView.getX方法的具体用法?Java ImageView.getX怎么用?Java ImageView.getX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ImageView
的用法示例。
在下文中一共展示了ImageView.getX方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: maybeInitProperties
import android.widget.ImageView; //导入方法依赖的package包/类
private void maybeInitProperties(ImageView child, View dependency) {
if (mStartYPosition == 0)
mStartYPosition = (int) (dependency.getY());
if (mFinalYPosition == 0)
mFinalYPosition = (dependency.getHeight() /2);
if (mStartHeight == 0)
mStartHeight = child.getHeight();
if (mStartXPosition == 0)
mStartXPosition = (int) (child.getX() + (child.getWidth() / 2));
if (mFinalXPosition == 0)
mFinalXPosition = mContext.getResources().getDimensionPixelOffset(R.dimen.abc_action_bar_content_inset_material) + ((int) mCustomFinalHeight / 2);
if (mStartToolbarPosition == 0)
mStartToolbarPosition = dependency.getY();
if (mChangeBehaviorPoint == 0) {
mChangeBehaviorPoint = (child.getHeight() - mCustomFinalHeight) / (2f * (mStartYPosition - mFinalYPosition));
}
}
示例2: maybeInitProperties
import android.widget.ImageView; //导入方法依赖的package包/类
@SuppressLint("PrivateResource")
private void maybeInitProperties(ImageView child, View dependency) {
if (startYPosition == 0)
startYPosition = (int) (dependency.getY());
if (finalYPosition == 0)
finalYPosition = (dependency.getHeight() / 2);
if (startHeight == 0)
startHeight = child.getHeight();
if (finalHeight == 0)
finalHeight = context.getResources().getDimensionPixelOffset(R.dimen.image_small_width);
if (startXPosition == 0)
startXPosition = (int) (child.getX() + (child.getWidth() / 2));
if (finalXPosition == 0)
finalXPosition = context.getResources().getDimensionPixelOffset(R.dimen.abc_action_bar_content_inset_material) + (finalHeight / 2);
if (startToolbarPosition == 0)
startToolbarPosition = dependency.getY() + (dependency.getHeight() / 2);
}
示例3: cropBitmap
import android.widget.ImageView; //导入方法依赖的package包/类
/**
* Crop the bitmap to only the part of the scansegment. The bitmap should only contain the part
* that displays the MRZ of a travel document.
* @param bitmap - The bitmap created from the camerapreview
* @param scanSegment - Scansegment, the segment that should be scanned with OCR
* @return
*/
public static Bitmap cropBitmap(Bitmap bitmap, ImageView scanSegment) {
int startX = (int) scanSegment.getX();
int startY = (int) scanSegment.getY();
int width = scanSegment.getWidth();
int length = scanSegment.getHeight();
return Bitmap.createBitmap(bitmap, startX, startY, width, length);
}
示例4: getScanRect
import android.widget.ImageView; //导入方法依赖的package包/类
/**
* Get the scan rectangle.
* @return The rectangle.
*/
public static Rect getScanRect(ImageView scanSegment) {
int startX = (int) scanSegment.getX();
int startY = (int) scanSegment.getY();
int width = scanSegment.getWidth();
int length = scanSegment.getHeight();
return new Rect(startX, startY, startX + width, startY + length);
}