GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - LittleMango/StackLayoutManager: A RecyclerView.LayoutManager implementation which provides functionality to show a group of stack view.

BranchesTags
Open more actions menu

Latest commit

 

History

41 Commits
41 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
StackLayoutManager
StackLayoutManager
 
 
gif
gif
 
 
gradle/wrapper
gradle/wrapper
 
 
sample
sample
 
 
.DS_Store
.DS_Store
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
README_CN.md
README_CN.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
sample.png
sample.png
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

StackLayoutManager 中文说明


Android library that provides A RecyclerView.LayoutManager implementation which provides functionality to show a group of stack view.

IMG IMG

Overview

StackLayoutManager provides the following advantages:

  • High performance: the bottom layer use the recyclerView recycle mechanism to allow you to display a large number of itemviews without OOM.
  • Flexibility: you can choose which direction the card will slide out, and there are four directions to choose.
  • Hight customization: if you want to implement animation and layout yourself, you can inherit StackAnimation or StackLayout to achieve the desired effect.
  • Easy to use: you can start using it right away. All you need to do is to drop the JAR file into your project and replace LinearLayoutManager object in your code by com.littlemango.stacklayoutmanager.StackLayoutManager

Gradle integration

If you're using Gradle, you can declare this library as a dependency:

dependencies {
    implementation 'com.littlemango:stacklayoutmanager:1.0.5'
}

Basic usage

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);

Advanced usage

  1. You can set the orientation of the card to slide out of the screen:
//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);
  1. You can set the visible item count:
//in the construction method
StackLayoutManager manager = new StackLayoutManager(ScrollOrientation.BOTTOM_TO_TOP, 3);

//or in setter method
manager.setVisibleItemCount(3);
  1. You can change the offset between items:
manager.setItemOffset(50);
  1. You can scroll smoothly or immediately to the specified position:
//scroll to position with animation
recyclerView.smoothScrollToPosition(3);

//scroll to position immediately without animation
recyclerView.scrollToPosition(3);
  1. You can set the view to turn only one page at a time, like a ViewPager, or you can turn pages continuously:
manager.setPagerMode(true or false);
  1. When in PagerView paging mode, you can set the minimum sliding velocity that triggers the paging effect:
manager.setPagerFlingVelocity(3000);
  1. You can add a item changed Listener to StackLayoutManager:
mStackLayoutManager.setItemChangedListener(new StackLayoutManager.ItemChangedListener() {
    @Override
    public void onItemChanged(int position) {
        mToast.setText("first visible item position is " + position);
        mToast.show();
    }
});
  1. I use the DefaultAnimation class to provide animation, which is inherited from StackAnimation, and you can inherit both classes to achieve the desired animation effect:
DefaultAnimation animation = new DefaultAnimation(ScrollOrientation.BOTTOM_TO_TOP, visibleCount);
manager.setAnimation(animation);
  1. I use the DefaultLayout class to implement the layout of items, which inherits from StackLayout. You can inherit both classes to achieve the layout effect you want:
StackLayoutManager manager = new StackLayoutManager(ScrollOrientation.BOTTOM_TO_TOP, 
                visibleCount,
                DefaultAnimation.class,
                DefaultLayout.class);

Sample

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:

IMG

License

MIT License See MIT License

About

A RecyclerView.LayoutManager implementation which provides functionality to show a group of stack view.

Resources

Readme
License
Activity

Stars

292 stars

Watchers

2 watching

Forks

46 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.