Skip to content

ChenLittlePing/RecyclerCoverFlow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

47151c8 · Sep 1, 2020

History

39 Commits
Sep 1, 2020
Sep 1, 2020
Apr 18, 2017
Jun 9, 2020
Jul 26, 2017
Apr 3, 2018
May 23, 2018
Jun 9, 2020
Apr 18, 2017
Jul 27, 2017
Apr 18, 2017
Apr 26, 2017

Repository files navigation

RecyclerCoverFlow

使用RecyclerView,自定义LayoutManager实现旋转木马相册效果

image

Gradle依赖

请查看最新版本:Release

如:compile 'com.chenlittleping:recyclercoverflow:1.0.6'

使用方式

1,xml中加入

    <recycler.coverflow.RecyclerCoverFlow
            android:id="@+id/list"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
    </recycler.coverflow.RecyclerCoverFlow>

2,Activity中初始化,其中Adapter与RecyclerView的Adapter完全一致

    mList = (RecyclerCoverFlow) findViewById(R.id.list);
    //        mList.setFlatFlow(true); //平面滚动
    mList.setAdapter(new Adapter(this));
    mList.setOnItemSelectedListener(new CoverFlowLayoutManger.OnSelected() {
        @Override
        public void onItemSelected(int position) {
            ((TextView)findViewById(R.id.index)).setText((position+1)+"/"+mList.getLayoutManager().getItemCount());
        }
    });

实现原理:

https://www.jianshu.com/p/1837a801e599

About

使用RecyclerView,自定义LayoutManager实现旋转木马相册效果

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages