Filterflowlayout
Flow layout with filter function, reference FlowLayout
- You can remove a child view that is not in the range (scale or True value)
- Maximum number of rows can be set
- You can add horizontal spacing between components
- Line spacing can be added
System Requirements
Android 4.0 +
Quick to use
<me.codeboy.android.lib.filterflowlayout xmlns:cb=" http://schemas.android.com/apk/ Res-auto "android:id=" @+id/filterflowlayout "android:layout_width=" match_parent "android:layout_height=" Wrap_cont ENT "cb:maxwidthratio=" 0.5 "cb:minwidth=" 80DP "cb:maxlines=" 3 "cb:horizontalgap=" 5DP "cb:verticalgap=" 5DP "
- The maximum width is half the width of the FlowLayout
- Minimum width is 80DP
- The maximum number of rows is 3 rows
- Horizontal spacing is 5DP
- Vertical spacing is 5DP
XML configuration
maxWidthRatio 最大宽度比例,相对于FlowLayout的总宽度,默认-1minWidthRatio 最小宽度比例,相对于FlowLayout的总宽度,默认-1maxWidth 最大宽度,默认0minWidth 最小宽度,默认0maxLines 最大显示行数,默认Integer.MAX_VALUEhorizontalGap 每一行子试图之间的空隙,默认是0verticalGap 多行式行空隙,默认是0
Related methods
setMaxChildWidth(float maxChildWidth) //设置最大宽度setMinChildWidth(float minChildWidth) //设置最小宽度setMaxLines(int maxLines) //设置最大行数setHorizontalGap(int horizontalGap) //设置水平间距setVerticalGap(int verticalGap) //设置垂直间距
Precautions
- The ratio (ratio) takes precedence over the true value when the ratio of the width to the specific value is set in the XML.
- When the width is not set, the maximum width is flowlayout width.
GitHub Address: https://github.com/androiddevelop/FilterFlowLayout
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android streaming layout with filtering capabilities