Android streaming layout with filtering function, filtering android streaming Layout

Source: Internet
Author: User

Android streaming layout with filtering function, filtering android streaming Layout
FilterFlowLayout

For stream layout with filter functions, see FlowLayout

  • Remove sub-views whose width is not in the range (proportion or actual value)
  • You can set the maximum number of rows.
  • You can add horizontal spacing between components.
  • You can add line spacing

System Requirements

Android 4.0 or above

Quick Start
<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_content"    cb:maxWidthRatio="0.5"    cb:minWidth="80dp"    cb:maxLines="3"    cb:horizontalGap="5dp"    cb:verticalGap="5dp"    >
  • The maximum width is half of the width of FlowLayout.
  • The minimum width is 80dp.
  • The maximum number of rows is 3.
  • Horizontal spacing: 5dp
  • Vertical spacing: 5dp
Xml configuration
MaxWidthRatio: the maximum width ratio. relative to the total width of FlowLayout, the default value is-1 minWidthRatio. relative to the total width of FlowLayout, the default value is-1 maxWidth. The default value is 0 minWidth, the default value is 0. the maximum number of lines displayed in maxLines. The default value is Integer. MAX_VALUEhorizontalGap the gap between each row of sub-attempts. The default value is 0 verticalGap. The default value is 0.
Related Methods
SetMaxChildWidth (float maxChildWidth) // setMinChildWidth (float minChildWidth) // setMaxLines (int maxLines) // setHorizontalGap (int horizontalGap) // set the horizontal spacing setVerticalGap (int verticalGap) // set the Vertical spacing
Notes
  • When both the width ratio and the specific value are set in xml, the proportion priority is higher than the actual value.
  • If the width is not set, the maximum width is the width of FlowLayout.

Github address: https://github.com/androiddevelop/FilterFlowLayout

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

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.