Example usage for android.view View getBottom

List of usage examples for android.view View getBottom

Introduction

In this page you can find the example usage for android.view View getBottom.

Prototype

@ViewDebug.CapturedViewProperty
public final int getBottom() 

Source Link

Document

Bottom position of this view relative to its parent.

Usage

From source file:Main.java

public static int getSlideOutYDistance(View view) {
    return -view.getBottom();
}

From source file:Main.java

public static float getViewY(View view) {
    return Math.abs((view.getBottom() - view.getTop()) / 2);
}

From source file:Main.java

static public Rect getFrame(View v) {
    return new Rect(v.getLeft(), v.getTop(), v.getRight(), v.getBottom());
}

From source file:Main.java

/**
 * Returns a bitmap from the views drawing cache. Warining: disables drawing
 * cache after usage./*from   www.j  a v  a  2  s.  co m*/
 * 
 * @param view
 * @return
 */
public static Bitmap getBitmapFromView(View view) {
    view.setDrawingCacheEnabled(true);
    view.layout(0, 0, view.getWidth(), view.getBottom());
    view.buildDrawingCache();
    Bitmap bitmap = Bitmap.createBitmap(view.getDrawingCache());
    view.setDrawingCacheEnabled(false);
    return bitmap;
}

From source file:Main.java

public static void invalidateGlobalRegion(View view) {
    invalidateGlobalRegion(view, new RectF(view.getLeft(), view.getTop(), view.getRight(), view.getBottom()));
}

From source file:Main.java

static public Rect getPaddedFrame(View v) {
    return new Rect(v.getLeft() + v.getPaddingLeft(), v.getTop() + v.getPaddingTop(),
            v.getRight() - v.getPaddingRight(), v.getBottom() - v.getPaddingBottom());
}

From source file:Main.java

public static boolean pointInView(View view, float localX, float localY) {
    return localX >= 0 && localX < (view.getRight() - view.getLeft()) && localY >= 0
            && localY < (view.getBottom() - view.getTop());
}

From source file:Main.java

public static void drawRightAlignItem(Canvas canvas, Drawable drawable, View child,
        ViewGroup.MarginLayoutParams params) {

    final int top = child.getTop() - params.topMargin;
    final int bottom = child.getBottom() + params.bottomMargin;
    final int left = child.getRight() + params.rightMargin;
    final int right = left + drawable.getIntrinsicWidth();

    drawable.setBounds(left, top, right, bottom);
    drawable.draw(canvas);// w  w w .jav a  2s  . co m
}

From source file:Main.java

public static void drawLeftAlignItem(Canvas canvas, Drawable drawable, View child,
        ViewGroup.MarginLayoutParams params) {

    final int top = child.getTop() - params.topMargin;
    final int bottom = child.getBottom() + params.bottomMargin;
    final int left = child.getLeft() - params.leftMargin - drawable.getIntrinsicWidth();
    final int right = left + drawable.getIntrinsicWidth();

    drawable.setBounds(left, top, right, bottom);

    drawable.draw(canvas);//  w w  w . j  a va 2 s. c o m
}

From source file:Main.java

public static boolean isMotionOnView(View view, MotionEvent event) {
    final float x = event.getX();
    final float y = event.getY();
    if (x < view.getRight() && x > view.getLeft() && y < view.getBottom() && y > view.getTop()) {
        return true;
    }/*from  w  w w. ja va 2 s . c  o  m*/
    return false;
}