本文整理匯總了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);
}