Skip to content

TigerHix/RecyclerViewCardGallery

 
 

Repository files navigation

RecyclerViewCardGallery

RecyclerView实现Card Gallery效果,替代ViewPager方案。能够快速滑动并最终定位到居中位置

RecyclerViewCardGallery.gif

录制效果有点渣,见谅~ 可下载apk自己玩

Usage

调用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());

Apk download

app_debug.apk

GPU Render测试图

RecyclerViewCardGallery.gif

Reference

使用RecyclerView实现Gallery画廊效果

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%