RecyclerView.LayoutParams
public static class RecyclerView.LayoutParams
extends ViewGroup.MarginLayoutParams
Known Direct Subclasses
|
LayoutParams
子类RecyclerView
。 鼓励自定义layout managers
创建其LayoutParams
类的自己的子类,以存储有关该布局的任何其他所需的每个子视图元数据。
摘要(Summary)
Public constructors
RecyclerView.LayoutParams
RecyclerView.LayoutParams (Context c,
AttributeSet attrs)
参数(Parameters) |
c |
Context
|
attrs |
AttributeSet
|
RecyclerView.LayoutParams
RecyclerView.LayoutParams (int width,
int height)
参数(Parameters) |
width |
int
|
height |
int
|
RecyclerView.LayoutParams
RecyclerView.LayoutParams (ViewGroup.MarginLayoutParams source)
参数(Parameters) |
source |
ViewGroup.MarginLayoutParams
|
RecyclerView.LayoutParams
RecyclerView.LayoutParams (ViewGroup.LayoutParams source)
参数(Parameters) |
source |
ViewGroup.LayoutParams
|
RecyclerView.LayoutParams
RecyclerView.LayoutParams (RecyclerView.LayoutParams source)
参数(Parameters) |
source |
RecyclerView.LayoutParams
|
公共方法(Public methods)
getViewAdapterPosition
int getViewAdapterPosition ()
返回此LayoutParams所连接的视图所对应的最新适配器位置。
返回(Returns) |
int |
the up-to-date adapter position this view. It may return NO_POSITION if item represented by this View has been removed or its up-to-date position cannot be calculated. |
getViewLayoutPosition
int getViewLayoutPosition ()
返回此LayoutParams所连接的视图对应于最新布局计算的适配器位置。
返回(Returns) |
int |
the adapter position this view as of latest layout pass |
isItemChanged
boolean isItemChanged ()
如果数据集中已更改与该LayoutParams视图相对应的适配器数据项,则返回true。 LayoutManager可以选择以不同的方式对待它,以便为其变化的状态设置动画。
返回(Returns) |
boolean |
true if the item the view corresponds to was changed in the data set |
isItemRemoved
boolean isItemRemoved ()
如果与此LayoutParams相关的适配器数据项已从数据集中删除,则返回true。 LayoutManager可以选择以不同的方式处理它,以便为其传出或消失状态制作动画。
返回(Returns) |
boolean |
true if the item the view corresponds to was removed from the data set |
isViewInvalid
boolean isViewInvalid ()
如果此LayoutParams所连接的视图现在正在代表潜在的无效数据,则返回true。 LayoutManager应该废弃/回收它。
返回(Returns) |
boolean |
true if the view is invalid |
viewNeedsUpdate
boolean viewNeedsUpdate ()
如果此LayoutParams所附的视图需要从相应的适配器更新其内容,则返回true。
返回(Returns) |
boolean |
true if the view should have its content updated |