Refine search
public static void drawBottomAlignItem(Canvas canvas, Drawable drawable, View child, ViewGroup.MarginLayoutParams params) { final int left = child.getLeft() - params.leftMargin; final int right = child.getRight() + params.rightMargin; final int top = child.getBottom() + params.bottomMargin; final int bottom = top + drawable.getIntrinsicHeight(); drawable.setBounds(left, top, right, bottom); drawable.draw(canvas); }
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); }
public int getBottom() { //find biggest value. int bottom = Integer.MIN_VALUE; int childCount = getChildCount(); for( int index = 0; index < childCount; ++index ){ View v = getChildAt(index); if(v.getLeft() != mColumnLeft && isFixedView(v) == false ) continue; bottom = bottom < v.getBottom() ? v.getBottom() : bottom; } if( bottom == Integer.MIN_VALUE ) return mSynchedBottom; //no child for this column.. return bottom; }
private void captureValues(TransitionValues transitionValues) { final View view = transitionValues.view; if (view == null || view.getWidth() <= 0 || view.getHeight() <= 0) return; transitionValues.values.put(PROP_BOUNDS, new Rect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom())); } }
public static void drawBottom(Canvas canvas, Drawable drawable, View child, ViewGroup.MarginLayoutParams params) { final int left = child.getLeft() - params.leftMargin - drawable.getIntrinsicWidth(); final int right = child.getRight() + params.rightMargin + drawable.getIntrinsicWidth(); final int top = child.getBottom() + params.bottomMargin; final int bottom = top + drawable.getIntrinsicHeight(); drawable.setBounds(left, top, right, bottom); drawable.draw(canvas); }
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); }
public static void drawLeft(Canvas canvas, Drawable drawable, View child, ViewGroup.MarginLayoutParams params) { final int top = child.getTop() - params.topMargin - drawable.getIntrinsicHeight(); final int bottom = child.getBottom() + params.bottomMargin + drawable.getIntrinsicHeight(); final int left = child.getLeft() - params.leftMargin - drawable.getIntrinsicWidth(); final int right = left + drawable.getIntrinsicWidth(); drawable.setBounds(left, top, right, bottom); drawable.draw(canvas); }
public void drawHorizontal(Canvas c, RecyclerView parent) { 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 left = child.getLeft() - params.leftMargin; final int right = child.getRight() + params.rightMargin + mDivider.getIntrinsicWidth(); final int top = child.getBottom() + params.bottomMargin; final int bottom = top + mDivider.getIntrinsicHeight(); mDivider.setBounds(left, top, right, bottom); mDivider.draw(c); } }
public void drawVertical(Canvas c, RecyclerView parent) { 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.getTop() - params.topMargin; final int bottom = child.getBottom() + params.bottomMargin; final int left = child.getRight() + params.rightMargin; final int right = left + mDivider.getIntrinsicWidth(); mDivider.setBounds(left, top, right, bottom); mDivider.draw(c); } }
public void drawHorizontal(Canvas c, RecyclerView parent) { 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 left = child.getLeft() - params.leftMargin; final int right = child.getRight() + params.rightMargin + mDivider.getIntrinsicWidth(); final int top = child.getBottom() + params.bottomMargin; final int bottom = top + mDivider.getIntrinsicHeight(); mDivider.setBounds(left, top, right, bottom); mDivider.draw(c); } }
public static void drawRight(Canvas canvas, Drawable drawable, View child, ViewGroup.MarginLayoutParams params) { final int top = child.getTop() - params.topMargin - drawable.getIntrinsicHeight(); final int bottom = child.getBottom() + params.bottomMargin + drawable.getIntrinsicHeight(); final int left = child.getRight() + params.rightMargin; final int right = left + drawable.getIntrinsicWidth(); drawable.setBounds(left, top, right, bottom); drawable.draw(canvas); }
/** * Determine if the supplied view is under the given point in the * parent view's coordinate system. * * @param view Child view of the parent to hit test * @param x X position to test in the parent's coordinate system * @param y Y position to test in the parent's coordinate system * @return true if the supplied view is under the given point, false otherwise */ public boolean isViewUnder(View view, int x, int y) { if (view == null) { return false; } return x >= view.getLeft() && x < view.getRight() && y >= view.getTop() && y < view.getBottom(); }
/** * {@inheritDoc} */ @Override public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) { int count = parent.getChildCount(); for (int i = 0; i < count; i++) { final View child = parent.getChildAt(i); final int top = child.getBottom(); final int bottom = top + mHeight; int left = child.getLeft() + mLPadding; int right = child.getRight() - mRPadding; c.save(); c.drawRect(left, top, right, bottom, mPaint); c.restore(); } }
public void drawVertical(Canvas c, RecyclerView parent) { 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.getTop() - params.topMargin; final int bottom = child.getBottom() + params.bottomMargin; final int left = child.getRight() + params.rightMargin; final int right = left + mDivider.getIntrinsicWidth(); mDivider.setBounds(left, top, right, bottom); mDivider.draw(c); } }