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

Odd layout with gravity="center" and ellipsize="end" #29

Open
aohrem opened this issue Dec 29, 2018 · 1 comment
Open

Odd layout with gravity="center" and ellipsize="end" #29

aohrem opened this issue Dec 29, 2018 · 1 comment

Comments

@aohrem
Copy link

aohrem commented Dec 29, 2018

When using the ExpandableTextView with the attributes gravity="center" to center the text in combination with ellipsize="end", the collapsed layout of the last line is a bit off.

Collapsed state:

screenshot_1546085997

Expanded state:

screenshot_1546085995

<LinearLayout
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:orientation="vertical">

     <at.blogc.android.views.ExpandableTextView
         android:id="@+id/textViewDescription"
         style="@style/BodyNormal"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:gravity="center"
         android:ellipsize="end"
         android:lineSpacingExtra="2sp"
         android:maxLines="3"
         android:textColor="@color/blackAlpha87"
         app:animation_duration="500"
         tools:text="A look at the life of the astronaut, Neil Armstrong, and the legendary space mission that led him to become the first man to ..."/>

      <Button
         android:id="@+id/buttonViewMore"
         style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="center_horizontal"
         android:text="@string/view_more"
         android:textAppearance="@style/Button"
         android:textColor="?android:attr/colorPrimary"/>
</LinearLayout>
@avalanchas
Copy link

I don't think that this is an issue with the ExpandableTextView, it happens in all Android standard TextViews as well

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

No branches or pull requests

2 participants