Skip to content

Instantly share code, notes, and snippets.

View brucetoo's full-sized avatar
🎧
Visualization

Bruce too brucetoo

🎧
Visualization
View GitHub Profile
@brucetoo
brucetoo / EndlessRecyclerOnScrollListener.java
Created November 12, 2015 07:04 — forked from ssinss/EndlessRecyclerOnScrollListener.java
Endless RecyclerView OnScrollListener
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;
@brucetoo
brucetoo / GridRecyclerView.java
Last active November 6, 2021 11:59 — forked from Musenkishi/GridRecyclerView
GridRecyclerView. A Grid-specific RecyclerView that can use gridLayoutAnimation. (可以使用GridLayoutAnimation)
/*
* Copyright (C) 2014 Freddie (Musenkishi) Lust-Hed
*
* 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
@brucetoo
brucetoo / README.md
Last active August 29, 2015 14:26 — forked from gabrielemariotti/README.md
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (http://fernandocejas.com/)

Centralize the support libraries dependencies in gradle

Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.

A very good way is to separate gradle build files, defining something like:

root
  --gradleScript
 ----dependencies.gradle