Example usage for android.view ViewGroup getRight

List of usage examples for android.view ViewGroup getRight

Introduction

In this page you can find the example usage for android.view ViewGroup getRight.

Prototype

@ViewDebug.CapturedViewProperty
public final int getRight() 

Source Link

Document

Right position of this view relative to its parent.

Usage

From source file:com.cicada.startup.common.ui.view.indicator.ViewPagerIndicator.java

private int getTabTextRight(ViewGroup parentView) {
    View childView = parentView.getChildAt(0);

    return parentView.getRight() - childView.getPaddingRight();
}

From source file:com.juick.android.JuickMessagesAdapter.java

public void recycleView(View view) {
    if (view instanceof ViewGroup) {
        ListRowRuntime lrr = (ListRowRuntime) view.getTag();
        if (lrr != null) {
            if (lrr.userpicListener != null) {
                lrr.removeListenerIfExists();
            }/*from  w  ww  . jav a2 s.c om*/
        }
        ViewGroup vg = (ViewGroup) view;
        if (vg.getChildCount() > 1 && vg.getChildAt(1) instanceof ImageGallery
                && vg instanceof PressableLinearLayout) {
            PressableLinearLayout pll = (PressableLinearLayout) vg;
            // our view
            ImageGallery gallery = (ImageGallery) vg.getChildAt(1);
            Object tag = gallery.getTag();
            if (tag instanceof HashMap) {
                HashMap<Integer, ImageLoaderConfiguration> loaders = (HashMap<Integer, ImageLoaderConfiguration>) tag;
                for (ImageLoaderConfiguration imageLoader : loaders.values()) {
                    imageLoader.loader.terminate();
                }
            }
            pll.blockLayoutRequests = true;
            gallery.cleanup();
            gallery.setTag(null);
            vg.removeViewAt(1);
            vg.measure(View.MeasureSpec.makeMeasureSpec(vg.getRight() - vg.getLeft(), View.MeasureSpec.EXACTLY),
                    View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
            vg.layout(vg.getLeft(), vg.getTop(), vg.getRight(), vg.getTop() + vg.getMeasuredHeight());
            pll.blockLayoutRequests = false;
        }
    }
}

From source file:com.isapp.android.circularviewpager.CircularViewPager.java

private Rect getChildRectInPagerCoordinates(Rect outRect, View child) {
    if (outRect == null) {
        outRect = new Rect();
    }//from   w  w  w  . java  2 s .co m
    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;
}

From source file:VerticalViewPager.java

private Rect getChildRectInPagerCoordinates(Rect outRect, View child) {
    if (outRect == null) {
        outRect = new Rect();
    }//  w  w  w  .j  a va  2 s. co  m
    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;
}

From source file:example.luojing.androidsourceanalysis.ViewPager.java

/**
 * ViewPager????View??//  w w w . j  a va2s  .c om
 */
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;
}