Android-ExpandableTextView icon indicating copy to clipboard operation
Android-ExpandableTextView copied to clipboard

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

Open aohrem opened this issue 6 years ago • 1 comments

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>

aohrem avatar Dec 29 '18 12:12 aohrem

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

avalanchas avatar Mar 17 '20 13:03 avalanchas