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

The following examples show how to use android.widget.ImageView#getPaddingLeft() . 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 check out the related API usage on the sidebar.
Example 1
Source File: TrashView.java    From dingo with 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 File: TrashView.java    From FloatingView with 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 3
Source File: PagedViewWidget.java    From TurboLauncher with 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 4
Source File: TrashView.java    From dingo with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 削除アイコンの中心X座標を取得します。
 *
 * @return 削除アイコンの中心X座標
 */
float getTrashIconCenterX() {
    final ImageView iconView = hasActionTrashIcon() ? mActionTrashIconView : mFixedTrashIconView;
    final float iconViewPaddingLeft = iconView.getPaddingLeft();
    final float iconWidth = iconView.getWidth() - iconViewPaddingLeft - iconView.getPaddingRight();
    final float x = mTrashIconRootView.getX() + iconViewPaddingLeft;
    return x + iconWidth / 2;
}
 
Example 5
Source File: PhotoViewAttacher.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
 
Example 6
Source File: PhotoViewAttacher.java    From UltimateAndroid with Apache License 2.0 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
 
Example 7
Source File: ImageViewScaler.java    From MultiView with Apache License 2.0 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
 
Example 8
Source File: PhotoViewAttacher.java    From narrate-android with Apache License 2.0 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
 
Example 9
Source File: PhotoViewAttacher.java    From light-novel-library_Wenku8_Android with GNU General Public License v2.0 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
 
Example 10
Source File: PhotoViewAttacher.java    From GalleryFinal with Apache License 2.0 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
 
Example 11
Source File: PhotoViewAttacher.java    From ZoomPreviewPicture with Apache License 2.0 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
 
Example 12
Source File: PhotoViewAttacher.java    From Android with MIT License 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
 
Example 13
Source File: PhotoViewAttacher.java    From star-zone-android with Apache License 2.0 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
 
Example 14
Source File: PhotoViewAttacher.java    From ImagePicker with Apache License 2.0 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView)
{
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
 
Example 15
Source File: PhotoViewAttacher.java    From Matisse-Kotlin with Apache License 2.0 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView) {
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
 
Example 16
Source File: PhotoViewAttacher.java    From OmniList with GNU Affero General Public License v3.0 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
 
Example 17
Source File: PhotoViewAttacher.java    From PhotoViewer with Apache License 2.0 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView) {
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
 
Example 18
Source File: PhotoViewAttacher.java    From imsdk-android with MIT License 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView) {
    if (null == imageView)
        return 0;
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
 
Example 19
Source File: PhotoViewAttacher.java    From imsdk-android with MIT License 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView) {
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}
 
Example 20
Source File: PhotoViewAttacher.java    From giffun with Apache License 2.0 4 votes vote down vote up
private int getImageViewWidth(ImageView imageView) {
    return imageView.getWidth() - imageView.getPaddingLeft() - imageView.getPaddingRight();
}