當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageView.getX方法代碼示例

本文整理匯總了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));
    }
}
 
開發者ID:appteam-nith,項目名稱:Nimbus,代碼行數:24,代碼來源:TeamLogoBehavior.java

示例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);
}
 
開發者ID:FarshidABZ,項目名稱:CoordinatorBehavior,代碼行數:24,代碼來源:ImageBehavior.java

示例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);
}
 
開發者ID:digital-voting-pass,項目名稱:polling-station-app,代碼行數:15,代碼來源:CameraFragmentUtil.java

示例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);
}
 
開發者ID:digital-voting-pass,項目名稱:polling-station-app,代碼行數:12,代碼來源:CameraFragmentUtil.java


注:本文中的android.widget.ImageView.getX方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。