- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.yanyusong.y_divideritemdecoration.Y_DividerBuilder.<init>()
方法的一些代码示例,展示了Y_DividerBuilder.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Y_DividerBuilder.<init>()
方法的具体详情如下:
包路径:com.yanyusong.y_divideritemdecoration.Y_DividerBuilder
类名称:Y_DividerBuilder
方法名:<init>
暂无
代码示例来源:origin: yanyusong/Y_DividerItemDecoration
@Override
public Y_Divider getDivider(int itemPosition) {
Y_Divider divider = null;
switch (itemPosition % 3) {
case 0:
case 1:
//每一行第一个和第二个显示rignt和bottom
divider = new Y_DividerBuilder()
.setRightSideLine(true, 0xff666666, 6, 0, 0)
.setBottomSideLine(true, 0xff666666, 6, 0, 0)
.create();
break;
case 2:
//最后一个只显示bottom
divider = new Y_DividerBuilder()
.setBottomSideLine(true, 0xff666666, 6, 0, 0)
.create();
break;
default:
break;
}
return divider;
}
}
代码示例来源:origin: yanyusong/Y_DividerItemDecoration
Y_Divider divider = null;
if ((itemPosition >= 1 && itemPosition <= 6) || itemPosition == 9 || itemPosition == 10) {
divider = new Y_DividerBuilder()
.setBottomSideLine(true, 0xff666666, 6, 0, 0)
.create();
} else if (itemPosition == 0 || itemPosition == 7 || itemPosition == 8) {
divider = new Y_DividerBuilder()
.setRightSideLine(true, 0xff666666, 6, 0, 0)
.setBottomSideLine(true, 0xff666666, 6, 0, 0)
case 2:
case 3:
divider = new Y_DividerBuilder()
.setRightSideLine(true, 0xff666666, 6, 0, 0)
.setBottomSideLine(true, 0xff666666, 6, 0, 0)
break;
case 0:
divider = new Y_DividerBuilder()
.setBottomSideLine(true, 0xff666666, 6, 0, 0)
.create();
代码示例来源:origin: yanyusong/Y_DividerItemDecoration
@Override
public Y_Divider getDivider(int itemPosition) {
Y_Divider divider = null;
switch (itemPosition % 2) {
case 0:
//每一行第一个显示rignt和bottom
divider = new Y_DividerBuilder()
.setRightSideLine(true, 0xff666666, 10, 0, 0)
.setBottomSideLine(true, 0xff666666, 20, 0, 0)
.create();
break;
case 1:
//第二个显示Left和bottom
divider = new Y_DividerBuilder()
.setLeftSideLine(true, 0xff666666, 10, 0, 0)
.setBottomSideLine(true, 0xff666666, 20, 0, 0)
.create();
break;
default:
break;
}
return divider;
}
}
代码示例来源:origin: yanyusong/Y_DividerItemDecoration
switch (itemPosition) {
case 0:
divider = new Y_DividerBuilder()
.setBottomSideLine(true, 0xffFF4081, 6, 0, 0)
.create();
divider = new Y_DividerBuilder()
.setBottomSideLine(true, 0xff666666, 6, 0, 0)
.create();
break;
case 2:
divider = new Y_DividerBuilder()
.setBottomSideLine(true, 0xffFF4081, 4, 0, 0)
.create();
break;
case 3:
divider = new Y_DividerBuilder()
.setBottomSideLine(true, 0xffFF4081, 6, 16, 16)
.create();
break;
case 4:
divider = new Y_DividerBuilder()
.setBottomSideLine(true, 0xffFF4081, 6, 16, 32)
.create();
break;
case 5:
divider = new Y_DividerBuilder()
.setBottomSideLine(true, 0xffFF4081, 6, 0, 0)
.create();
代码示例来源:origin: yanyusong/Y_DividerItemDecoration
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
//outRect 看源码可知这里只是把Rect类型的outRect作为一个封装了left,right,top,bottom的数据结构,
//作为传递left,right,top,bottom的偏移值来用的
int itemPosition = ((RecyclerView.LayoutParams) view.getLayoutParams()).getViewLayoutPosition();
Y_Divider divider = getDivider(itemPosition);
if (divider == null) {
divider = new Y_DividerBuilder().create();
}
int left = divider.getLeftSideLine().isHave() ? Dp2Px.convert(context, divider.getLeftSideLine().getWidthDp()) : 0;
int top = divider.getTopSideLine().isHave() ? Dp2Px.convert(context, divider.getTopSideLine().getWidthDp()) : 0;
int right = divider.getRightSideLine().isHave() ? Dp2Px.convert(context, divider.getRightSideLine().getWidthDp()) : 0;
int bottom = divider.getBottomSideLine().isHave() ? Dp2Px.convert(context, divider.getBottomSideLine().getWidthDp()) : 0;
outRect.set(left, top, right, bottom);
}
本文整理了Java中com.yanyusong.y_divideritemdecoration.Y_DividerBuilder类的一些代码示例,展示了Y_DividerBuilder类的具体用法。这
本文整理了Java中com.yanyusong.y_divideritemdecoration.Y_DividerBuilder.create()方法的一些代码示例,展示了Y_DividerBuild
本文整理了Java中com.yanyusong.y_divideritemdecoration.Y_DividerBuilder.()方法的一些代码示例,展示了Y_DividerBuilder.()的
我是一名优秀的程序员,十分优秀!