在项目的build.gradle文件中加入
allprojects { repositories { maven {url "http://dl.bintray.com/rouchuan/maven"} } }如果想要自定义效果请在build.gradle文件中引入:
compile 'rouchuan.viewpagerlayoutmanager:viewpagerlayoutmanager-core:1.3.0'如果你想用上面提供的效果,请引入(不需要再引用core):
compile 'rouchuan.viewpagerlayoutmanager:viewpagerlayoutmanager-support:1.3.0'recyclerView.addOnScrollListener(new CenterScrollListener());如果不想启用回弹,请自己给recyclerView添加滚动监听
mLayoutManager.setOnPageChangeListener(new ViewPagerLayoutManager.OnPageChangeListener() { @Override public void onPageSelected(int position) { } @Override public void onPageScrollStateChanged(int state) { } });与recyclerView相同,默认平滑滚动,调用setSmoothScrollbarEnabled设置。
<android.support.v7.widget.RecyclerView android:scrollbars="horizontal" android:id="@+id/recycler" android:layout_width="match_parent" android:layout_height="match_parent" />viewPagerLayoutManager.setEnableEndlessScroll(true);- 拆分了core与support
- 修复了使用Universal-Image-Loader载入图片会导致跳动到第一项
- 支持在view初始化完成之前对recyclerView进行scrollToPosition
- 优化了布局算法的性能
- 支持无限滚动
- 修复了在shouldReverseLayout为true时,平滑滚动条不显示的bug
- 修复了在shouldReverseLayout为true时,scrollToPosition滑动位置错误bug
支持无限滚动- 进一步优化性能
- 添加indicator
- 支持不同大小的子View
- 给support库添加其他效果(长期的课题)
Copyright 2016 shenruochuan Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 




