- Implementation of LinearLayoutManager which wraps its contents.
- Implementation of GridLayoutManager which wraps its contents.
Usage example:
final WrapLinearLayoutManager layoutManager = new WrapLinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
recyclerView.setLayoutManager(layoutManager);
recyclerView.addItemDecoration(new DividerItemDecoration(this, null));
recyclerView.setAdapter(adapter);
Note that if the child views in your RecyclerView
have the fixed size LinearLayoutManager#setChildSize
should be used
to avoid unnecessary measuring.
build.gradle via jcenter:
repositories {
// ...
jcenter()
}
dependencies {
// ...
compile 'com.infstory:android-wrap-layout-manager:0.0.6'
}
build.gradle via jitpack:
repositories {
// ...
maven { url "https://jitpack.io" }
}
dependencies {
// ...
compile 'com.github.yongjhih:android-wrap-layout-manager:-SNAPSHOT'
}
- https://github.com/serso/android-linear-layout-manager
- https://gist.github.com/c0nnector/5f80e19d9ba6d562fbd5
Library is distributed under Apache 2.0 license, see LICENSE.txt
The following applications use this library: