Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parent padding affects FlexboxLayout #36

Closed
PavelSynek opened this issue May 16, 2016 · 6 comments · Fixed by #41
Closed

Parent padding affects FlexboxLayout #36

PavelSynek opened this issue May 16, 2016 · 6 comments · Fixed by #41
Assignees
Labels
Milestone

Comments

@PavelSynek
Copy link

PavelSynek commented May 16, 2016

Setting padding to FlexboxLayout's parent adds left padding to FlexboxLayout itself. Did I misunderstand how some parameters work or is it a bug?
device-2016-05-16-111316

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="20dp">

    <com.google.android.flexbox.FlexboxLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:alignContent="flex_start"
        app:alignItems="flex_start"
        app:flexDirection="row"
        app:flexWrap="wrap"
        app:justifyContent="flex_start">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="30dp"
            android:text="TEXTEXT"/>
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="30dp"
            android:text="TEXTEXT"/>
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="30dp"
            android:text="TEXTEXT"/>
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="30dp"
            android:text="TEXTEXT"/>
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="30dp"
            android:text="TEXTEXT"/>

    </com.google.android.flexbox.FlexboxLayout>

</FrameLayout>
@thagikura
Copy link
Contributor

Looks like it's a bug for the FlexboxLayout. Thanks for reporting. I'll take a look.

@thagikura
Copy link
Contributor

Should be fixed by #41 and I'll release the fixed version of the library anytime soon.

Thanks for the reporting again.

@novalu
Copy link

novalu commented Jun 2, 2016

I'm using FlexboxLayout 0.2.0, but I think that text is still not wrapping correctly.


<com.google.android.flexbox.FlexboxLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="16dp"
    app:flexWrap="wrap">

    <TextView
        android:id="@+id/text1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="16sp"
        android:text="AAAAAAB"/>

    <TextView
        android:id="@+id/text2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="16sp"
        android:text="CCCCCCCCCCCCCCCCCCCCCCCC"/>

</com.google.android.flexbox.FlexboxLayout>

flex

This layout is rendered as top image, then I added 'D' (middle image), then another 'D' (bottom image). In top and bottom render FlexboxLayout wrapped text correctly, but in middle render there are missing 'B' from text1 and 'D' from text2.

When changed attribute layout_width to wrap_content, behavior is different, but still incorrect.

flexb

In first image is the same text as above, then added 'E', another 'E' and once again 'E'.

@thagikura
Copy link
Contributor

@novalu Thank you for your report!
Looks like that is a different issue. Could you file another issue for that?

@novalu
Copy link

novalu commented Jun 3, 2016

Sorry, I was not certain whether it is duplicate or not. I've filed issue in #62 (and added some info).

@thagikura
Copy link
Contributor

@novalu No worries. Thanks for filing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants