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