All Projects → cdflynn → Turn Layout Manager

cdflynn / Turn Layout Manager

Licence: apache-2.0
A carousel layout manager for RecyclerView

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Turn Layout Manager

InfiniteScrollRecyclerView
Enables the RecyclerView to Auto scroll for indefinite time.
Stars: ✭ 49 (-94.82%)
Mutual labels:  recyclerview, layoutmanager
Horizontalpicker
A simple, customizable and easy to use picker where centre view is scaled up
Stars: ✭ 337 (-64.38%)
Mutual labels:  layoutmanager, recyclerview
SlideView
🔖 Card RecycleViewManager, to make your interface cool.Use recyclerView to add cool effects to the view.
Stars: ✭ 16 (-98.31%)
Mutual labels:  recyclerview, layoutmanager
CardLayoutManager
A custom layoutManager providing a Tinder-like cards effect.
Stars: ✭ 37 (-96.09%)
Mutual labels:  recyclerview, layoutmanager
Awesome Recyclerview Layoutmanager
RecyclerView-LayoutManager Resources
Stars: ✭ 581 (-38.58%)
Mutual labels:  layoutmanager, recyclerview
epg magic carousel
Awesome RecyclerView with custom LayoutManager
Stars: ✭ 98 (-89.64%)
Mutual labels:  recyclerview, layoutmanager
Chipslayoutmanager
ANDROID. ChipsLayoutManager (SpanLayoutManager, FlowLayoutManager). A custom layout manager for RecyclerView which mimicric TextView span behaviour, flow layouts behaviour with support of amazing recyclerView features
Stars: ✭ 3,138 (+231.71%)
Mutual labels:  layoutmanager, recyclerview
Jkcardlayout
高仿即刻APP探索页卡片布局拖拽、卡片前进、回退和下拉效果,采用RecyclerView和自定义LayoutManager实现
Stars: ✭ 111 (-88.27%)
Mutual labels:  layoutmanager, recyclerview
Spannedgridlayoutmanager
Android RecyclerView.LayoutManager that resizes and reorders views based on SpanSize
Stars: ✭ 492 (-47.99%)
Mutual labels:  layoutmanager, recyclerview
Stackcardlayoutmanager
Stars: ✭ 376 (-60.25%)
Mutual labels:  layoutmanager, recyclerview
RollingLayoutManager
vrgsoft.net
Stars: ✭ 57 (-93.97%)
Mutual labels:  recyclerview, layoutmanager
Gallerylayoutmanager
New way to implements ViewPager/Gallery in Android with RecycleView
Stars: ✭ 684 (-27.7%)
Mutual labels:  layoutmanager, recyclerview
Cardstackview
📱Tinder like swipeable card view for Android
Stars: ✭ 1,850 (+95.56%)
Mutual labels:  layoutmanager, recyclerview
Focuslayoutmanager
有焦点item的水平/垂直滚动RecyclerView-LayoutManager。仿Android豆瓣书影音“推荐“频道列表布局
Stars: ✭ 772 (-18.39%)
Mutual labels:  layoutmanager, recyclerview
Carouselrecyclerview
Carousel Recyclerview let's you create carousel layout with the power of recyclerview by creating custom layout manager.
Stars: ✭ 107 (-88.69%)
Mutual labels:  layoutmanager, recyclerview
SpannedGridLayoutManager
Android RecyclerView.LayoutManager that resizes and reorders views based on SpanSize
Stars: ✭ 522 (-44.82%)
Mutual labels:  recyclerview, layoutmanager
Cardswipelayout
Use RecyclerView to achieve card swipe layout , like Tantan . (模仿探探卡片滑动效果的布局)
Stars: ✭ 1,081 (+14.27%)
Mutual labels:  layoutmanager, recyclerview
Reel Search Android
Reel Search for Android is a UI/UX design for autocomplete action. It is a beautiful minimalistic addition to any use case.
Stars: ✭ 110 (-88.37%)
Mutual labels:  layoutmanager, recyclerview
Stacklayoutmanager
customized layoutmanager,let item pile up like stackview/类似最美有物卡片堆叠效果
Stars: ✭ 343 (-63.74%)
Mutual labels:  layoutmanager, recyclerview
Discretescrollview
A scrollable list of items that centers the current element and provides easy-to-use APIs for cool item animations.
Stars: ✭ 5,533 (+484.88%)
Mutual labels:  layoutmanager, recyclerview

Turn Layout Manager

A simple carousel for RecyclerView.

Demo

Usage

Just create a new TurnLayoutManager using the constructor:

TurnLayoutManager(context,              // provide a context
                  Gravity.START,        // from which direction should the list items orbit? 
                  Orientation.VERTICAL, // Is this a vertical or horizontal scroll?
                  radius,               // The radius of the item rotation
                  peek,                 // Extra offset distance
                  shouldRotate);        // should list items angle towards the center? true/false.

Just like a LinearLayoutManager, a TurnLayoutManager specifies an orientation, either VERTICAL or HORIZONTAL for vertical and horizontal scrolling respectively.

In addition to orientation, supply a Gravity (either START or END). Together, these define the axis of rotation.

Gravity.START
Orientation.VERTICAL

┏─────────┓
┃ x       ┃
┃  x      ┃
┃   x     ┃
┃   x     ┃
┃   x     ┃
┃  x      ┃
┃ x       ┃
┗─────────┛
Gravity.END
Orientation.VERTICAL
┏─────────┓
┃       x ┃
┃      x  ┃
┃     x   ┃
┃     x   ┃
┃     x   ┃
┃      x  ┃
┃       x ┃
┗─────────┛
     
Gravity.START
Orientation.HORIZONTAL
┏─────────┓
┃x       x┃
┃ x     x ┃
┃   xxx   ┃
┃         ┃
┃         ┃
┃         ┃
┃         ┃
┗─────────┛

Gravity.END
Orientation.HORIZONTAL
┏─────────┓
┃         ┃
┃         ┃
┃         ┃
┃         ┃
┃   xxx   ┃
┃ x     x ┃
┃x       x┃
┗─────────┛

Install

Add the JitPack repository to your root build.gradle

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency to your module's build.gradle

dependencies {
    implementation 'com.github.cdflynn:turn-layout-manager:v1.3.1'
}

How It Works

TurnLayoutManager uses the base functionality of LinearLayoutManager with some slight modifications. Child views are positioned normally as LinearLayoutManager does, but they're offset along the rotation radius and peek distance. This involves some trade offs.

Benefits:
  • Automatically supports predictive animations, including mutations to radius and peek distance.
  • Inherits stable support for different scroll directions and therefore can introduce support for Gravity.
  • Does not attempt to re-solve the huge variety of edge cases that LinearLayoutManager already solves, and thus avoids re-introducing those exceptions.
Drawbacks:
  • It's less efficient than a from-scratch implementation of LayoutManager. Specifically, TurnLayoutManager will have a strictly longer layout pass than LinearLayoutManager, and for very heavyweight list rows it may drop a frame that LinearLayoutManager otherwise would not. No matter what layout manager you use, try to keep your item layouts efficient.
  • List items are not forced to adjust their position parallel to the scroll direction, only their perpendicular offset. Items enter and leave the screen a bit faster than they would on a real turning surface, though the effect is subtle.

A full re-implementation of a new LayoutManager could potentially solve those drawbacks.

License

   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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].