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:com.camnter.newlife.widget.decorator.DividerItemDecoration.java

public void drawVertical(Canvas c, RecyclerView parent) {
    final int left = parent.getPaddingLeft();
    final int right = parent.getWidth() - parent.getPaddingRight();

    final int childCount = parent.getChildCount();
    for (int i = 0; i < childCount - 1; i++) {
        final View child = parent.getChildAt(i);
        final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
        final int top = child.getBottom() + params.bottomMargin + Math.round(ViewCompat.getTranslationY(child));
        final int bottom = top + mDivider.getIntrinsicHeight();
        mDivider.setBounds(left, top, right, bottom);
        mDivider.draw(c);//from w w  w  . ja  v a2s .c o  m
    }
}

From source file:com.bitdubai.fermat_android_api.ui.util.FermatDividerItemDecoration.java

public void drawVertical(Canvas canvas, RecyclerView parent) {
    final int left = parent.getPaddingLeft();
    final int right = parent.getWidth() - parent.getPaddingRight();

    final int childCount = parent.getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View child = parent.getChildAt(i);
        final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
        final int top = child.getBottom() + params.bottomMargin;
        final int bottom = top + mDivider.getIntrinsicHeight();

        mDivider.setBounds(left, top, right, bottom);
        mDivider.draw(canvas);/*from  ww  w. j av a  2 s.c o m*/
    }
}

From source file:com.example.lz.android_recycler_view_sample.DividerListItemDecoration.java

public void drawVertical(Canvas c, RecyclerView parent) {
    final int left = parent.getPaddingLeft();
    final int right = parent.getWidth() - parent.getPaddingRight();
    final int childCount = parent.getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View child = parent.getChildAt(i);
        final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
        final int top = child.getBottom() + params.bottomMargin;
        final int bottom = top + mDividerHeight;
        if (mDivider != null) {
            mDivider.setBounds(left, top, right, bottom);
            mDivider.draw(c);/*from  w  w w.j av  a  2  s  .  c o m*/
        }
        if (mPaint != null) {
            c.drawRect(left, top, right, bottom, mPaint);
        }
    }
}

From source file:com.yu.common.widget.ListItemDecoration.java

public void drawVertical(Canvas c, RecyclerView parent) {
    final int left = parent.getPaddingLeft();
    final int right = parent.getWidth() - parent.getPaddingRight();

    final int childCount = parent.getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View child = parent.getChildAt(i);
        final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
        final int top = child.getBottom() + params.bottomMargin + Math.round(ViewCompat.getTranslationY(child));
        final int bottom = top + getDividerHeight();
        mDivider.setBounds(left, top, right, bottom);
        mDivider.draw(c);/*  w w  w.  j a  v  a2s  .c  o  m*/
    }
}

From source file:com.pachong.android.baseuicomponent.DividerItemDecoration.java

public void drawVertical(Canvas c, RecyclerView parent) {
    final int left = parent.getPaddingLeft();
    final int right = parent.getWidth() - parent.getPaddingRight();

    final int childCount = parent.getChildCount();
    for (int i = 0; i < childCount; i++) {
        if (!shouldDrawItemAt(parent, i)) {
            continue;
        }/*from  w w w.  ja  v a 2  s  .  co  m*/
        final View child = parent.getChildAt(i);
        final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
        final int top = child.getBottom() + params.bottomMargin + Math.round(ViewCompat.getTranslationY(child));
        final int bottom = top + mDivider.getIntrinsicHeight();
        mDivider.setBounds(left, top, right, bottom);
        mDivider.draw(c);
    }
}

From source file:com.example.aqing.materialdesign.deleteitem.DividerItemDecoration.java

public void drawVertical(Canvas c, RecyclerView parent) {
    final int left = parent.getPaddingLeft();
    final int right = parent.getWidth() - parent.getPaddingRight();

    final int childCount = parent.getChildCount();
    for (int i = 0; i < childCount - 1; i++) {
        final View child = parent.getChildAt(i);
        final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
        final int top = child.getBottom() + params.bottomMargin + Math.round(ViewCompat.getTranslationY(child));
        final int bottom = top + dividerHeight;

        c.drawRect(left, top, left + startpadding, bottom, mPaddingPaint);
        c.drawRect(right - endpadding, top, right, bottom, mPaddingPaint);
        c.drawRect(left + startpadding, top, right - endpadding, bottom, mDividerPaint);
    }/*  ww w  .j a  va2 s  .  com*/
}

From source file:com.e.library.widget.decorator.EDividerDecoration.java

public void drawVertical(Canvas c, RecyclerView parent) {
    final int left = parent.getPaddingLeft() + mLeftPadding;
    final int right = parent.getWidth() - parent.getPaddingRight() - mRightPadding;

    final int childCount = parent.getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View child = parent.getChildAt(i);
        final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
        final int top = child.getBottom() + params.bottomMargin + Math.round(ViewCompat.getTranslationY(child));
        final int bottom = top + mDivider.getIntrinsicHeight();
        mDivider.setBounds(left, top, right, bottom);
        mDivider.draw(c);//from   w  w  w  .j  a v  a 2  s .  c om
    }
}

From source file:com.android.calculator2.CalculatorPadViewPager.java

@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
    boolean shouldIntercept = super.onInterceptTouchEvent(ev);

    // Only allow the current item to receive touch events.
    if (!shouldIntercept && ev.getActionMasked() == MotionEvent.ACTION_DOWN) {
        final int x = (int) ev.getX() + getScrollX();
        final int y = (int) ev.getY() + getScrollY();

        final int childCount = getChildCount();
        for (int i = childCount - 1; i >= 0; --i) {
            final int childIndex = getChildDrawingOrder(childCount, i);
            final View child = getChildAt(childIndex);
            if (child.getVisibility() == View.VISIBLE && x >= child.getLeft() && x < child.getRight()
                    && y >= child.getTop() && y < child.getBottom()) {
                shouldIntercept = (childIndex != getCurrentItem());
                break;
            }//from  www  .j  a  va 2  s . c  o m
        }
    }

    return shouldIntercept;
}

From source file:com.flexible.flexibleadapter.common.DividerItemDecoration.java

private void draw(Canvas c, RecyclerView parent) {
    int left = parent.getPaddingLeft();
    int right = parent.getWidth() - parent.getPaddingRight();

    int childCount = parent.getChildCount();
    for (int i = 0; i < childCount; i++) {
        View child = parent.getChildAt(i);

        RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();

        int top = child.getBottom() + params.bottomMargin + Math.round(ViewCompat.getTranslationY(child));
        int bottom = top + mDivider.getIntrinsicHeight() + 1;

        mDivider.setBounds(left, top, right, bottom);
        mDivider.draw(c);/*from  www  .  j a va 2s .c o m*/
    }
}

From source file:com.example.zjy.niklauslibrary.rvhelper.divider.DividerItemDecoration.java

public void drawVertical(Canvas c, RecyclerView parent) {
    final int left = parent.getPaddingLeft();
    final int right = parent.getWidth() - parent.getPaddingRight();

    final int childCount = parent.getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View child = parent.getChildAt(i);
        RecyclerView v = new RecyclerView(parent.getContext());
        final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
        final int top = child.getBottom() + params.bottomMargin;
        final int bottom = top + mDivider.getIntrinsicHeight();
        mDivider.setBounds(left, top, right, bottom);
        mDivider.draw(c);//from   w ww.ja v a  2  s .  c o m
    }
}