All Projects → ch4vi → Flowlayout

ch4vi / Flowlayout

Licence: apache-2.0
An Android Layout Manager to create a gridview with cells of different sizes inspired by Flow Layout for iOS.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Flowlayout

Greedo Layout For Android
Full aspect ratio grid LayoutManager for Android's RecyclerView
Stars: ✭ 1,588 (+1520.41%)
Mutual labels:  layout, recyclerview
RollingLayoutManager
vrgsoft.net
Stars: ✭ 57 (-41.84%)
Mutual labels:  recyclerview, layout
mate-tweak
Tweak tool for the MATE Desktop
Stars: ✭ 57 (-41.84%)
Mutual labels:  manager, layout
Recyclerview Examples
Samples to learn about RecyclerView
Stars: ✭ 87 (-11.22%)
Mutual labels:  recyclerview
Tag Manager
Free Open Source Matomo Tag Manager - A simple way to manage and maintain all of your (third-party) tags on your website.
Stars: ✭ 91 (-7.14%)
Mutual labels:  manager
Shed Css
Functional and customizable CSS utilities with familiar names
Stars: ✭ 93 (-5.1%)
Mutual labels:  layout
Flexlayout
FlexLayout adds a nice Swift interface to the highly optimized facebook/yoga flexbox implementation. Concise, intuitive & chainable syntax.
Stars: ✭ 1,342 (+1269.39%)
Mutual labels:  layout
Endless Recyclerview
Endless support for RecyclerView
Stars: ✭ 86 (-12.24%)
Mutual labels:  recyclerview
Paper Code
对一些好的技术文章结合自己的实践经验进行翻译、举例说明等或自己的经验分享。主要包括架构设计、模式设计、模型设计、重构等。
Stars: ✭ 94 (-4.08%)
Mutual labels:  layout
Bannerlayout
Support unlimited picture rotation BannerLayout, the minimum implementation of the code banner
Stars: ✭ 92 (-6.12%)
Mutual labels:  layout
Recyclerviewdemo
Demo showing the basics to advanced use cases of Android RecyclerView
Stars: ✭ 92 (-6.12%)
Mutual labels:  recyclerview
Kvconstraintkit
An Impressive Auto Layout DSL for iOS, tvOS & OSX. & It is written in pure swift.
Stars: ✭ 91 (-7.14%)
Mutual labels:  layout
Dragview2fill
ViewDragHelper结合RecyclerView的使用示例
Stars: ✭ 94 (-4.08%)
Mutual labels:  recyclerview
Lingo
A Gui To Manage Laravel Translation Files
Stars: ✭ 88 (-10.2%)
Mutual labels:  manager
Banner
Android Viewpager rotation control, application guide page controls, support vertical, horizontal cycle scrolling, extended from view support animation, indicator extension and so on;Android viewpager轮播图控件、app引导页控件,支持垂直、水平循环滚动,扩展自viewpager 支持动画,指示器扩展等。
Stars: ✭ 96 (-2.04%)
Mutual labels:  recyclerview
Recyclerviewpresenter
RecyclerView Adapter Library with different models and different layouts as convenient as possible.
Stars: ✭ 86 (-12.24%)
Mutual labels:  recyclerview
React Native Flexbox Grid
Responsive Grid for React Native
Stars: ✭ 95 (-3.06%)
Mutual labels:  layout
Lwmem
Lightweight dynamic memory manager library for embedded systems with memory constraints. It implements malloc, calloc, realloc and free functions
Stars: ✭ 92 (-6.12%)
Mutual labels:  manager
Recyclerviewheader
[DEPRECATED] Super fast and easy way to create header for Android RecyclerView
Stars: ✭ 1,312 (+1238.78%)
Mutual labels:  recyclerview
Interfacss
The CSS-inspired styling and layout framework for iOS
Stars: ✭ 92 (-6.12%)
Mutual labels:  layout

FlowLayout – Android Layout Manager

Download

A LayoutManager that must be used with RecyclerView inspired by Flow Layout for iOS.

The layout manager places cells on a linear path and fits as many cells along that line as it can. When the layout manager runs out of room on the current line, it creates a new line and continues the layout process there.

Compile

Using Gradle

Requires Min SDK version >= 10

    compile 'com.ch4vi.flowlayoutmanager:flowlayoutmanager:1.0.2'

Using Maven

    <dependency>
      <groupId>com.ch4vi.flowlayoutmanager</groupId>
      <artifactId>flowlayoutmanager</artifactId>
      <version>1.0.2</version>
      <type>pom</type>
    </dependency>

Usage

First of all add a RecyclerView to your layout

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/button_center"
        android:background="@color/e"
        android:scrollbars="vertical" />

Then in your class initialize the RecyclerView, in this case with 3 columns, vertical orientation and the first cell size will be 1x1, the second 2x2...

    val manager = FlowLayoutManager(3, RecyclerView.VERTICAL, object : FlowLayoutManager.Interface {
        override fun getProportionalSizeForChild(position: Int): Pair<Int, Int> {
            return when (position) {
                 0 -> Pair(1, 1)
                 1 -> Pair(2, 2)
                 2 -> Pair(4, 1)
                 3 -> Pair(3, 2)
                 else -> Pair(1, 1)
            }
        }
    })
    recyclerView.layoutManager = manager

Note If we add a cell too big for example if we have 3 columns and we add a cell 4x1, this cell will be ommited in the drawing process.

Optionally you can add a custom space between the cells adding a dimen resource named "default_card_insets" and setting an item decoration to your RecyclerView like in the example

    <dimen name="default_card_insets">8dp</dimen>
    recyclerView.addItemDecoration(manager.InsetDecoration(this))

Demo

Credits

License

FlowLayout is license under the Apache 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].