android.widget.LinearLayout#getY ( )源码实例Demo

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

源代码1 项目: v9porn   文件: BottomBehavior.java
@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;
}
 
源代码2 项目: v9porn   文件: BottomBehavior.java
@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;
}