Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

ChipsLayoutManager

> 编程语言
Open source

ANDROID. ChipsLayoutManager (SpanLayoutManager, FlowLayoutManager). A custom layout manager for RecyclerView which mimicric TextView span behaviour, flow layout

3.3K stars0 likes0 views
WebsiteGitHub

About

ANDROID. ChipsLayoutManager (SpanLayoutManager, FlowLayoutManager). A custom layout manager for RecyclerView which mimicric TextView span behaviour, flow layout

# ChipsLayoutManager [](#) [](https://android-arsenal.com/details/1/4568#) ## This is ChipsLayoutManager - custom Recycler View's LayoutManager which moves item to the next line when no space left on the current This layout manager could represent [Google Chips material design pattern](https://material.google.com/components/chips.html#) As an android developer i see that google isn't so polite to support all our wishes, and when i faced with such common task like create spannable list but with support of CRUD animations i decided to make such stuff and share it.

## Setup and usage ### Installation [ ](https://bintray.com/beloo/widget/ChipsLayoutManager/_latestVersion) with gradle ```GRADLE compile 'com.beloo.widget:ChipsLayoutManager:0.3.7@aar' ``` Assuming you have installed jCenter provider: ```GRADLE allprojects { repositories { jcenter() } } ``` or just import `ChipsLayoutManager` module to your project. ### Features Layout manager represents chips or spanned or "bubble" structure of list items and is a good replace for typical implementations of such issue based on spans in `TextView` or custom `FlowLayout`s. * supports `RecyclerView`'s/`LayoutManager`'s features, such as default animations while CRUD items & custom `ItemAnimator`s, `ItemDecorator`s, scrolling etc. `wrap_content` of height is supported * vertical scrolling is supported. Horizontal scrolling isn't supported. It is possible to disable vertical scrolling as well. Supported padding/margin, clipToPadding parameter of `RecyclerView` * supports different height and width of items * recycling items support (another advantage over `TextView` approach) * items gravity inside row support. For all items or only for required ones * LTR and RTL support * activity orientation change support * predictive animations supported (animate view movement outside of visible bounds) * setting max count of view in row * you are able to break row due to your conditions * justified views in row with spaces or additional view size | Insert/delete | Move | |---|---| | || ####Layout Directions | | Left to Right | Right to Left | |---|---|---| | Horizontal | || | Vertical | || ####Fill strategy Any row has some space left, where is impossible to place the next view, because that space is too small. But we could distribute that space for available views in that row. Row strategy is a mode of distribution left space. * `STRATEGY_DEFAULT` - is used by default. Left space is placed at the end of the row. * `STRATEGY_FILL_VIEW` - available space is distributed among views. * `STRATEGY_FILL_SPACE` - available space is distributed among spaces between views, start & end views are docked to a nearest border. * `STRATEGY_CENTER` - available space is distributed among spaces between views, start & end spaces included. Views are placed in center of canvas. * `STRATEGY_CENTER_DENSE` - Views are placed in center of canvas. There is no extra space distributed between views. In such layouts by default last row isn't considered completed. So strategy isn't applied for last row. But you can also enable opposite behaviour. ### Usage ``` … ``` Notice that if you changed gravity resolver or row breaker conditions in runtime - it won't affect already drown items and cached item positions. You have to call `notifyItemChanged` on `ChipsLayoutManager` otherwise layout won't be predictable. **Device current direction** have been chosen by default. You can manipulate with layout direction (**LTR** or **RTL**)
_On Api >= 17:_ ```XML ``` or programmatically (_on all supported Api:_): ```JAVA ViewCompat.setLayoutDirection(recyclerView, ViewCompat.LAYOUT_DIRECTION_RTL); ``` For example look at sample application.
### Bonus You may need an `RecyclerView.ItemDecoration` to work with `ChipsLayoutManager` for fast setup as showed in sample.
It contained in same package and named `SpacingItemDecoration`. ## Support [ ](https://github.com/BelooS/ChipsLayoutManager/tree/dev) BETA is going. I respond to your founded issues. Just create a ticket if you found something goes wrong.
Thanks for testing, guys. I'm really appreciate it. ### Contributors All pull requests are welcome. I've tried to make code clean & readable, so the next is up to you. I appreciate any help and contributors will be mentioned here. Thanks, [szijpeter](https://github.com/szijpeter) and everyone for valuable updates. ### Known issues I create issues in tracking board of known problems. These issues are going to be fixed in next versions. ### License [ ](https://github.com/BelooS/ChipsLayoutManager/blob/dev/LICENSE) Copyright 2016 Beloy Oleg, Ukraine. 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.

GitHub Issues· 38 open

View all on GitHub
  • #71

    Broken README link

    Updated May 23, 2025
  • #69

    Need to publish to different maven repository

    Updated May 15, 2025
  • #68

    Support AndroidX

    Updated Nov 20, 2024
  • #38

    Bug : setMaxViewsInRow doesn't work

    Updated Jan 5, 2022
  • #48

    IllegalArgumentException: top point of input rect can't be lower than minTop

    Updated Nov 16, 2021
  • #64

    when use STRATEGY_FILL_VIEW, gravity center invalid

    Updated Apr 5, 2021
  • #39

    Margin between items

    Updated Mar 5, 2021
  • #34

    IllegalArgumentException: you can't move above of maxItemCount

    Updated Jan 31, 2020
  • #35

    Scroll to bottom programmatically

    Updated Nov 29, 2019
  • #31

    ProGuard and Orientation annotation

    Updated Sep 4, 2019

Highlights

  • •supports different height and width of items
  • •recycling items support (another advantage over TextView approach)
  • •items gravity inside row support. For all items or only for required ones
  • •LTR and RTL support
  • •activity orientation change support
  • •predictive animations supported (animate view movement outside of visible bounds)
  • •setting max count of view in row
  • •you are able to break row due to your conditions
  • •justified views in row with spaces or additional view size
  • •STRATEGY_DEFAULT - is used by default. Left space is placed at the end of the row.

> Tags

Javaandroidlayoutmanagerrecyclerviewrecyclerview-adapter

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言