TurnLayoutManager.java 文件源码

java
阅读 47 收藏 0 点赞 0 评论 0

项目:RLibrary 作者:
/**
 * Set the bumper offsets on child views for {@link Orientation#VERTICAL}
 */
private void setChildOffsetsVertical(@Gravity int gravity,
                                     @Dimension int radius,
                                     Point center,
                                     int peekDistance) {
    for (int i = 0; i < getChildCount(); i++) {
        View child = getChildAt(i);
        RecyclerView.LayoutParams layoutParams = (RecyclerView.LayoutParams) child.getLayoutParams();
        final int xOffset = (int) resolveOffsetX(radius, child.getY() + child.getHeight() / 2, center, peekDistance);
        final int x = gravity == Gravity.START ? xOffset + layoutParams.getMarginStart()
                : getWidth() - xOffset - child.getWidth() - layoutParams.getMarginStart();
        child.layout(x, child.getTop(), child.getWidth() + x, child.getBottom());
        setChildRotationVertical(gravity, child, radius, center);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号