RecyclerViewCardGallery

  • RecyclerView
  • ★★★★★
  • 2016-09-05 01:06
  • 14434 kb
  • Android Studio

介绍:

RecyclerView实现Card Gallery效果,替代ViewPager方案。

运行效果:

使用说明:

调用new PageScaleHelper().attachToRecyclerView(mRecyclerView);扩展RecyclerView

final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
mRecyclerView.setLayoutManager(linearLayoutManager);
mRecyclerView.setAdapter(new CardAdapter());
// mRecyclerView绑定scale效果
new CardScaleHelper().attachToRecyclerView(mRecyclerView);

在adapter相应的位置调用

mCardAdapterHelper.onCreateViewHolder(parent, itemView);
mCardAdapterHelper.onBindViewHolder(holder.itemView, position, getItemCount());

Reference

使用RecyclerView实现Gallery画廊效果

Apk download

app_debug.apk