Skip to content

Instantly share code, notes, and snippets.

View ryandt's full-sized avatar

Ryan Taylor ryandt

  • Etsy
  • Chicago, IL, US
View GitHub Profile
@ryandt
ryandt / AdjustingViewGlobalLayoutListener.java
Last active January 5, 2021 09:32
An OnGlobalLayoutListener interface that will adjust and resize a fullscreen scene's view when the soft keyboard is shown or hidden. This interface provides custom layout behavior to the 'adjustResize' windowSoftInputMode for a View layout by enforcing an adjustable container with the option of a static footer view.
import android.animation.ObjectAnimator;
import android.graphics.Rect;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
/**
* An OnGlobalLayoutListener interface that will adjust and resize a fullscreen scene's view when the soft keyboard is shown
* or hidden.
*
@ryandt
ryandt / ContinuousScrollListener.java
Last active April 7, 2016 03:07
A RecyclerView.OnScrollListener that adds support for scroll-enabled pagination. Attach it to your RecyclerView via your RecyclerView's addOnScrollListener(RecyclerView.OnScrollListener) method.
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
/**
* A RecyclerView.OnScrollListener that adds support for scroll-enabled pagination.
*/
public abstract class ContinuousScrollListener extends RecyclerView.OnScrollListener {
private static String TAG = ContinuousScrollListener.class.getSimpleName();
// Layout manager used on the RecyclerView.