flexbox-layout icon indicating copy to clipboard operation
flexbox-layout copied to clipboard

Multiline TextViews use all available spaces

Open MarcDahlem opened this issue 6 years ago • 2 comments

  • [ x] I have searched existing issues and confirmed this is not a duplicate

Issues and steps to reproduce

  • Place two multiline text views side-by-side in a flexbox-layout
  • If the texts are getting too long for the screen, they will have linebreaks.
  • These linebreaks can lead to unexpected behaviour and free spaces, where it should not be (see screenshot)

grafik

Expected behavior

  • The expectation is, that the free space between the key and the purple view is used and not left blank

Version of the flexbox library

  • 1.0.0

Link to code

<com.google.android.flexbox.FlexboxLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:alignItems="center"
        app:flexWrap="nowrap"
        app:justifyContent="space_between"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@color/green"
            android:text="Very long Key VerylongKey VerylongKeyVerylongKeyVery lon" />

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@color/colorAccent"
            app:layout_flexGrow="1"
            app:layout_flexShrink="0">

            <View
                android:layout_width="16dp"
                android:layout_height="16dp"
                android:background="@color/purple" />
        </LinearLayout>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@color/red"
            android:gravity="end"
            android:text="Value" />
    </com.google.android.flexbox.FlexboxLayout>

MarcDahlem avatar Jun 06 '18 10:06 MarcDahlem

@MarcDahlem Did you resolve ? I am still having this issue.

C0deWithAj avatar Apr 16 '22 15:04 C0deWithAj

Unfortunately no

MarcDahlem avatar Dec 17 '22 02:12 MarcDahlem