/FlowLayout

使用Kotlin编写的流式布局(标签布局),支持设置标签gravity

Primary LanguageKotlinApache License 2.0Apache-2.0

FlowLayout

使用Kotlin编写的流式布局(标签布局),支持设置标签gravity

截图

Image text Image text Image text Image text

集成

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
	implementation 'com.github.ironbear775:FlowLayout:1.0.0'
}

使用

布局文件中声明,通过flowGravity设置标签摆放方式,支持start,center,end

<com.ironbear775.android.flowlayoutlibrary.FlowLayout
    android:id="@+id/flowLayout"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    app:flowGravity="start" />

代码中设置gravity

flowLayout.setGravity(FlowLayout.START)
flowLayout.setGravity(FlowLayout.CENTER)
flowLayout.setGravity(FlowLayout.END)