ANDROID. ChipsLayoutManager (SpanLayoutManager, FlowLayoutManager). A custom layout manager for RecyclerView which mimicric TextView span behaviour, flow layout
ANDROID. ChipsLayoutManager (SpanLayoutManager, FlowLayoutManager). A custom layout manager for RecyclerView which mimicric TextView span behaviour, flow layout
## 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**)
Broken README link
Need to publish to different maven repository
Support AndroidX
Bug : setMaxViewsInRow doesn't work
IllegalArgumentException: top point of input rect can't be lower than minTop
when use STRATEGY_FILL_VIEW, gravity center invalid
Margin between items
IllegalArgumentException: you can't move above of maxItemCount
Scroll to bottom programmatically
ProGuard and Orientation annotation