Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

MaxLines on expanded TextView? #71

@c0dehunter

Description

@c0dehunter

I want to limit max lines when textview is expanded. But it seems it's not working?

<com.ms.square.android.expandabletextview.ExpandableTextView
                xmlns:expandableTextView="http://schemas.android.com/apk/res-auto"
                android:id="@+id/post_content"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/news_title_bg_color"
                android:paddingStart="4dp"
                android:paddingEnd="4dp"
                expandableTextView:maxCollapsedLines="2"
                expandableTextView:animDuration="200">
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center_vertical"
                    android:orientation="horizontal">
                    <TextView
                        android:id="@id/expandable_text"
                        android:layout_width="0dp"
                        android:layout_weight="1"
                        android:maxLines="5"
                        android:layout_height="wrap_content"
                        android:textSize="12sp"
                        android:textColor="@color/colorDarkWhiteText"
                        android:textStyle="bold"/>
                    <ImageButton
                        android:id="@id/expand_collapse"
                        android:layout_width="20dp"
                        android:layout_height="20dp"
                        android:padding="2dp"
                        android:tint="@color/colorDarkWhiteText"
                        android:layout_gravity="center_vertical"
                        android:background="@android:color/transparent"/>
                </LinearLayout>
            </com.ms.square.android.expandabletextview.ExpandableTextView>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions