Rebound-RecyclerView-Android icon indicating copy to clipboard operation
Rebound-RecyclerView-Android copied to clipboard

Unofficial library based on Facebook's rebound library for Android RecyclerView.

Rebound-RecyclerView-Android

Unofficial library based on Facebook's Rebound library for Android RecyclerView. Report issues in issues tab. Special Thanks to @anthony-skr. Read his article

Implementation

build.gradle(Project)

  allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

build.gradle (Module:app)

	dependencies {
	        implementation 'com.github.theonlyanil:Rebound-RecyclerView-Android:0.3'
	}

Usage

Initialize in OnCreate

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        RecyclerView recyclerView = findViewById(R.id.recyclerMain);

	// INIT
        ReboundRecycler.init(recyclerView);

Go to Recycler Adapter and call ReboundRecycler in java onCreateViewHolder and java onBindViewHolder

      @Override
        public RecyclerAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
            RelativeLayout relativeLayout = (RelativeLayout) LayoutInflater.from(context).inflate(R.layout.single_main, viewGroup, false);
            ReboundRecycler.first(relativeLayout);
            return new ViewHolder(relativeLayout);
        }
      @Override
        public void onBindViewHolder(@NonNull RecyclerAdapter.ViewHolder viewHolder, int i) {
            ReboundRecycler.bind(viewHolder.itemView, i);
        }

Advanced Usage (Init)

You can also modify these values: Delay (animation start delay), Init Tension, Init Friction, Scroll Tension, Scroll Friction. Play with tension and friction.

      ReboundRecycler.init(recyclerView, true)
          .delay(1000)                // loads after 1 second
	  .scrollAgain(true)
          .initFriction(30)
          .initTension(250)
          .scrollFriction(25)
          .scrollTension(300);