Java Code Examples for android.widget.LinearLayout#getY()

The following examples show how to use android.widget.LinearLayout#getY() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BottomBehavior.java    From v9porn with MIT License 6 votes vote down vote up
@Override
public boolean onLayoutChild(CoordinatorLayout parent, LinearLayout child, int layoutDirection) {
    parent.onLayoutChild(child, layoutDirection);
    if (isFirst) {
        isFirst = false;
        if (oLy == 0) {
            oLy = child.getY() + child.getHeight();
        }
        for (int i = 0; i < parent.getChildCount(); i++) {
            View view = parent.getChildAt(i);
            if (view instanceof AppBarLayout) {
                height = view.getMeasuredHeight();
                break;
            }
        }

        child.setY(oLy);
    }

    return true;
}
 
Example 2
Source File: BottomBehavior.java    From v9porn with MIT License 6 votes vote down vote up
@Override
public boolean onLayoutChild(CoordinatorLayout parent, LinearLayout child, int layoutDirection) {
    parent.onLayoutChild(child, layoutDirection);
    if (isFirst) {
        isFirst = false;
        if (oLy == 0) {
            oLy = child.getY() + child.getHeight();
        }
        for (int i = 0; i < parent.getChildCount(); i++) {
            View view = parent.getChildAt(i);
            if (view instanceof AppBarLayout) {
                height = view.getMeasuredHeight();
                break;
            }
        }

        child.setY(oLy);
    }

    return true;
}