android.view.ViewGroup#getBottom ( )源码实例Demo

下面列出了android.view.ViewGroup#getBottom ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: o2oa   文件: SwipeLayout.java
@Override
public boolean onDoubleTap(MotionEvent e) {
    if (mDoubleClickListener != null) {
        View target;
        ViewGroup bottom = getBottomView();
        ViewGroup surface = getSurfaceView();
        if (e.getX() > bottom.getLeft() && e.getX() < bottom.getRight()
                && e.getY() > bottom.getTop()
                && e.getY() < bottom.getBottom()) {
            target = bottom;
        } else {
            target = surface;
        }
        mDoubleClickListener.onDoubleClick(SwipeLayout.this,
                target == surface);
    }
    return true;
}
 
源代码2 项目: o2oa   文件: SwipeLayoutConv.java
@Override
public boolean onDoubleTap(MotionEvent e) {
    if (mDoubleClickListener != null) {
        View target;
        ViewGroup bottom = getBottomView();
        ViewGroup surface = getSurfaceView();
        if (e.getX() > bottom.getLeft() && e.getX() < bottom.getRight()
                && e.getY() > bottom.getTop()
                && e.getY() < bottom.getBottom()) {
            target = bottom;
        } else {
            target = surface;
        }
        mDoubleClickListener.onDoubleClick(SwipeLayoutConv.this,
                target == surface);
    }
    return true;
}
 
源代码3 项目: TestChat   文件: ShareMessageFragment.java
@Override
public void onCommentItemClick(View view, String id, int shareMessagePosition, int position, String replyUser) {
        LogUtil.e("位置" + shareMessagePosition);
        currentPosition = shareMessagePosition;
        currentCommentPosition = position;
        ViewParent viewParent = view.getParent();
        if (viewParent != null) {
                ViewGroup parent = (ViewGroup) viewParent;
                commentItemOffset += parent.getHeight() - view.getBottom();
                if (parent.getParent() != null) {
                        ViewGroup rootParent = (ViewGroup) parent.getParent();
                        commentItemOffset += rootParent.getHeight() + parent.getBottom();
                }
        }
        this.replyUid = replyUser;
        dealBottomView(true);
}
 
源代码4 项目: TestChat   文件: UserDetailActivity.java
@Override
public void onCommentItemClick(View view, String id, int shareMessagePosition, int commentPosition, String replyUid) {
        LogUtil.e("位置" + shareMessagePosition);
        currentPosition = shareMessagePosition;
        currentCommentPosition = commentPosition;
        ViewParent viewParent = view.getParent();
        if (viewParent != null) {
                ViewGroup parent = (ViewGroup) viewParent;
                commentItemOffset += parent.getHeight() - view.getBottom();
                if (parent.getParent() != null) {
                        ViewGroup rootParent = (ViewGroup) parent.getParent();
                        commentItemOffset += rootParent.getHeight() + parent.getBottom();
                }
        }
        this.replyUid = replyUid;
        dealBottomView(true);
}
 
源代码5 项目: hintcase   文件: HintCaseView.java
private void calculateHintBlockPosition(ViewGroup parent, Shape shape) {
    if (targetView == NO_TARGETVIEW) {
        hintBlockPosition = HintCase.HINT_BLOCK_POSITION_CENTER;
    } else {
        int[] areas = new int[4];
        areas[HintCase.HINT_BLOCK_POSITION_LEFT] = shape.getLeft() - parent.getLeft();
        areas[HintCase.HINT_BLOCK_POSITION_TOP] = shape.getTop() - parent.getTop();
        areas[HintCase.HINT_BLOCK_POSITION_RIGHT] = parent.getRight() - shape.getRight();
        areas[HintCase.HINT_BLOCK_POSITION_BOTTOM] = parent.getBottom() - shape.getBottom();
        hintBlockPosition = HintCase.HINT_BLOCK_POSITION_LEFT;
        for(int i = 1; i < areas.length; i++) {
            if(areas[i] >= areas[hintBlockPosition]) {
                hintBlockPosition = i;
            }
        }
    }
}
 
源代码6 项目: UltimateAndroid   文件: SwipeLayout.java
@Override
public boolean onDoubleTap(MotionEvent e) {
    if(mDoubleClickListener != null){
        View target;
        ViewGroup bottom = getBottomView();
        ViewGroup surface = getSurfaceView();
        if(e.getX() > bottom.getLeft() && e.getX() < bottom.getRight()
                && e.getY() > bottom.getTop() && e.getY() < bottom.getBottom()){
            target = bottom;
        }else{
            target = surface;
        }
        mDoubleClickListener.onDoubleClick(SwipeLayout.this, target == surface);
    }
    return true;
}
 
源代码7 项目: DongWeather   文件: DragSortListView.java
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();
            }
        }
    }
 
源代码8 项目: delion   文件: FocusAnimator.java
/** Scroll the layout so that the focused child is on screen. */
private void requestChildFocus() {
    ViewGroup parent = (ViewGroup) mLayout.getParent();
    if (mLayout.getParent() == null) return;

    // Scroll the parent to make the focused child visible.
    if (mFocusedChild != null) parent.requestChildFocus(mLayout, mFocusedChild);

    // {@link View#requestChildFocus} fails to account for children changing their height, so
    // the scroll value may be past the actual maximum.
    int viewportHeight = parent.getBottom() - parent.getTop();
    int scrollMax = Math.max(0, mLayout.getMeasuredHeight() - viewportHeight);
    if (parent.getScrollY() > scrollMax) parent.setScrollY(scrollMax);
}
 
源代码9 项目: AndroidChromium   文件: FocusAnimator.java
/** Scroll the layout so that the focused child is on screen. */
private void requestChildFocus() {
    ViewGroup parent = (ViewGroup) mLayout.getParent();
    if (mLayout.getParent() == null) return;

    // Scroll the parent to make the focused child visible.
    if (mFocusedChild != null) parent.requestChildFocus(mLayout, mFocusedChild);

    // {@link View#requestChildFocus} fails to account for children changing their height, so
    // the scroll value may be past the actual maximum.
    int viewportHeight = parent.getBottom() - parent.getTop();
    int scrollMax = Math.max(0, mLayout.getMeasuredHeight() - viewportHeight);
    if (parent.getScrollY() > scrollMax) parent.setScrollY(scrollMax);
}
 
源代码10 项目: mobile-manager-tool   文件: DragSortListView.java
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();
            }
        }
    }
 
源代码11 项目: 365browser   文件: FocusAnimator.java
/** Scroll the layout so that the focused child is on screen. */
private void requestChildFocus() {
    ViewGroup parent = (ViewGroup) mLayout.getParent();
    if (mLayout.getParent() == null) return;

    // Scroll the parent to make the focused child visible.
    if (mFocusedChild != null) parent.requestChildFocus(mLayout, mFocusedChild);

    // {@link View#requestChildFocus} fails to account for children changing their height, so
    // the scroll value may be past the actual maximum.
    int viewportHeight = parent.getBottom() - parent.getTop();
    int scrollMax = Math.max(0, mLayout.getMeasuredHeight() - viewportHeight);
    if (parent.getScrollY() > scrollMax) parent.setScrollY(scrollMax);
}
 
源代码12 项目: android-kernel-tweaker   文件: DragSortListView.java
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();
            }
        }
    }
 
源代码13 项目: Overchan-Android   文件: DragSortListView.java
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();
            }
        }
    }
 
源代码14 项目: chromadoze   文件: DragSortListView.java
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();
            }
        }
    }
 
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();
            }
        }
    }
 
源代码16 项目: UltimateAndroid   文件: DragSortListView.java
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();
            }
        }
    }
 
源代码17 项目: UltimateAndroid   文件: DragSortListView.java
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();
            }
        }
    }
 
源代码18 项目: simpletask-android   文件: DragSortListView.java
private void drawDivider(int expPosition, @NonNull Canvas canvas) {

        final Drawable divider = getDivider();
        final int dividerHeight = getDividerHeight();
        // Log.d(tag, "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(tag, "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();
            }
        }
    }
 
源代码19 项目: Field-Book   文件: DragSortListView.java
private void drawDivider(int expPosition, Canvas canvas) {
    final Drawable divider = getDivider();
    final int dividerHeight = getDividerHeight();

    if (divider != null && dividerHeight != 0) {
        final ViewGroup expItem = (ViewGroup) getChildAt(expPosition
                - getFirstVisiblePosition());
        if (expItem != null) {
            final int left = getPaddingLeft();
            final int right = getWidth() - getPaddingRight();
            final int top;
            final int bottom;

            final int childHeight = expItem.getChildAt(0).getHeight();

            if (expPosition > mSrcPos) {
                top = expItem.getTop() + childHeight;
                bottom = top + dividerHeight;
            } else {
                bottom = expItem.getBottom() - childHeight;
                top = bottom - dividerHeight;
            }

            // Have to clip to support ColorDrawable on <= Gingerbread
            canvas.save();
            canvas.clipRect(left, top, right, bottom);
            divider.setBounds(left, top, right, bottom);
            divider.draw(canvas);
            canvas.restore();
        }
    }
}
 
源代码20 项目: onpc   文件: DragSortListView.java
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();
        }
    }
}
 
 方法所在类