Lines Matching refs:RecyclerView

21 import android.support.v7.widget.RecyclerView.LayoutManager;
22 import android.support.v7.widget.RecyclerView.SmoothScroller.ScrollVectorProvider;
29 * Class intended to support snapping for a {@link RecyclerView}.
32 * {@link RecyclerView.LayoutManager} must implement the {@link ScrollVectorProvider} interface or
35 public abstract class SnapHelper extends RecyclerView.OnFlingListener {
39 RecyclerView mRecyclerView;
43 private final RecyclerView.OnScrollListener mScrollListener =
44 new RecyclerView.OnScrollListener() {
48 public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
50 if (newState == RecyclerView.SCROLL_STATE_IDLE && mScrolled) {
57 public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
70 RecyclerView.Adapter adapter = mRecyclerView.getAdapter();
80 * Attaches the {@link SnapHelper} to the provided RecyclerView, by calling
81 * {@link RecyclerView#setOnFlingListener(RecyclerView.OnFlingListener)}.
82 * You can call this method with {@code null} to detach it from the current RecyclerView.
84 * @param recyclerView The RecyclerView instance to which you want to add this helper or
86 * RecyclerView.
88 * @throws IllegalArgumentException if there is already a {@link RecyclerView.OnFlingListener}
89 * attached to the provided {@link RecyclerView}.
92 public void attachToRecyclerView(@Nullable RecyclerView recyclerView)
110 * Called when an instance of a {@link RecyclerView} is attached.
121 * Called when the instance of a {@link RecyclerView} is detached.
150 * {@link RecyclerView}.
162 RecyclerView.SmoothScroller smoothScroller = createSnapScroller(layoutManager);
168 if (targetPosition == RecyclerView.NO_POSITION) {
178 * Snaps to a target view which currently exists in the attached {@link RecyclerView}. This
179 * method is used to snap the view when the {@link RecyclerView} is first attached; when
203 * @param layoutManager The {@link RecyclerView.LayoutManager} associated with the attached
204 * {@link RecyclerView}.
215 protected void onTargetFound(View targetView, RecyclerView.State state, Action action) {
240 * @param layoutManager the {@link RecyclerView.LayoutManager} associated with the attached
241 * {@link RecyclerView}
262 * @param layoutManager the {@link RecyclerView.LayoutManager} associated with the attached
263 * {@link RecyclerView}
274 * @param layoutManager the {@link RecyclerView.LayoutManager} associated with the attached
275 * {@link RecyclerView}
279 * @return the target adapter position to you want to snap or {@link RecyclerView#NO_POSITION}