StaggerdRecyclerView
android瀑布流,完美解决滑动过程中item位置错乱,下拉刷新顶部空白,加载更多顶部错乱等问题,还可以实现动画效果
效果图

集成
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.moo611:StaggerdRecyclerView:latestversion'
}
基本用法
1.布局文件里添加
<com.atech.staggedrv.StaggerdRecyclerView
android:id="@+id/str"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
2.您的model,需要实现StaggedModel接口
//示例 example
public class FakeModel implements StaggedModel {
private int width;
private int height;
private int resourceId;
public FakeModel(int width, int height, int resourceId){
this.width = width;
this.height = height;
this.resourceId = resourceId;
}
@Override
public int getWidth

本文介绍了如何使用StaggerdRecyclerView实现Android瀑布流布局,并解决了在滑动过程中item位置错乱、下拉刷新时顶部空白以及加载更多时顶部错乱的问题。内容包括集成步骤、基本用法、其他功能如动画效果、设置间距、禁止刷新和加载更多,以及详细解释了这些问题出现的原理。

1972

被折叠的 条评论
为什么被折叠?



