Lines Matching defs:LayoutManager

99  * {@link LayoutManager} to be able to detect data set changes in batches during a layout
100 * calculation. This saves LayoutManager from tracking adapter changes to calculate animations.
107 * position from the LayoutManager's perspective.</li>
133 * When writing a {@link LayoutManager} you almost always want to use layout positions whereas when
290 * Handles abstraction between LayoutManager children and RecyclerView children
335 @VisibleForTesting LayoutManager mLayout;
614 * Instantiate and set a LayoutManager, if specified in the attributes.
630 Class<? extends LayoutManager> layoutManagerClass =
631 classLoader.loadClass(className).asSubclass(LayoutManager.class);
632 Constructor<? extends LayoutManager> constructor;
644 + ": Error creating LayoutManager " + className, e1);
651 + ": Unable to find LayoutManager " + className, e);
654 + ": Could not instantiate the LayoutManager: " + className, e);
657 + ": Could not instantiate the LayoutManager: " + className, e);
663 + ": Class is not a LayoutManager " + className, e);
1042 * <p>This listener will be called when a LayoutManager or the RecyclerView decides
1055 * boundary. If the LayoutManager of this RecyclerView does not support baseline alignment,
1074 * <p>This listener will be called when a LayoutManager or the RecyclerView decides
1111 * Set the {@link LayoutManager} that this RecyclerView will use.
1116 * {@link LayoutManager}. A LayoutManager must be provided for RecyclerView to function.</p>
1120 * @param layout LayoutManager to use
1122 public void setLayoutManager(LayoutManager layout) {
1151 throw new IllegalArgumentException("LayoutManager " + layout
1233 * part of the child list of the RecyclerView, but they are invisible to the LayoutManager
1274 * Return the {@link LayoutManager} currently responsible for
1277 * @return The currently bound LayoutManager
1279 public LayoutManager getLayoutManager() {
1323 * a LayoutManager to reuse those views unmodified without needing to return to the adapter
1500 * {@link com.android.internal.widget.RecyclerView.LayoutManager#scrollToPosition(int)}
1502 * @see com.android.internal.widget.RecyclerView.LayoutManager#scrollToPosition(int)
1510 Log.e(TAG, "Cannot scroll to position a LayoutManager set. "
1530 * {@link LayoutManager#smoothScrollToPosition(RecyclerView, State, int)} and create a
1533 * {@link LayoutManager} is responsible for creating the actual scroll action. If you want to
1535 * {@link LayoutManager#smoothScrollToPosition(RecyclerView, State, int)} in your
1536 * LayoutManager.
1539 * @see LayoutManager#smoothScrollToPosition(RecyclerView, State, int)
1546 Log.e(TAG, "Cannot smooth scroll without a LayoutManager set. "
1562 Log.e(TAG, "Cannot scroll without a LayoutManager set. "
1711 * {@link RecyclerView.LayoutManager#computeHorizontalScrollOffset(RecyclerView.State)} in your
1712 * LayoutManager. </p>
1715 * @see com.android.internal.widget.RecyclerView.LayoutManager#computeHorizontalScrollOffset
1737 * {@link RecyclerView.LayoutManager#computeHorizontalScrollExtent(RecyclerView.State)} in your
1738 * LayoutManager.</p>
1741 * @see RecyclerView.LayoutManager#computeHorizontalScrollExtent(RecyclerView.State)
1760 * {@link RecyclerView.LayoutManager#computeHorizontalScrollRange(RecyclerView.State)} in your
1761 * LayoutManager.</p>
1764 * @see RecyclerView.LayoutManager#computeHorizontalScrollRange(RecyclerView.State)
1784 * {@link RecyclerView.LayoutManager#computeVerticalScrollOffset(RecyclerView.State)} in your
1785 * LayoutManager.</p>
1788 * @see com.android.internal.widget.RecyclerView.LayoutManager#computeVerticalScrollOffset
1809 * {@link RecyclerView.LayoutManager#computeVerticalScrollExtent(RecyclerView.State)} in your
1810 * LayoutManager.</p>
1813 * @see RecyclerView.LayoutManager#computeVerticalScrollExtent(RecyclerView.State)
1832 * {@link RecyclerView.LayoutManager#computeVerticalScrollRange(RecyclerView.State)} in your
1833 * LayoutManager.</p>
1836 * @see RecyclerView.LayoutManager#computeVerticalScrollRange(RecyclerView.State)
1892 * dropped; {@link LayoutManager#onFocusSearchFailed(View, int, Recycler, State)} will not be
1897 * LayoutManager#scrollToPosition(int)}, {@link LayoutManager#smoothScrollToPosition(
1959 Log.e(TAG, "Cannot smooth scroll without a LayoutManager set. "
1985 * LayoutManager does not support scrolling in the axis fling is issued.
1987 * @see LayoutManager#canScrollVertically()
1988 * @see LayoutManager#canScrollHorizontally()
1992 Log.e(TAG, "Cannot fling without a LayoutManager set. "
2233 * {@link LayoutManager#onFocusSearchFailed(View, int, Recycler, State)} to layout more Views
2234 * in the focus search direction. If LayoutManager adds a View that matches the
2243 * {@link LayoutManager#onFocusSearchFailed(View, int, Recycler, State)} before running a
2268 // tell LayoutManager to add if it can.
2390 // layout pass to fix them, then it is LayoutManager's responsibility to keep focused
3028 // calling LayoutManager here is not pretty but that API is already public and it is better
3030 final int width = LayoutManager.chooseSize(widthSpec,
3033 final int height = LayoutManager.chooseSize(heightSpec,
3054 * the LayoutManager {@link LayoutManager#supportsPredictiveItemAnimations()
3129 * hard to handle for a LayoutManager. Instead, this method records necessary information about
3477 // Save old positions so that LayoutManager can run its mapping logic.
3667 + " if the LayoutManager lays out the same View multiple times."
3894 throw new IllegalStateException("RecyclerView has no LayoutManager");
3902 throw new IllegalStateException("RecyclerView has no LayoutManager");
3910 throw new IllegalStateException("RecyclerView has no LayoutManager");
4431 * Useful for implementing simple scrolling in {@link LayoutManager LayoutManagers}.
4447 * {@link LayoutManager} measures or lays out the view and is a good time to perform these
4460 * {@link LayoutManager} fully detaches the child view from the parent and its window.</p>
4469 * Useful for implementing simple scrolling in {@link LayoutManager LayoutManagers}.
4577 * <p>This method will always be invoked before listeners, but after the LayoutManager
4588 // Let the LayoutManager go first; this allows it to bring any properties into
4594 // Let the RecyclerView subclass handle this event next; any LayoutManager property
5162 * <p>Typical use of a Recycler by a {@link LayoutManager} will be to obtain views for
5165 * If not, the view can be quickly reused by the LayoutManager with no further work.
5167 * may be repositioned by a LayoutManager without remeasurement.</p>
5298 * Generally, a LayoutManager should acquire its views via {@link #getViewForPosition(int)}
5299 * and let the RecyclerView handle caching. This is a helper method for LayoutManager who
5345 * Usually, LayoutManager does not need to worry about this. However, in some cases, your
5346 * LayoutManager may need to call some custom component with item positions in which
5372 * This method should be used by {@link LayoutManager} implementations to obtain
5467 // We are NOT sending the offsetPosition because LayoutManager does not
5521 // before the View is rebound and returned to the LayoutManager for post layout ops.
5613 * @see LayoutManager#removeAndRecycleView(View, Recycler)
6205 * {@link LayoutManager#stopIgnoringView(View)} before returning the View.
6213 * @see LayoutManager#ignoreView(View)
6412 * <p>A view is recycled when a {@link LayoutManager} decides that it no longer
6795 * A <code>LayoutManager</code> is responsible for measuring and positioning item views
6797 * item views that are no longer visible to the user. By changing the <code>LayoutManager</code>
6802 * If the LayoutManager specifies a default constructor or one with the signature
6804 * instantiate and set the LayoutManager when being inflated. Most used properties can
6806 * a LayoutManager specifies both constructors, the non-default constructor will take
6810 public abstract static class LayoutManager {
6824 * LayoutManager has its own more strict measurement cache to avoid re-measuring a child
6851 * EXACTLY because a LayoutManager cannot resize RecyclerView during a layout pass.
6866 * @see LayoutManager#collectAdjacentPrefetchPositions(int, int, State, LayoutPrefetchRegistry)
6867 * @see LayoutManager#collectInitialPrefetchPositions(int, LayoutPrefetchRegistry)
6960 * {@link LayoutManager#onLayoutChildren(Recycler, State)} during a measurement pass.
6967 * This method is only called if the LayoutManager opted into the auto measurement API.
7043 * Defines whether the layout should be measured by the RecyclerView or the LayoutManager
7046 * This method is usually called by the LayoutManager with value {@code true} if it wants
7047 * to support WRAP_CONTENT. If you are using a public LayoutManager but want to customize
7049 * {@link LayoutManager#onMeasure(int, int)} to implement your custom measurement logic.
7053 * It works by calling {@link LayoutManager#onLayoutChildren(Recycler, State)} during an
7060 * <li>LayoutManager should call {@code setAutoMeasureEnabled(true)} to enable it. All of
7063 * exact, RecyclerView will only call LayoutManager's {@code onMeasure} and return without
7074 * {@code true} and {@link State#isPreLayout()} set to {@code false}. The LayoutManager can
7087 * that the LayoutManager should not worry about them and handle each
7100 * RecyclerView, <code>false</code> if the LayoutManager wants
7111 * Returns whether the LayoutManager uses the automatic measurement API or not.
7113 * @return <code>True</code> if the LayoutManager is measured by the RecyclerView or
7123 * Returns whether this LayoutManager supports automatic item animations.
7124 * A LayoutManager wishing to support item animations should obey certain
7126 * The default return value is <code>false</code>, so subclasses of LayoutManager
7147 * Sets whether the LayoutManager should be queried for views outside of
7150 * <p>If enabled, the LayoutManager will be queried for items to inflate/bind in between
7176 * Sets whether the LayoutManager should be queried for views outside of
7188 * Gather all positions from the LayoutManager to be prefetched, given specified momentum.
7191 * which positions the LayoutManager will soon need, given upcoming movement in subsequent
7194 * <p>The LayoutManager should call {@link LayoutPrefetchRegistry#addPosition(int, int)} for
7211 * Gather all positions from the LayoutManager to be prefetched in preperation for its
7216 * <p>If item prefetch is enabled for this LayoutManager, as well in another containing
7217 * LayoutManager, this method is called in between draw traversals to gather
7218 * which positions this LayoutManager will first need, once it appears on the screen.</p>
7220 * <p>For example, if this LayoutManager represents a horizontally scrolling list within a
7221 * vertically scrolling LayoutManager, this method would be called when the horizontal list
7224 * <p>The LayoutManager should call {@link LayoutPrefetchRegistry#addPosition(int, int)} for
7249 * Returns whether LayoutManager is currently attached to a RecyclerView which is attached
7252 * @return True if this LayoutManager is controlling a RecyclerView and the RecyclerView
7263 * Calling this method when LayoutManager is not attached to a RecyclerView has no effect.
7278 * Calling this method when LayoutManager is not attached to a RecyclerView has no effect.
7296 * Called when this LayoutManager is both attached to a RecyclerView and that RecyclerView
7299 * If the RecyclerView is re-attached with the same LayoutManager and Adapter, it may not
7305 * @param view The RecyclerView this LayoutManager is bound to
7323 * Called when this LayoutManager is detached from its parent RecyclerView or when
7326 * LayoutManager should clear all of its View references as another LayoutManager might be
7329 * If the RecyclerView is re-attached with the same LayoutManager and Adapter, it may not
7333 * If your LayoutManager has View references that it cleans in on-detach, it should also
7339 * @param view The RecyclerView this LayoutManager is bound to
7362 * The LayoutManager is in charge of the behavior of item animations. By default,
7366 * disappearing items, and moved items. If a LayoutManager returns false from
7374 * <p>A LayoutManager wanting a better item animation experience, where items can be
7376 * are not on screen, then the LayoutManager should return true from
7400 * <p>The default LayoutManager implementations for RecyclerView handle all of these
7420 * This is a good place for the LayoutManager to do some cleanup like pending scroll
7460 * Create a LayoutParams object suitable for this LayoutManager, copying relevant
7483 * Create a LayoutParams object suitable for this LayoutManager from
7538 * @return True if this LayoutManager can scroll the current contents horizontally
7548 * @return True if this LayoutManager can scroll the current contents vertically
7557 * Actual position of the item on the screen depends on the LayoutManager implementation.
7633 * Views added via this method are going to be invisible to LayoutManager after the
7650 * Views added via this method are going to be invisible to LayoutManager after the
7767 * any of the affected views; the LayoutManager is responsible for doing so if desired.
7810 * and also a direct child of the LayoutManager.
7813 * not a child of the LayoutManager (e.g. running a disappear animation).
7815 * @param view The view that is a descendant of the LayoutManager.
7817 * @return The direct child of the LayoutManager which contains the given view or null if
7818 * the provided view is not a descendant of this LayoutManager.
7842 * Override this method to improve performance if your LayoutManager keeps data about
7871 * views currently attached to the RecyclerView. Generally LayoutManager implementations
7875 * <p>If a LayoutManager uses this method to detach a view, it <em>must</em>
7878 * before the LayoutManager entry point method called by RecyclerView returns.</p>
7893 * views currently attached to the RecyclerView. Generally LayoutManager implementations
7897 * <p>If a LayoutManager uses this method to detach a view, it <em>must</em>
7900 * before the LayoutManager entry point method called by RecyclerView returns.</p>
8059 * This value is set only if the LayoutManager opts into the auto measure api via
8077 * This value is set only if the LayoutManager opts into the auto measure api via
8165 * Returns true if the RecyclerView this LayoutManager is bound to has focus.
8175 * Returns true if the RecyclerView this LayoutManager is bound to has or contains focus.
8623 * item decoration insets whenever possible. This allows the LayoutManager to effectively
8659 * item decoration insets whenever possible. This allows the LayoutManager to effectively
8798 * Note that item decorations are automatically calculated when one of the LayoutManager's
8878 * <p>This is the LayoutManager's opportunity to populate views in the given direction
8879 * to fulfill the request if it can. The LayoutManager should attach and return
8898 * This method gives a LayoutManager an opportunity to intercept the initial focus search
8902 * will be called to give the LayoutManager an opportunity to add new views for items
8903 * that did not have attached views representing them. The LayoutManager should not add
8988 * <p>A LayoutManager wishing to keep focused views aligned in a specific
8991 * <p>If the LayoutManager executes different behavior that should override the default
8995 * @param parent The RecyclerView hosting this LayoutManager
9008 * Called if the RecyclerView this LayoutManager is bound to has a different adapter set.
9009 * The LayoutManager may use this opportunity to clear caches and configure state such
9025 * <p>The LayoutManager implementation should return <code>true</code> if the default
9032 * @param recyclerView The RecyclerView hosting this LayoutManager
9061 * Called when items have been added to the adapter. The LayoutManager may choose to
9258 * <p>Called when the LayoutManager should save its state. This is a good time to save your
9260 * layout state if the LayoutManager is recreated.</p>
9261 * <p>RecyclerView does NOT verify if the LayoutManager has changed between state save and
9265 * @return Necessary information for LayoutManager to be able to restore its state
9289 * RecyclerView calls this method to notify LayoutManager that scroll state has changed.
9339 * @param info The info that should be filled by the LayoutManager
9434 * A LayoutManager can call this method to force RecyclerView to run simple animations in
9469 * Default implementation returns the number of items in the adapter if LayoutManager
9470 * supports vertical scrolling or 1 if LayoutManager does not support vertical
9476 * @return The number of rows in LayoutManager for accessibility.
9488 * Default implementation returns the number of items in the adapter if LayoutManager
9489 * supports horizontal scrolling or 1 if LayoutManager does not support horizontal
9495 * @return The number of rows in LayoutManager for accessibility.
9573 * children of LayoutManager.
9648 * Some general properties that a LayoutManager may want to use.
9906 * <p>While {@link LayoutParams} belong to the {@link LayoutManager},
9967 * This ViewHolder is fully managed by the LayoutManager. We do not scrap, recycle or remove
9968 * it unless LayoutManager is replaced.
9969 * It is still fully visible to the LayoutManager.
10011 * b) LayoutManager asks for the View for that position while the ViewHolder is hidden.
10117 * positions. All methods in {@link RecyclerView.LayoutManager}, {@link RecyclerView.State},
10121 * If LayoutManager needs to call an external method that requires the adapter position of
10162 * When LayoutManager supports animations, RecyclerView tracks 3 positions for ViewHolders
10460 * {@link RecyclerView}. Custom {@link LayoutManager layout managers} are encouraged
10505 * potentially invalid data. A LayoutManager should scrap/recycle it.
10515 * is attached to has been removed from the data set. A LayoutManager may choose to
10526 * is attached to has been changed in the data set. A LayoutManager may choose to
10610 private LayoutManager mLayoutManager;
10636 void start(RecyclerView recyclerView, LayoutManager layoutManager) {
10655 * @return The LayoutManager to which this SmoothScroller is attached. Will return
10659 public LayoutManager getLayoutManager() {
10756 * @see RecyclerView.LayoutManager#getChildCount()
10763 * @see RecyclerView.LayoutManager#findViewByPosition(int)
11013 * An interface which is optionally implemented by custom {@link RecyclerView.LayoutManager}
11027 * LayoutManager should not check whether the position exists in the adapter or not.
11106 mLayoutState = in.readParcelable(LayoutManager.class.getClassLoader());
11258 * {@code true} only if the LayoutManager opted into the auto measure API and RecyclerView
11261 * Note that if the LayoutManager supports predictive animations and it is calculating the
11265 * LayoutManager is always guaranteed to receive another call to
11266 * {@link LayoutManager#onLayoutChildren(Recycler, State)} when this happens.
11384 * present the correct state to LayoutManager in pre-layout pass.
11389 * LayoutManager does not know about the new item's existence in pre-layout. The item will
11393 * You can get the adapter's item count via {@link LayoutManager#getItemCount()} method.
11396 * @see LayoutManager#getItemCount()
11432 * Note that this method will only be called if the associated {@link LayoutManager}
11529 * by the {@link LayoutManager}. This means that the item was already in the Adapter but
11649 * Note that this method may be called after pre-layout phase if LayoutManager adds new
11713 * This means that the View was a child of the LayoutManager when layout started but has
11714 * been removed by the LayoutManager. It might have been removed from the adapter or simply
11722 * LayoutManager's decision whether to layout the changed version of a disappearing
11728 * LayoutManager lays out a new disappearing view that holds the updated information.
11731 * If LayoutManager supports predictive animations, it might provide a target disappear
11745 * null if the LayoutManager did not layout the item.
11757 * but has been added by the LayoutManager. It might be newly added to the adapter or
11768 * LayoutManager does not support predictive animations or it could
11785 * started but its position / size may be changed by the LayoutManager.
11839 * to the LayoutManager but RecyclerView keeps old ViewHolder attached for animations.
11852 * LayoutManager's decision whether to layout the changed version of a disappearing
11858 * LayoutManager lays out a new disappearing view that holds the updated information.