I hereby claim:
- I am vinhhuynh93 on github.
- I am victorydst3 (https://keybase.io/victorydst3) on keybase.
- I have a public key ASAzOVGFiR5maVwxeQ_FD8aUItzKCGaXiq_KUaz5_4jnxgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| /** | |
| * Check if the application is in the foreground or background. | |
| * * | |
| * Register this callbacks for an application | |
| * Application application = (Application) context.getApplicationContext(); | |
| * application.registerActivityLifecycleCallbacks(new BaseLifeCycleCallbacks()); | |
| * * | |
| * Note: These callbacks can be registered at any level of the application lifecycle. | |
| * Previous methods to get the application lifecycle forced the lifecycle callbacks to be registered |
| /** | |
| * Custom Scroll listener for RecyclerView. | |
| * Based on implementation https://gist.github.com/ssinss/e06f12ef66c51252563e | |
| */ | |
| public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
| public static String TAG = "EndlessScrollListener"; | |
| 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. |
| public class KeyboardObserver implements ViewTreeObserver.OnGlobalLayoutListener { | |
| public interface Callback { | |
| void onKeyboardVisible(); | |
| void onKeyboardHidden(); | |
| } | |
| WeakReference<View> view; |