LayoutParams
open class LayoutParams : MarginLayoutParams
kotlin.Any | |||
↳ | android.view.ViewGroup.LayoutParams | ||
↳ | android.view.ViewGroup.MarginLayoutParams | ||
↳ | androidx.recyclerview.widget.RecyclerView.LayoutParams |
LayoutParams
subclass for children of RecyclerView
. Custom layout managers
are encouraged to create their own subclass of this LayoutParams
class to store any additional required per-child view metadata about the layout.
Summary
Public constructors | |
---|---|
<init>(c: Context!, attrs: AttributeSet!) |
|
<init>(source: MarginLayoutParams!) |
|
<init>(source: LayoutParams!) |
|
<init>(source: RecyclerView.LayoutParams!) |
Public methods | |
---|---|
open Int |
Returns the up-to-date adapter position that the view this LayoutParams is attached to corresponds to. |
open Boolean |
Returns true if the view this LayoutParams is attached to needs to have its content updated from the corresponding adapter. |
open Int | |
open Int |
Returns the adapter position that the view this LayoutParams is attached to corresponds to as of latest layout calculation. |
open Boolean |
Returns true if the view this LayoutParams is attached to is now representing potentially invalid data. |
open Boolean |
Returns true if the adapter data item corresponding to the view this LayoutParams is attached to has been changed in the data set. |
open Boolean |
Returns true if the adapter data item corresponding to the view this LayoutParams is attached to has been removed from the data set. |
Public constructors
<init>
LayoutParams(c: Context!, attrs: AttributeSet!)
<init>
LayoutParams(source: MarginLayoutParams!)
<init>
LayoutParams(source: LayoutParams!)
<init>
LayoutParams(source: RecyclerView.LayoutParams!)
Public methods
getViewAdapterPosition
open fun getViewAdapterPosition(): Int
Returns the up-to-date adapter position that the view this LayoutParams is attached to corresponds to.
Return | |
---|---|
Int: the up-to-date adapter position this view. It may return RecyclerView#NO_POSITION if item represented by this View has been removed or its up-to-date position cannot be calculated. |
viewNeedsUpdate
open fun viewNeedsUpdate(): Boolean
Returns true if the view this LayoutParams is attached to needs to have its content updated from the corresponding adapter.
Return | |
---|---|
Boolean: true if the view should have its content updated |
getViewPosition
open fun getViewPosition(): Int
getViewLayoutPosition
open fun getViewLayoutPosition(): Int
Returns the adapter position that the view this LayoutParams is attached to corresponds to as of latest layout calculation.
Return | |
---|---|
Int: the adapter position this view as of latest layout pass |
isViewInvalid
open fun isViewInvalid(): Boolean
Returns true if the view this LayoutParams is attached to is now representing potentially invalid data. A LayoutManager should scrap/recycle it.
Return | |
---|---|
Boolean: true if the view is invalid |
isItemChanged
open fun isItemChanged(): Boolean
Returns true if the adapter data item corresponding to the view this LayoutParams is attached to has been changed in the data set. A LayoutManager may choose to treat it differently in order to animate its changing state.
Return | |
---|---|
Boolean: true if the item the view corresponds to was changed in the data set |
isItemRemoved
open fun isItemRemoved(): Boolean
Returns true if the adapter data item corresponding to the view this LayoutParams is attached to has been removed from the data set. A LayoutManager may choose to treat it differently in order to animate its outgoing or disappearing state.
Return | |
---|---|
Boolean: true if the item the view corresponds to was removed from the data set |
Interfaces
- ListUpdateCallback
- RecyclerView.ChildDrawingOrderCallback
- RecyclerView.ItemAnimator.ItemAnimatorFinishedListener
- RecyclerView.LayoutManager.LayoutPrefetchRegistry
- RecyclerView.OnChildAttachStateChangeListener
- RecyclerView.OnItemTouchListener
- RecyclerView.RecyclerListener
- RecyclerView.SmoothScroller.ScrollVectorProvider
- ItemTouchHelper.ViewDropHandler
- ItemTouchUIUtil
Classes
- DividerItemDecoration
- PagerSnapHelper
- BatchingListUpdateCallback
- SnapHelper
- AsyncDifferConfig
- AsyncDifferConfig.Builder
- AsyncListDiffer
- StaggeredGridLayoutManager
- StaggeredGridLayoutManager.LayoutParams
- ListAdapter
- GridLayoutManager
- GridLayoutManager.DefaultSpanSizeLookup
- GridLayoutManager.LayoutParams
- GridLayoutManager.SpanSizeLookup
- SortedListAdapterCallback
- AsyncListUtil
- AsyncListUtil.DataCallback
- AsyncListUtil.ViewCallback
- OrientationHelper
- SimpleItemAnimator
- RecyclerView
- RecyclerView.Adapter
- RecyclerView.AdapterDataObserver
- RecyclerView.EdgeEffectFactory
- RecyclerView.ItemAnimator
- RecyclerView.ItemAnimator.ItemHolderInfo
- RecyclerView.ItemDecoration
- RecyclerView.LayoutManager
- RecyclerView.LayoutManager.Properties
- RecyclerView.LayoutParams
- RecyclerView.OnFlingListener
- RecyclerView.OnScrollListener
- RecyclerView.RecycledViewPool
- RecyclerView.Recycler
- RecyclerView.SimpleOnItemTouchListener
- RecyclerView.SmoothScroller
- RecyclerView.SmoothScroller.Action
- RecyclerView.State
- RecyclerView.ViewCacheExtension
- RecyclerView.ViewHolder
- RecyclerViewAccessibilityDelegate
- RecyclerViewAccessibilityDelegate.ItemDelegate
- DiffUtil
- DiffUtil.Callback
- DiffUtil.DiffResult
- DiffUtil.ItemCallback
- AdapterListUpdateCallback
- ItemTouchHelper
- ItemTouchHelper.Callback
- ItemTouchHelper.SimpleCallback
- DefaultItemAnimator
- LinearLayoutManager
- LinearLayoutManager.LayoutChunkResult
- SortedList
- SortedList.BatchedCallback
- SortedList.Callback
- LinearSmoothScroller
- LinearSnapHelper
Annotations