Skip to content

Instantly share code, notes, and snippets.

View vrendina's full-sized avatar

Victor Rendina vrendina

View GitHub Profile
@vrendina
vrendina / EndlessScrollListener.kt
Last active February 20, 2018 18:46
RecyclerView Endless Scroll Listener
import android.support.v7.widget.GridLayoutManager
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.support.v7.widget.StaggeredGridLayoutManager
class EndlessScrollListener(private val layoutManager: RecyclerView.LayoutManager,
private val callback: EndlessScrollCallback) :
RecyclerView.OnScrollListener() {
companion object {
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software