Skip to content

YukiSora/FlowLayout

Repository files navigation

FlowLayout

A FlowLayout for Android.

Download

Maven

<dependency>
  <groupId>moe.yukisora</groupId>
  <artifactId>flowlayout</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

Gradle

compile 'moe.yukisora:flowlayout:1.0.0'

Usage

<moe.yukisora.flowlayout.FlowLayout
    android:id="@+id/flowLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:text="Java"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
    
    <TextView
        android:text="C"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</moe.yukisora.flowlayout.FlowLayout>

Attributes

fl_align

Value Demo
left align_left
right align_right
center align_center
justify align_justify

fl_last_row_align

Value Demo
left last_row_left
right last_row_right
center last_row_center
justify last_row_justify
inherit last_row_inherit

fl_vertical_align

Value Demo
top vertical_align_top
middle vertical_align_middle
bottom vertical_align_bottom

fl_direction

Value Demo
ltr ltr
rtl rtl

Attribute list

Attribute Value
fl_align left/right/center/justify
fl_direction ltr/rtl
fl_item_spacing 0dp/dimension
fl_last_row_align left/right/center/justify/inherit
fl_max_items_per_row undefined/int
fl_row_spacing 0dp/dimension
fl_vertical_align top/middle/bottom

Licence

MIT License

Copyright (c) 2017 Yuki Sora

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.