Android streaming layout with filtering capabilities

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.