这可能是重复的,但仍然没有正确的答案.我提到了这个,这个和这个
如链接中所述,我希望实施循环的回收视图,即
[查看1] - [查看2] ....- [查看N-1] - [查看N] - [查看1] .....等等
由于没有覆盖方法来获取View并在recyclerview中获取Item,因此我无法成功.
请帮忙.谢谢!
我的回收器适配器代码
public class HorizontalRecyclerAdapter extends RecyclerView.Adapter<HorizontalRecyclerAdapter.ProductViewHolder> {
List<Product> products;
private Context mContext;
ImageLoader imageLoader;
HorizontalRecyclerAdapter(List<Product> products, Context mContext) {
this.products = products;
this.mContext = mContext;
}
@Override
public ProductViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.product_layout, parent, false);
return new ProductViewHolder(v);
}
@Override
public void onBindViewHolder(final ProductViewHolder holder, int position) {
imageLoader = SingletonRequestQueue.getInstance(mContext).getImageLoader();
String URL = products.get(position).getProductImageUrl();
holder.progressBar.setVisibility(View.VISIBLE); …Run Code Online (Sandbox Code Playgroud)