Some LayoutManager created by fanhl.
A linear LayoutManger can scroll by any Curves
.
type | 类型 | code | sample | params |
---|---|---|---|---|
Snake | 贪吃蛇 | PathCurve... | row,col | |
FerrisWheel | 摩天轮 | |||
Parabola | 抛物线 | x=i+0.5; y=0.2i^2+0.5 | focus | |
Slash | 斜线 | x=i+0.5;y=slope*i+0.5 | slope |
/** 抛物线 */
class Parabola(
private val focus: Float = .2f
) : CurveLayoutManger.Curve {
override fun getInterpolation(i: Float, position: CurveLayoutManger.Vector2) {
position.x = i + 0.5f
position.y = focus * i * i + 0.5f
}
}
recycler_view.layoutManager = CurveLayoutManger(Parabola())
-
Add it in your root build.gradle at the end of repositories:
allprojects { repositories { ... maven { url 'https://jitpack.io' } } }
-
Add the dependency in your module build.gradle:
dependencies { implementation 'com.github.dyguests:LinLayoutManager:x.y.z' }
创建一个 RecyclerView LayoutManager – Part 1
创建 RecyclerView LayoutManager – Part 2
创建 RecyclerView LayoutManager – Part 3
Zoom central image recycler view
Recycler view - resizing item view while scrolling (for carousel like effect)
danylovolokh/LondonEyeLayoutManager
- CurveLayoutManager
- CollageLayoutManager
- ItemAnimation
- item间的距离计算公式
Copyright 2018 Fanhl
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.