• Stars
    star
    2,392
  • Rank 19,233 (Top 0.4 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created almost 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A flow layout for Android with auto-spacing.

FlowLayout

A FlowLayout for Android, which allows child views flow to next row when there is no enough space. The spacing between child views can be calculated by the FlowLayout so that the views are evenly placed.

Gradle

AndroidX:

implementation 'com.nex3z:flow-layout:1.3.3'

AppCompact:

implementation 'com.nex3z:flow-layout:1.2.4'

Usage

<com.nex3z.flowlayout.FlowLayout
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:flChildSpacing="auto"
    app:flChildSpacingForLastRow="align"
    app:flRowSpacing="8dp">

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

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

    <!--...-->

</com.nex3z.flowlayout.FlowLayout>

Attributes

Attribute Format Description
flFlow boolean true to allow flow. false to restrict all child views in one row. The default is true.
flChildSpacing auto/dimension The horizontal spacing between child views. Either auto, or a fixed size. The default is 0dp.
flChildSpacingForLastRow auto/align/
dimension
The horizontal spacing between child views of the last row. Either auto, align or a fixed size. If not set, childSpacing will be used instead.
flRowSpacing auto/dimension The vertical spacing between rows. Either auto, or a fixed size. The default is 0dp.
flRtl boolean true to layout child views from right to left. false to layout from left to right. The default is false.
flMaxRows integer The maximum height of FlowLayout in terms of number of rows.

auto means that the actual spacing is calculated as per the size of the FlowLayout and the number of child views (or rows), so that the child views (or rows) are placed evenly.

align in childSpacingForLastRow means that the horizontal spacing of the child views in the last row keeps the same with the spacing used in the row above. If there is only one row in FlowLayout and the childSpacingForLastRow is set to align, this value is ignored and the actual spacing is calculated using childSpacing.

Licence

Copyright 2016 nex3z

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

ToggleButtonGroup

A group of flowable toggle buttons, with multiple / single selection support and button customization.
Java
418
star
2

NotificationBadge

A notification badge with animation.
Kotlin
317
star
3

tflite-mnist-android

MNIST with TensorFlow Lite on Android
Kotlin
216
star
4

machine-learning-exercise

Python implementation of the programming assignment from Machine Learning class on Coursera, which is originally implemented in Matlab/Octave.
Jupyter Notebook
83
star
5

android-examples

Java
36
star
6

tfmobile-mnist-android

MNIST with TensorFlow Mobile on Android
Python
10
star
7

NppLogGazer

Notepad++ plugin providing fancy search features for log analysis.
C#
8
star
8

tfserving-mnist

TensorFlow Serving model for handwritten digits classification from MNIST.
Python
6
star
9

PopularMovies

Udacity Developing Android Apps course project.
Java
4
star
10

kotlin-reference-cn

Kotlin ζ–‡ζ‘£ηš„δΈ­ζ–‡ηΏ»θ―‘
3
star
11

NppQuickSearchPanel

Notepad++ plugin for quick search.
C#
3
star
12

ToShakeList

Java
2
star
13

Shalarm

Java
2
star
14

PopularMoviesKotlin

Kotlin
1
star
15

tflite-model-maker-flowers

Kotlin
1
star
16

garbage-classification-android

Kotlin
1
star
17

coursera-spa-with-angularjs-assignment

Assignment for Single Page Web Applications with AngularJS by Johns Hopkins University on Coursera
JavaScript
1
star
18

ExpandableCircleView

A circular progress indicator that expands or shrinks the circle to the given progress.
Java
1
star
19

tensorflow-exercise

Jupyter Notebook
1
star
20

think-bayes-playground

Jupyter Notebook
1
star
21

CheckableGroup

Java
1
star
22

oj-exercise

Exercises from various OJ. Releated articles can be found at http://blog.nex3z.com/tag/acm/.
C++
1
star