private int getEdgesTouched(int x, int y) { int result = 0; if (x < mParentView.getLeft() + mEdgeSize) result |= EDGE_LEFT; if (y < mParentView.getTop() + mEdgeSize) result |= EDGE_TOP; if (x > mParentView.getRight() - mEdgeSize) result |= EDGE_RIGHT; if (y > mParentView.getBottom() - mEdgeSize) result |= EDGE_BOTTOM; return result; } }
private Rect getChildRectInPagerCoordinates(Rect outRect, View child) { if (outRect == null) { outRect = new Rect(); } if (child == null) { outRect.set(0, 0, 0, 0); return outRect; } outRect.left = child.getLeft(); outRect.right = child.getRight(); outRect.top = child.getTop(); outRect.bottom = child.getBottom(); ViewParent parent = child.getParent(); while (parent instanceof ViewGroup && parent != this) { final ViewGroup group = (ViewGroup) parent; outRect.left += group.getLeft(); outRect.right += group.getRight(); outRect.top += group.getTop(); outRect.bottom += group.getBottom(); parent = group.getParent(); } return outRect; }
private Rect getChildRectInPagerCoordinates(Rect outRect, View child) { if (outRect == null) { outRect = new Rect(); } if (child == null) { outRect.set(0, 0, 0, 0); return outRect; } outRect.left = child.getLeft(); outRect.right = child.getRight(); outRect.top = child.getTop(); outRect.bottom = child.getBottom(); ViewParent parent = child.getParent(); while (parent instanceof ViewGroup && parent != this) { final ViewGroup group = (ViewGroup) parent; outRect.left += group.getLeft(); outRect.right += group.getRight(); outRect.top += group.getTop(); outRect.bottom += group.getBottom(); parent = group.getParent(); } return outRect; }
private Rect getChildRectInPagerCoordinates(Rect outRect, View child) { if (outRect == null) { outRect = new Rect(); } if (child == null) { outRect.set(0, 0, 0, 0); return outRect; } outRect.left = child.getLeft(); outRect.right = child.getRight(); outRect.top = child.getTop(); outRect.bottom = child.getBottom(); ViewParent parent = child.getParent(); while (parent instanceof ViewGroup && parent != this) { final ViewGroup group = (ViewGroup) parent; outRect.left += group.getLeft(); outRect.right += group.getRight(); outRect.top += group.getTop(); outRect.bottom += group.getBottom(); parent = group.getParent(); } return outRect; }
private int getEdgesTouched(int x, int y) { int result = 0; if (x < mParentView.getLeft() + mEdgeSize) result |= EDGE_LEFT; if (y < mParentView.getTop() + mEdgeSize) result |= EDGE_TOP; if (x > mParentView.getRight() - mEdgeSize) result |= EDGE_RIGHT; if (y > mParentView.getBottom() - mEdgeSize) result |= EDGE_BOTTOM; return result; }
private int getEdgeTouched(int x, int y) { int result = 0; if (x < mParentView.getLeft() + mEdgeSize) result = EDGE_LEFT; if (y < mParentView.getTop() + mEdgeSize) result = EDGE_TOP; if (x > mParentView.getRight() - mEdgeSize) result = EDGE_RIGHT; if (y > mParentView.getBottom() - mEdgeSize) result = EDGE_BOTTOM; return result; } }
private int getEdgeTouched(int x, int y) { int result = 0; if (x < mParentView.getLeft() + mEdgeSize) result = EDGE_LEFT; if (y < mParentView.getTop() + mEdgeSize) result = EDGE_TOP; if (x > mParentView.getRight() - mEdgeSize) result = EDGE_RIGHT; if (y > mParentView.getBottom() - mEdgeSize) result = EDGE_BOTTOM; return result; } }
private int getEdgeTouched(int x, int y) { int result = 0; if (x < mParentView.getLeft() + mEdgeSize) result = EDGE_LEFT; if (y < mParentView.getTop() + mEdgeSize) result = EDGE_TOP; if (x > mParentView.getRight() - mEdgeSize) result = EDGE_RIGHT; if (y > mParentView.getBottom() - mEdgeSize) result = EDGE_BOTTOM; return result; } }
when(mountedView.getTop()).thenReturn(0); when(mountedView.getRight()).thenReturn(100); when(mountedView.getBottom()).thenReturn(100); when(mountedView.getChildCount()).thenReturn(3);
private Rect getChildRectInPagerCoordinates(Rect outRect, View child) { if (outRect == null) { outRect = new Rect(); } if (child == null) { outRect.set(0, 0, 0, 0); return outRect; } outRect.left = child.getLeft(); outRect.right = child.getRight(); outRect.top = child.getTop(); outRect.bottom = child.getBottom(); ViewParent parent = child.getParent(); while (parent instanceof ViewGroup && parent != this) { final ViewGroup group = (ViewGroup) parent; outRect.left += group.getLeft(); outRect.right += group.getRight(); outRect.top += group.getTop(); outRect.bottom += group.getBottom(); parent = group.getParent(); } return outRect; }
private int getEdgesTouched(int x, int y) { int result = 0; if (x < mParentView.getLeft() + mEdgeSize) result |= EDGE_LEFT; if (y < mParentView.getTop() + mEdgeSize) result |= EDGE_TOP; if (x > mParentView.getRight() - mEdgeSize) result |= EDGE_RIGHT; if (y > mParentView.getBottom() - mEdgeSize) result |= EDGE_BOTTOM; return result; } }
private int getEdgeTouched(int x, int y) { int result = 0; if (x < mParentView.getLeft() + mEdgeSize) result = EDGE_LEFT; if (y < mParentView.getTop() + mEdgeSize) result = EDGE_TOP; if (x > mParentView.getRight() - mEdgeSize) result = EDGE_RIGHT; if (y > mParentView.getBottom() - mEdgeSize) result = EDGE_BOTTOM; return EDGE_LEFT; } }
private int getEdgeTouched(int x, int y) { int result = 0; if (x < mParentView.getLeft() + mEdgeSize) result = EDGE_LEFT; if (y < mParentView.getTop() + mEdgeSize) result = EDGE_TOP; if (x > mParentView.getRight() - mEdgeSize) result = EDGE_RIGHT; if (y > mParentView.getBottom() - mEdgeSize) result = EDGE_BOTTOM; return result; } }
private void drawDivider(int expPosition, Canvas canvas) { final Drawable divider = getDivider(); final int dividerHeight = getDividerHeight(); // Log.d("mobeta", "div="+divider+" divH="+dividerHeight); if (divider != null && dividerHeight != 0) { final ViewGroup expItem = (ViewGroup) getChildAt(expPosition - getFirstVisiblePosition()); if (expItem != null) { final int l = getPaddingLeft(); final int r = getWidth() - getPaddingRight(); final int t; final int b; final int childHeight = expItem.getChildAt(0).getHeight(); if (expPosition > mSrcPos) { t = expItem.getTop() + childHeight; b = t + dividerHeight; } else { b = expItem.getBottom() - childHeight; t = b - dividerHeight; } // Log.d("mobeta", "l="+l+" t="+t+" r="+r+" b="+b); // Have to clip to support ColorDrawable on <= Gingerbread canvas.save(); canvas.clipRect(l, t, r, b); divider.setBounds(l, t, r, b); divider.draw(canvas); canvas.restore(); } } }
/** * Open the menu. */ public void open() { state = State.OPENED; showIcons(true); animator[LEFT].setFloatValues(button[LEFT], 0); animator[RIGHT].setFloatValues(button[RIGHT], width); animator[RADIUS].setFloatValues(button[RADIUS], 0); animator[TOP].setFloatValues(button[TOP], 0); animator[BOTTOM].setFloatValues(button[BOTTOM], height); animatorSet.cancel(); animatorSet.start(); if (iconOpenedDrawable instanceof Animatable) { ((Animatable) iconOpenedDrawable).start(); } ViewGroup parentView = (ViewGroup) TapBarMenu.this.getParent(); this.animate() .y(menuAnchor == MENU_ANCHOR_BOTTOM ? parentView.getBottom() - height : 0) .setDuration(animationDuration) .setInterpolator(DECELERATE_INTERPOLATOR) .start(); }
private int getEdgesTouched(int x, int y) { int result = 0; if (x < mParentView.getLeft() + mEdgeSize) result |= EDGE_LEFT; if (y < mParentView.getTop() + mEdgeSize) result |= EDGE_TOP; if (x > mParentView.getRight() - mEdgeSize) result |= EDGE_RIGHT; if (y > mParentView.getBottom() - mEdgeSize) result |= EDGE_BOTTOM; return result; }
private int getEdgesTouched(int x, int y) { int result = 0; if (x < mParentView.getLeft() + mEdgeSize) result |= EDGE_LEFT; if (y < mParentView.getTop() + mEdgeSize) result |= EDGE_TOP; if (x > mParentView.getRight() - mEdgeSize) result |= EDGE_RIGHT; if (y > mParentView.getBottom() - mEdgeSize) result |= EDGE_BOTTOM; return result; } }
private int getEdgesTouched(int x, int y) { int result = 0; if (x < mParentView.getLeft() + mEdgeSize) result |= EDGE_LEFT; if (y < mParentView.getTop() + mEdgeSize) result |= EDGE_TOP; if (x > mParentView.getRight() - mEdgeSize) result |= EDGE_RIGHT; if (y > mParentView.getBottom() - mEdgeSize) result |= EDGE_BOTTOM; return result; } }
private int getEdgesTouched(int x, int y) { int result = 0; if (x < mParentView.getLeft() + mEdgeSize) result |= EDGE_LEFT; if (y < mParentView.getTop() + mEdgeSize) result |= EDGE_TOP; if (x > mParentView.getRight() - mEdgeSize) result |= EDGE_RIGHT; if (y > mParentView.getBottom() - mEdgeSize) result |= EDGE_BOTTOM; return result; } }
private int getEdgeTouched(int x, int y) { int result = 0; if (x < mParentView.getLeft() + mEdgeSize) result |= EDGE_LEFT; if (y < mParentView.getTop() + mEdgeSize) result |= EDGE_TOP; if (x > mParentView.getRight() - mEdgeSize) result |= EDGE_RIGHT; if (y > mParentView.getBottom() - mEdgeSize) result |= EDGE_BOTTOM; //TODO changed this for full screen touch; return result; } }