VegaLayoutManager

Introduction: 列表滑动时,头部 itemView 缩放动画
More: Author   ReportBugs   DemoAPK   
Tags:
RecyclerView-LayoutManager-item动画-

a customized LayoutManager - fade and shrink the head itemView when scrolling.

实现效果

Dribbble 设计:链接
IOS 实现:VegaScroll

代码思路

RecyclerView 最顶部的 itemView,会随着手指滑动实现收缩隐藏与放大显示,并伴随 recycler 的回收与复用。

代码比较简单粗暴,使用自定义的 LayoutManger,内置 SnapHelper。
由于想要在任意时刻都能 snap 到第一个子 View,所以在 LayoutManager 中用了比较讨巧的方法去设定 scroll 的最大值。

使用方法

  1. gradle 引入
    compile 'com.stone.vega.library:VegaLayoutManager:1.0.6'
    
  2. java 文件中设定 LayoutManager
    recyclerView.setLayoutManager(new VegaLayoutManager());
    

demo 下载

点击下载

License

Copyright 2017, xmuSistone

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.
Apps
About Me
GitHub: Trinea
Facebook: Dev Tools