截圖
默認(rèn)效果:
自定義動畫效果:
在RecyclerView使用
釘釘考勤
依賴
Gradle
將其添加到你的module的build.gradle中:
dependencies {
implementation 'me.samlss:broccoli:1.0.0'
}
Maven
<dependency>
<groupId>me.samlss</groupId>
<artifactId>broccoli</artifactId>
<version>1.0.0</version>
<type>pom</type>
</dependency>
代碼使用
Broccoli broccoli = new Broccoli();
//添加默認(rèn)的占位符
broccoli.addPlaceholders('activity', 'view_id', 'view_id');
or
//添加默認(rèn)的占位符
broccoli.addPlaceholders('view1', 'view2', 'view3');
or
//添加自定義的占位符
broccoli.addPlaceholder(new PlaceholderParameter.Builder()
.setView('view')
.setAnimation('scaleAnimation');
.setDrawable(DrawableUtils.createRectangleDrawable(placeHolderColor, 0))
.build());
or
//添加帶漸變動畫的占位符
broccoli.addPlaceholder(new PlaceholderParameter.Builder()
.setView('view')
.setDrawable(new BroccoliGradientDrawable(Color.parseColor("#DDDDDD"),
Color.parseColor("#CCCCCC"), 0, 1000, new LinearInterpolator())
.build());
broccoli.show();