SimpleDividerItemDecorationSpec.java 文件源码

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

项目:gmlrva 作者:
/**
 * Procedure meant to set the value for {@link #mDrawnDivider} optional parameter.
 * @param color the divider's target {@link Color} value.
 *              See {@link Paint#setColor(int)} for more information.
 * @param thickness the divider's target line thickness value. This value must be greater or equal than 0.
 *                  See {@link Paint#setStrokeWidth(float)} for more information.
 * @param style the divider's target {@link Paint.Style}.
 *              See {@link Paint#setStyle(Paint.Style)} for more information.
 * @param pathEffect the divider's target {@link PathEffect}.
 *                   See {@link Paint#setPathEffect(PathEffect)} for more information.
 * @return the same object builder object after setting the optional attribute.
 */
@NonNull
public DecorationSpecBuilder withDrawnDivider(@ColorInt int color,
                                              @FloatRange(from = 0, fromInclusive = false) float thickness,
                                              @Nullable final Paint.Style style,
                                              @Nullable final PathEffect pathEffect) {
    mDrawnDivider = new Paint();
    mDrawnDivider.setColor(color);
    mDrawnDivider.setStrokeWidth(thickness);
    if (style != null) {
        mDrawnDivider.setStyle(style);
    }
    if (pathEffect != null) {
        mDrawnDivider.setPathEffect(pathEffect);
    }
    return this;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号