-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
- I have searched existing issues and confirmed this is not a duplicate
This is not a bug report, but an enhancement proposal, so I'm not following the given bug-reporting issue format.
FlexboxLayout is a ViewGroup mainly used for aligning xml-defined views by flexbox. On the other hand, FlexboxLayoutHelper is a LayoutHelper for RecyclerView, which is for displaying large/varying dataset. In most cases, just FlexboxLayout is useful enough. However, the Flexbox library artifact contains both of them.
The problem is that FlexboxLayoutHelper implementation references Android Support Library, and its specific version is linked in the Flexbox library artifact. The application project should check the version of recyclerview-v7 library and match the rest of support modules. (Or, exclude it; but it's quite dangerous in fact).
My suggestion is splitting project modules and resulting library artifacts. Doing this, people who want to use only FlexboxLayout (not FlexboxLayoutHelper) can avoid the recyclerview-v7 linked inside. Making whole-classes artifact still flexbox, we can move the classes into split modules:
- flexbox-common: AlignContent, AlignItems, AlignSelf, FlexContainer, FlexDirection, FlexItem, FlexLine, FlexWrap, JustifyContent
- flexbox-layout: FlexboxLayout (dep: flexbox-common)
- flexbox-layout-manager: FlexboxLayoutManager, FlexboxItemDecoration (dep: flexbox-common)
- flexbox (dep: flexbox-layout, flexbox-layout-manager)
So which module can FlexboxHelper go into? Currently, FlexboxHelper can go nowhere, because it defines behavior of both containers (i.e. FlexboxLayout and FlexboxLayoutManager), and it also contains RecyclerView-related code.
If the modules are to be split, FlexboxHelper code should be split before; first, FlexboxBehavior, one just describing the common behavior; second, FlexboxLayoutManagerHelper, one with the rest code (if needed).
I tried to work with 0.3.1, but it was too hard for me to do that. So I'm making a suggestion issue.
Thanks.