有关如何让recyclerView
停止更改滚动的disabled
项目的任何帮助。这是一些示例代码:
@Override
public PlayerSelectRVAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
Context context = parent.getContext();
LayoutInflater inflater = LayoutInflater.from(context);
View contactView = inflater.inflate(R.layout....., parent, false);
ViewHolder viewHolder = new ViewHolder(contactView);
return viewHolder;
}
@Override
public void onBindViewHolder(PlayerSelectRVAdapter.ViewHolder viewHolder, int position) {
final Object player = objects.get(position);
viewHolder.setPlayer(player);
SetUi(viewHolder);
}
public static class ViewHolder extends RecyclerView.ViewHolder {
private final View mView;
private Object player;
public ViewHolder(View itemView) {
super(itemView);
this.mView = itemView;
mView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (listener != null)
listener.onItemClick(mView, getLayoutPosition());
}
});
}
}
}
好的,所以在我的setPlayer
方法中,我也会为该持有者提供itemView
并设置是否为disabled
。然后我调用我的SetUi
来实际进行视图设置。
所有这些都是正确的,直到我开始滚动并且它变得混乱。事实上,最终一切都变为disabled
。