| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Android library that provides A RecyclerView.LayoutManager implementation which provides functionality to show a group of stack view.
StackLayoutManager provides the following advantages:
If you're using Gradle, you can declare this library as a dependency:
dependencies {
implementation 'com.littlemango:stacklayoutmanager:1.0.5'
}The simplest way to use StackLayoutManager is by dropping the library JAR file into your project creating the StackLayoutManager object and pass it back to the RecyclerView object:
StackLayoutManager manager = new StackLayoutManager();
recyclerView.setLayoutManager(manager);//orientation can be one of ScrollOrientation.BOTTOM_TO_TOP or TOP_TO_BOTTOM or RIGHT_TO_LEFT or LEFT_TO_RIGHT
ScrollOrientation orientation = ScrollOrientation.BOTTOM_TO_TOP
StackLayoutManager manager = new StackLayoutManager(orientation);
recyclerView.setLayoutManager(manager);//in the construction method
StackLayoutManager manager = new StackLayoutManager(ScrollOrientation.BOTTOM_TO_TOP, 3);
//or in setter method
manager.setVisibleItemCount(3);manager.setItemOffset(50);//scroll to position with animation
recyclerView.smoothScrollToPosition(3);
//scroll to position immediately without animation
recyclerView.scrollToPosition(3);manager.setPagerMode(true or false);manager.setPagerFlingVelocity(3000);mStackLayoutManager.setItemChangedListener(new StackLayoutManager.ItemChangedListener() {
@Override
public void onItemChanged(int position) {
mToast.setText("first visible item position is " + position);
mToast.show();
}
});
DefaultAnimation animation = new DefaultAnimation(ScrollOrientation.BOTTOM_TO_TOP, visibleCount);
manager.setAnimation(animation);StackLayoutManager manager = new StackLayoutManager(ScrollOrientation.BOTTOM_TO_TOP,
visibleCount,
DefaultAnimation.class,
DefaultLayout.class);You can clone or download this project to your computer and install sample apk on your phone to see the effect.
Or you can scan QR code to install the apk:
MIT License See MIT License
| Back | FazBrowse Home | New Git URL |