Example usage for android.graphics Rect set

List of usage examples for android.graphics Rect set

Introduction

In this page you can find the example usage for android.graphics Rect set.

Prototype

public void set(int left, int top, int right, int bottom) 

Source Link

Document

Set the rectangle's coordinates to the specified values.

Usage

From source file:ciriti.retrofitmockserver.widget.DividerItemDecoration.java

@Override
public void getItemOffsets(Rect outRect, int itemPosition, RecyclerView parent) {
    if (mOrientation == VERTICAL_LIST) {
        outRect.set(0, 0, 0, mDivider.getIntrinsicHeight());
    } else {// w w  w . j  av a  2s. c  om
        outRect.set(0, 0, mDivider.getIntrinsicWidth(), 0);
    }
}

From source file:com.kodisoft.waiter.tools.DividerItemDecoration.java

@Override
public void getItemOffsets(Rect outRect, int itemPosition, RecyclerView parent) {
    if (mOrientation == VERTICAL_LIST) {
        outRect.set(0, 0, 0, mDividerFull.getIntrinsicHeight());
    } else {/*from   ww  w .j  a v a  2  s .  c o m*/
        outRect.set(0, 0, mDividerFull.getIntrinsicWidth(), 0);
    }
}

From source file:com.ahamed.sample.common.decorator.ThickItemDecorator.java

@Override
public void getItemOffsets(Rect outRect, int position, int positionType) {
    if (positionType == POSITION_LAST_ITEM) {
        return;//  www  .ja v  a  2  s  .  co m
    }
    outRect.set(0, 0, 0, mDivider.getIntrinsicHeight() * 4);
}

From source file:de.geeksfactory.opacclient.ui.AccountDividerItemDecoration.java

@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
    if (isDecorated(view, parent)) {
        outRect.set(0, 0, 0, mDividerWithInset.getIntrinsicHeight());
    }//  ww w .  j  av  a  2 s  . c o m
}

From source file:com.example.nwilde.myfirstapp.SimpleListDividerDecorator.java

@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
    if (mOverlap) {
        outRect.set(0, 0, 0, 0);
    } else {//w w  w .j av a 2 s . c om
        outRect.set(0, 0, 0, mDividerHeight);
    }
}

From source file:android.support.designox.widget.HeaderScrollingViewBehavior.java

@Override
protected void layoutChild(final CoordinatorLayout parent, final View child, final int layoutDirection) {
    final List<View> dependencies = parent.getDependencies(child);
    final View header = findFirstDependency(dependencies);

    if (header != null) {
        final CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) child.getLayoutParams();
        final Rect available = mTempRect1;
        available.set(parent.getPaddingLeft() + lp.leftMargin, header.getBottom() + lp.topMargin,
                parent.getWidth() - parent.getPaddingRight() - lp.rightMargin,
                parent.getHeight() + header.getBottom() - parent.getPaddingBottom() - lp.bottomMargin);

        final Rect out = mTempRect2;
        GravityCompat.apply(resolveGravity(lp.gravity), child.getMeasuredWidth(), child.getMeasuredHeight(),
                available, out, layoutDirection);

        final int overlap = getOverlapPixelsForOffset(header);

        child.layout(out.left, out.top - overlap, out.right, out.bottom - overlap);
        mVerticalLayoutGap = out.top - header.getBottom();
    } else {//from   w ww .java  2 s. com
        // If we don't have a dependency, let super handle it
        super.layoutChild(parent, child, layoutDirection);
        mVerticalLayoutGap = 0;
    }
}

From source file:app.iamin.iamin.ui.recyclerview.DividerItemDecoration.java

@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
    if (mOrientation == VERTICAL_LIST) {
        outRect.set(0, 0, 0, mDivider.getIntrinsicHeight());
    } else {//from  w  ww .jav  a  2s. c  o  m
        outRect.set(0, 0, mDivider.getIntrinsicWidth(), 0);
    }
}

From source file:com.boredream.bdcodehelper.view.DividerItemDecoration.java

@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
    //        outRect.set(0, 0, 0, mDivider.getIntrinsicHeight());
    outRect.set(0, 0, 0, 1);
}

From source file:wistcat.overtime.widget.DividerItemDecoration.java

@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
    if (mOrientation == HORIZONTAL) {
        outRect.set(0, 0, 0, mDivider.getIntrinsicHeight());
    } else if (mOrientation == VERTICAL) {
        outRect.set(0, 0, mDivider.getIntrinsicWidth(), 0);
    }/*from  w  w  w . j a v a  2  s  .c  o m*/
}

From source file:ca.co.rufus.androidboilerplate.ui.misc.DividerItemDecoration.java

@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
    if (orientation == VERTICAL_LIST) {
        outRect.set(0, 0, 0, divider.getIntrinsicHeight());
    } else {//from  w  w w  .j  av  a  2  s  .  co  m
        outRect.set(0, 0, divider.getIntrinsicWidth(), 0);
    }
}