Linear layout, that wrap its content to the next line if there is no space in the current line.

Overview

Android flow layout

Introduction

Extended linear layout that wrap its content when there is no place in the current line.

Maven Central [Travis-CI] (https://travis-ci.org/ApmeM/android-flowlayout)

Demonstration

Orientation: HORIZONTAL, Gravity: FILL, LayoutDirection: LTR

Orientation: HORIZONTAL, Gravity: RIGHT & BOTTOM, LayoutDirection: RTL

Orientation: VERTICAL, Gravity: CENTER, LayoutDirection: LTR

Debug is switched off:

Installation and usage

Take from maven repository (http://search.maven.org/#search%7Cga%7C1%7Corg.apmem.tools, http://mvnrepository.com/search.html?query=org.apmem.tools) or add FlowLayout and other components to your solution

Add it as dependency in Gradle as:

compile 'org.apmem.tools:layouts:1.10@aar'

Or maven

    <dependency>
        <groupId>org.apmem.tools</groupId>
        <artifactId>layouts</artifactId>
        <version>1.10</version>
        <scope>provided</scope>
    </dependency>

Add the following xml code into your layout/something.xml:

<org.apmem.tools.layouts.FlowLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_width="fill_parent"
	android:layout_height="wrap_content"
>
</org.apmem.tools.layouts.FlowLayout>

To change default direction use the following code

android:orientation="vertical"

To change layout direction use the following code

xmlns:f="http://schemas.android.com/apk/res/your.namespace"
f:layoutDirection="rtl"

Android gravity now supported (in combination with elements weight):

    f:weightDefault="1.0"
    android:gravity="fill"

To override default spacing between elements use default android margins in the child View element:

android:layout_marginTop="32dip"
android:layout_marginRight="32dip"

Also if you need to break line before some object even if there is enough space for it in the previous line - use the following LayoutParameter in the child view element:

f:layout_newLine="true"

Detailed parameters

Layout parameters:

* android:orientation - line direction. Use one of the following values:

	* horizontal - line will be in horizontal direction, linebreak will create new line

	* vertical - line will be in vertical direction, linebreak will create new column

    * android:gravity - standard android gravity supported

* debugDraw - draw debug information

    * weightDefault - default weight value for child elements. Used to fill line in case of Gravity.FILL_HORIZONTAL | Gravity.FILL_VERTICAL

    * layoutDirection - direction of inner child elements:

            *  ltr - left to right direction

            *  rtl - right to left direction

Child layout parameters:

* android:layout_margin* - override default spacings

* android:layout_gravity - standard android gravity supported

    * layout_weight - weight of the element. If not specified "layout.defaultWight" is used.

* layout_newLine - break line before current element even if there is enough place in the current line.

Copyrights

Copyright 2011, Artem Votincev (apmem.org)

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.

Comments
  • Child elements overlapping

    Child elements overlapping

    I'm trying to use the "flow layout" to group "TextView" but I'm having overlapping problem.

    See in the image: captura de tela 2015-04-08 as 08 57 59

    My layout:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:f="http://schemas.android.com/apk/res-auto"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    
        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:layout_marginBottom="8dp"
            android:gravity="center_vertical">
    
            <LinearLayout
                android:orientation="vertical"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical">
    
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textAppearance="?android:attr/textAppearanceLarge"
                    android:text="13:50"
                    android:id="@+id/textView6"
                    android:textSize="35sp"
                    android:gravity="center" />
    
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:text="30 min"
                    android:id="@+id/textView5"
                    android:layout_gravity="center_horizontal" />
            </LinearLayout>
    
            <LinearLayout
                android:orientation="vertical"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:gravity="center">
    
                <LinearLayout
                    android:orientation="vertical"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content">
    
                    <LinearLayout
                        android:orientation="horizontal"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content">
    
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:text="Prog. 01"
                            android:id="@+id/tvProgramacao"
                            android:layout_weight="1" />
                    </LinearLayout>
    
                    <org.apmem.tools.layouts.FlowLayout
                        f:debugDraw="true"
                        f:layoutDirection="ltr"
                        android:gravity="left"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content">
    
                        <LinearLayout
                            android:layout_margin="5dp"
                            android:orientation="horizontal"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content">
    
                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?android:attr/textAppearanceMedium"
                                android:text="D"
                                android:singleLine="true"
                                android:id="@+id/tvDomingo" />
                        </LinearLayout>
    
                        <LinearLayout
                            android:layout_margin="5dp"
                            android:orientation="horizontal"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content">
    
                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?android:attr/textAppearanceMedium"
                                android:text="S"
                                android:singleLine="true"
                                android:id="@+id/tvSegunda" />
                        </LinearLayout>
    
                        <LinearLayout
                            android:layout_margin="5dp"
                            android:orientation="horizontal"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content">
    
                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?android:attr/textAppearanceMedium"
                                android:text="T"
                                android:singleLine="true"
                                android:id="@+id/tvTerca" />
                        </LinearLayout>
    
                        <LinearLayout
                            android:layout_margin="5dp"
                            android:orientation="horizontal"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content">
    
                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?android:attr/textAppearanceMedium"
                                android:text="Q"
                                android:singleLine="true"
                                android:id="@+id/tvQuarta" />
                        </LinearLayout>
    
                        <LinearLayout
                            android:layout_margin="5dp"
                            android:orientation="horizontal"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content">
    
                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?android:attr/textAppearanceMedium"
                                android:text="Q"
                                android:singleLine="true"
                                android:id="@+id/tvQuinta"  />
                        </LinearLayout>
    
                        <LinearLayout
                            android:layout_margin="5dp"
                            android:orientation="horizontal"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content">
    
                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?android:attr/textAppearanceMedium"
                                android:text="S"
                                android:singleLine="true"
                                android:id="@+id/tvSexta" />
                        </LinearLayout>
    
                        <LinearLayout
                            android:layout_margin="5dp"
                            android:orientation="horizontal"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content">
    
                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?android:attr/textAppearanceMedium"
                                android:text="S"
                                android:singleLine="true"
                                android:id="@+id/tvSabado" />
                        </LinearLayout>
                    </org.apmem.tools.layouts.FlowLayout>
                </LinearLayout>
            </LinearLayout>
    
            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:layout_gravity="center"
                android:padding="10dp">
    
                <LinearLayout
                    android:orientation="horizontal"
                    android:layout_width="1dp"
                    android:layout_height="fill_parent"
                    android:background="#ffffffff"
                    android:layout_weight="1"></LinearLayout>
            </LinearLayout>
    
            <LinearLayout
                android:orientation="vertical"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">
    
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageView"
                    android:src="@drawable/ic_filter_white_48dp"
                    android:layout_gravity="center_vertical"
                    android:layout_marginTop="10dp"
                    android:layout_marginRight="10dp"
                    android:layout_marginBottom="10dp"
                    android:layout_marginLeft="5dp" />
    
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>
    

    I'm forgetting some property?

    opened by douglasjunior 6
  • crash on devices of Sony series

    crash on devices of Sony series

    12-18 02:28:50.665 E/AndroidRuntime( 2571): Caused by: java.lang.NullPointerException 12-18 02:28:50.665 E/AndroidRuntime( 2571): at org.apmem.tools.layouts.FlowLayout.getLayoutDirection(FlowLayout.java:410) 12-18 02:28:50.665 E/AndroidRuntime( 2571): at android.view.View.resolveLayoutDirectionIfNeeded(View.java:9689) 12-18 02:28:50.665 E/AndroidRuntime( 2571): at android.view.View.getResolvedLayoutDirection(View.java:4872) 12-18 02:28:50.665 E/AndroidRuntime( 2571): at android.view.View.setPaddingRelative(View.java:12092) 12-18 02:28:50.665 E/AndroidRuntime( 2571): at android.view.View.setPadding(View.java:12003) 12-18 02:28:50.665 E/AndroidRuntime( 2571): at android.view.ViewGroup.setPadding(ViewGroup.java:2379) 12-18 02:28:50.665 E/AndroidRuntime( 2571): at android.view.View.(View.java:3154) 12-18 02:28:50.665 E/AndroidRuntime( 2571): at android.view.View.(View.java:2781) 12-18 02:28:50.665 E/AndroidRuntime( 2571): at android.view.ViewGroup.(ViewGroup.java:412) 12-18 02:28:50.665 E/AndroidRuntime( 2571): at org.apmem.tools.layouts.FlowLayout.(FlowLayout.java:32) 12-18 02:28:50.665 E/AndroidRuntime( 2571): ... 28 more

    opened by qluan 6
  • max line issue

    max line issue

    Hello!

    i'm wondering if i can fix the max line of the widget?

    i mean i don't want to extend more than 3 lines even if there are more items in the layout.

    i just want to show items which are included in few lines and hide others.

    i've tried fixing layout_height, but it didn't work.

    < org.apmem.tools.layouts.FlowLayout android:layout_width="match_parent" android:layout_height="40dp" > < ImageView android:layout_width="wrap_content" android:layout_height="30dp" android:src="@drawable/ic_addfollow" android:layout_margin="5dp" /> < ImageView android:layout_width="wrap_content" android:layout_height="30dp" android:src="@drawable/ic_addfollow" android:layout_margin="5dp" /> ... ... (omit) ... </ org.apmem.tools.layouts.FlowLayout>

    thank you for reading my question .

    Regards.

    opened by jkinject 4
  • java.lang.IllegalArgumentException: Called attach on a child which is not detached

    java.lang.IllegalArgumentException: Called attach on a child which is not detached

    When i clicked the MANAGER TAB in the demo, i got crash stack like below.

    10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: FATAL EXCEPTION: main 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: Process: org.apmem.tools.example, PID: 7638 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: java.lang.IllegalArgumentException: Called attach on a child which is not detached: ViewHolder{a66dbff position=0 id=-1, oldPos=-1, pLpos:-1 no parent} 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.support.v7.widget.RecyclerView$4.attachViewToParent(RecyclerView.java:587) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.support.v7.widget.ChildHelper.attachViewToParent(ChildHelper.java:239) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.support.v7.widget.RecyclerView$LayoutManager.attachView(RecyclerView.java:6492) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.support.v7.widget.RecyclerView$LayoutManager.attachView(RecyclerView.java:6507) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.support.v7.widget.RecyclerView$LayoutManager.attachView(RecyclerView.java:6518) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at org.apmem.tools.layouts.FlowLayoutManager.onLayoutChildren(FlowLayoutManager.java:63) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2847) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3145) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.View.layout(View.java:16630) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:5437) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.View.layout(View.java:16630) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:5437) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.FrameLayout.onLayout(FrameLayout.java:273) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.View.layout(View.java:16630) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:5437) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.View.layout(View.java:16630) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:5437) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.FrameLayout.onLayout(FrameLayout.java:273) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.View.layout(View.java:16630) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:5437) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.FrameLayout.onLayout(FrameLayout.java:273) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.View.layout(View.java:16630) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:5437) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.View.layout(View.java:16630) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:5437) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.FrameLayout.onLayout(FrameLayout.java:273) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.View.layout(View.java:16630) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:5437) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.View.layout(View.java:16630) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:5437) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.FrameLayout.onLayout(FrameLayout.java:273) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.View.layout(View.java:16630) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:5437) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at com.android.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:493) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.View.layout(View.java:16630) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:5437) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.widget.FrameLayout.onLayout(FrameLayout.java:273) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.View.layout(View.java:16630) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.ViewGroup.layout(ViewGroup.java:5437) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2171) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1931) 10-20 12:32:01.470 7638-7638/? E/AndroidRuntime: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java

    opened by zourb 4
  • Views cut off when using all-side margins

    Views cut off when using all-side margins

    As mentioned in the subject, views are (or may be) cut off at the end of each line when using all-side (top/bottom/left/right) margins. This can be reproduced by modifying the example app layout like this: http://pastebin.com/dvNpbrqz

    opened by maniac103 4
  • Child margin is not accounted

    Child margin is not accounted

    Children's margin is not honored, only padding. So for example if I have the following:

    <View 
    ....
    android:layout_marginLeft="4dp"
    ...
    />
    

    The 4dp is ignored in the actual layout

    opened by tom91136 3
  • Vertical alignment

    Vertical alignment

    Given the layout in horizontal mode, is there a way to vertically align children of different height? E.g. choose between

    *,  +,  ...
        +
        +
    
        +
    *,  +,  ...
        +
    
        +
        +
    *,  +,  ...
    

    (* represents item 1, + represents item 2)

    opened by stanch 3
  • Fix project layout; now it's truly Gradle

    Fix project layout; now it's truly Gradle

    Compare with http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Project-Structure

    Certain tools depend on subprojects having a correct Gradle layout, e.g. https://github.com/pfn/android-sdk-plugin.

    opened by michalrus 3
  • HORIZONTAL SCROLL VIEW WITH FLOWLAYOUT

    HORIZONTAL SCROLL VIEW WITH FLOWLAYOUT

    I mean i need FLOWLAYOUTui inside hoizontal scroll view so the labels doesnt go to next line and scrolls inside horizontal scroll view,kindly let me know is it possible

    and other thing is i should be able to set the orientation e183f768-9699-11e5-8d8b-b9456a222d08

    opened by sharathyadhav1 2
  • The layout does not respect child margins

    The layout does not respect child margins

    Not actually a pull request, but would be easier for you to observe the bug that way, just modified the demo app a bit. So, there is kinda minimal not-working example app, you can enter the text in the field and then add it via one of two buttons. The "Add unwrapped" button adds my layout (see R.layout.child) to the FlowLayoyt as is, whereas "Add wrapped" adds this layout wrapped in a dummy FrameLayout (see R.layout.child_wrapped) And here's my (annotated) screenshot. The first child layout was added via the "Add unwrapped" button, the second via the "Add wrapped" button, the first's layout right margin is not respected, whereas the second's margin is respected (since wrapping FrameLayout has no margins at all). You have any idea what am I doing wrong, or it is indeed a bug? I don't have much time right now, so I could live with a wrapping layout solution for a while, but if it is a bug, I could even try to fix that later. Thanks in advance.

    opened by karlicoss 2
  • Strange child width

    Strange child width

    Hey guys!

    The lib is awesome and works fine in almost every cases. We found a string thing though.

    screen shot 2015-03-23 at 2 10 50 pm

    In a LG - E460 we found the linked isse. The cells are truncated even before they should be. By any chance do you know how I can solve this issue?

    Thanks in advance!

    Cheers

    opened by gbrbks 2
  • Check if child on start of line

    Check if child on start of line

    I have a simple feature request. I am using this FlowLayout to display a screen of quick reference material, but a lot of the text blends together. I'm trying to draw lines to separate them, but herein lies the problem. I don't want any lines on the outer edges, so I need a way to tell if a child object is on the start of a given line, so I know not to draw a separator in front of it.

    I don't know if anyone has a clever way of doing this, but it would be nice if there was a method that could tell me a child's horizontal position, somehow.

    opened by theblackwidower 1
  • Target API 26

    Target API 26

    Hello, We are currently using your library in one of our application. Actually we need a favour from your side. According to the Google Play Policy, all apps have to provide support for at least API level 26 which is not satisfied in your case. We are targeting API level 28. So can you please provide us support for API level 28 in your current repository?

    opened by yunuseker 1
  • Get actual height

    Get actual height

    Initially my FlowLayout is hidden, then I want to expand it using animation. The layout contains two lines of tags (buttons). The problem is I can't get actual height of FlowLayout with multiple lines of tags: it returns height (not sure) of single-line container. Verbose question.

    Animation expand code:

            v.measure(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            final int targetHeight = v.getMeasuredHeight();
    
            v.getLayoutParams().height = 1;
            v.setVisibility(View.VISIBLE);
            Animation a = new Animation(){
                @Override
                protected void applyTransformation(float interpolatedTime, Transformation t) {
                    v.getLayoutParams().height = interpolatedTime == 1
                            ? ViewGroup.LayoutParams.WRAP_CONTENT
                            : (int)(targetHeight * interpolatedTime);
                    v.requestLayout();
                }
    
                @Override
                public boolean willChangeBounds() {
                    return true;
                }
            };
    
    opened by konopkoman 0
  • Gradle 'android-flowlayout-master' project refresh failed with Android Studio 3.0.0

    Gradle 'android-flowlayout-master' project refresh failed with Android Studio 3.0.0

    When I try to open the project on my android IDE I'm getting the following error:

    Error:Unsupported method: BaseConfig.getApplicationIdSuffix().
    The version of Gradle you connect to does not support that method.
    To resolve the problem you can change/upgrade the target version of Gradle you connect to.
    Alternatively, you can ignore this exception and read other information from the model.
    
    Consult IDE log for more details (Help | Show Log)
    
    opened by eurbon 0
  • ava.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@70e62c7

    ava.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@70e62c7

    CrashHandler STACK_TRACE:java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@70e62c7 at android.graphics.Canvas.throwIfCannotDraw(Canvas.java:1271) at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:257) at android.graphics.Canvas.drawBitmap(Canvas.java:1415) at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:545) at android.widget.ImageView.onDraw(ImageView.java:1286) at android.view.View.draw(View.java:17134) at android.view.View.updateDisplayListIfDirty(View.java:16116) at android.view.View.draw(View.java:16900) at android.view.ViewGroup.drawChild(ViewGroup.java:3764) at org.apmem.tools.layouts.FlowLayout.drawChild(FlowLayout.java:359)

    opened by bobSir 0
Owner
Artem.Votincev
Artem.Votincev
Android implementation of FlowLayout. Layout arranges its children in multiple rows depending on their width.

FlowLayout FlowLayout is an opensource Android library that alows developers to easily integrate flow layout into their app. FlowLayout is an layout t

Blaž Šolar 754 Dec 15, 2022
Android - A layout that arranges its children in relation to a background image

ImageLayout A layout that arranges its children in relation to a background image. The layout of each child is specified in image coordinates (pixels)

Manuel Peinado Gallego 419 Nov 14, 2022
GoolgePlusLayout is a custom layout that plays animation on the children views while scrolling as the layout in the Google Plus (android) main page

Google Plus Layout Google Plus Layout is a custom layout that support playing animation on child view(s) in a serialize manner like the the main

Ahmed Nammari 224 Nov 25, 2022
Responsive Layout Gird Configuration using Compose. An adaptive layout

ResponsiveGrid Responsive Grid is most followed layout system by the designer as it adapts to screen size and orientation, ensuring consistency across

null 4 Apr 12, 2022
Implementation of ExpandableListview with custom header and custom content.

ExpandableLayout ExpandableLayout provides an easy way to create a view called header with an expandable view. Both view are external layout to allow

Robin Chutaux 1.6k Dec 12, 2022
NodeFlow is a library that makes visualizing hierarchical content easier.

NodeFlow NodeFlow is an Android library that provides a simple way to visualize hierarchical content. Perfect for displaying items that are organized

Telenav Inc 546 Dec 7, 2021
:octocat: 📃 FoldingCell is a material design expanding content cell inspired by folding paper material made by @Ramotion

FOLDING CELL [JAVA] Expanding content cell with animation inspired by folding paper card material design. We specialize in the designing and coding of

Ramotion 4.9k Dec 7, 2022
This assignment gives you basically a post list and its detail with comments.🚀

Android Assignment ?? Description This assignment gives you basically a post list and its detail with comments. ?? Features Users can see random post

Okan AYDIN 31 Dec 20, 2022
An Android Layout which has a same function like https://github.com/romaonthego/RESideMenu

ResideLayout An Android Layout which has a same function like https://github.com/romaonthego/RESideMenu. Can be used on Android 1.6(I haven't try it.)

Yang Hui 392 Oct 12, 2022
The Most Powerful Swipe Layout!

Android Swipe Layout ![Gitter](https://badges.gitter.im/Join Chat.svg) This is the brother of AndroidViewHover. One year ago, I started to make an app

代码家 12.3k Dec 28, 2022
A very simple arc layout library for Android

ArcLayout A very simple arc layout library for Android. Try out the sample application on the Play Store. Usage (For a working implementation of this

ogaclejapan 1.4k Dec 26, 2022
Android layout that simulates physics using JBox2D

PhysicsLayout Android layout that simulates physics using JBox2D. Simply add views, enable physics, and watch them fall! See it in action with the sam

John Carlson 689 Dec 29, 2022
a custom pull-to-refresh layout which contains a interesting animation

This is a project with custom pull-to-refresh layout which contains a interesting animation. And the animation is inspired by https://dribbble.com/sho

ZhangLei 1.8k Dec 27, 2022
A layout to transition between two views using a Floating Action Button as shown in many Material Design concepts

⚠ This library is no longer maintained ⚠️ FABRevealLayout A layout to transition between two views using a Floating Action Button as shown in many Mat

Tomás Ruiz-López 901 Dec 9, 2022
An Android demo of a foldable layout implementation. Engineered by Vincent Brison.

Foldable Layout This code is a showcase of a foldable animation I created for Worldline. The code is fully written with java APIs from the Android SDK

Worldline 599 Dec 23, 2022
A 3D Layout for Android,When you use it warp other view,it can became a 3D view,一秒让你的view拥有3D效果!

ThreeDLayout A 3D Layout,When you use it warp other view,it can became a 3D view 中文文档 preview USAGE 1.compile library allprojects { repositories {

androidwing 490 Oct 27, 2022
It's an Android library that allows you to use Layout as RadioButton or CheckBox.

Android - CompoundLayout It's an Android library that allows you to use Layout as RadioButton or CheckBox. The librarie is Android 14+ compatible. Gra

null 483 Nov 25, 2022
A pull to refresh layout for android, the RecyclerRefreshLayout is based on the SwipeRefreshLayout. support all the views, highly customizable, code simplicity, etc. really a practical RefreshLayout!

RecyclerRefreshLayout English | 中文版 RecyclerRefreshLayout based on the {@link android.support.v4.widget.SwipeRefreshLayout} The RecyclerRefreshLayout

dinus_developer 1.7k Nov 10, 2022