当前位置: 首页>>代码示例>>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;未经允许,请勿转载。