This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class EndlessScrollObservable { | |
| public static Observable<Integer> create(final RecyclerView recyclerView, final int thresholdLimit) { | |
| final RecyclerView.Adapter adapter = recyclerView.getAdapter(); | |
| return RxRecyclerView.scrollEvents(recyclerView) | |
| .map(lastVisibleItem(recyclerView)) | |
| .filter(position -> position >= adapter.getItemCount() - thresholdLimit) | |
| .map(integer -> adapter.getItemCount()) | |
| .distinctUntilChanged(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.os.Bundle; | |
| import android.os.IBinder; | |
| import android.os.Parcelable; | |
| import android.support.annotation.NonNull; | |
| import android.util.Size; | |
| import android.util.SizeF; | |
| import android.util.SparseArray; | |
| import java.io.Serializable; | |
| import java.util.ArrayList; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.support.v7.widget.RecyclerView; | |
| import android.view.LayoutInflater; | |
| import android.view.View; | |
| import android.view.ViewGroup; | |
| import java.lang.reflect.InvocationTargetException; | |
| import java.util.List; | |
| /** | |
| * Created by ovancak on 20.03.2017. |