Java Code Examples for android.widget.ImageView#getPaddingTop()

The following examples show how to use android.widget.ImageView#getPaddingTop() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: dingo   File: TrashView.java    License: GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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);
}
 
Example 2
Source Project: TurboLauncher   File: PagedViewWidget.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void onFinishInflate() {
    super.onFinishInflate();

    final ImageView image = (ImageView) findViewById(R.id.widget_preview);
    mOriginalImagePadding.left = image.getPaddingLeft();
    mOriginalImagePadding.top = image.getPaddingTop();
    mOriginalImagePadding.right = image.getPaddingRight();
    mOriginalImagePadding.bottom = image.getPaddingBottom();

    // Ensure we are using the right text size
    LauncherAppState app = LauncherAppState.getInstance();
    DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
    TextView name = (TextView) findViewById(R.id.widget_name);
    if (name != null) {
        name.setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.iconTextSizePx);
    }
    TextView dims = (TextView) findViewById(R.id.widget_dims);
    if (dims != null) {
        dims.setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.iconTextSizePx);
    }
}
 
Example 3
Source Project: FloatingView   File: TrashView.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example 4
private int getImageViewHeight(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 5
Source Project: giffun   File: PhotoViewAttacher.java    License: Apache License 2.0 4 votes vote down vote up
private int getImageViewHeight(ImageView imageView) {
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 6
private int getImageViewHeight(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 7
private int getImageViewHeight(ImageView imageView) {
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 8
Source Project: imsdk-android   File: PhotoViewAttacher.java    License: MIT License 4 votes vote down vote up
private int getImageViewHeight(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 9
Source Project: PhotoViewer   File: PhotoViewAttacher.java    License: Apache License 2.0 4 votes vote down vote up
private int getImageViewHeight(ImageView imageView) {
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 10
private int getImageViewHeight(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 11
private int getImageViewHeight(ImageView imageView) {
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 12
Source Project: ImagePicker   File: PhotoViewAttacher.java    License: Apache License 2.0 4 votes vote down vote up
private int getImageViewHeight(ImageView imageView)
{
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 13
private int getImageViewHeight(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 14
private int getImageViewHeight(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 15
private int getImageViewHeight(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 16
private int getImageViewHeight(ImageView imageView) {
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 17
private int getImageViewHeight(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 18
private int getImageViewHeight(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 19
Source Project: Album   File: PhotoViewAttacher.java    License: Apache License 2.0 4 votes vote down vote up
private int getImageViewHeight(ImageView imageView) {
    if (null == imageView) return 0;
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}
 
Example 20
private int getImageViewHeight(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getHeight() - imageView.getPaddingTop() - imageView.getPaddingBottom();
}