Skip to content

Handle TextView with label and click to show more lines

Notifications You must be signed in to change notification settings

lovejjfg/PowerText

Repository files navigation

PowerText

Handle TextView with Label and click to show full lines.

Download Android Arsenal

art3art1

art2

screenshot

快速使用

layout:

<com.lovejjfg.powertext.ExpandableTextView
    android:id="@+id/text"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="20dp"
    android:lineSpacingExtra="10dp"
    android:textColor="#333"
    android:textSize="16sp"
    app:defaultLineCount="3"
    app:defaultMoreHint="查看更多"
    app:labelMargin="5dp"
    app:labelPaddingHorizontal="8dp"
    app:labelPaddingVertical="10dp"
    app:labelStrokeRadius="4dp"
    app:labelTextColor="#333"
    app:labelTextSize="12sp"
    app:moreHintColor="#f00"
    />

<com.lovejjfg.powertext.LabelTextView
    android:id="@+id/tvLabel"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:layout_margin="20dp"
    android:lineSpacingExtra="10dp"
    android:textColor="#333"
    android:textSize="16sp"
    app:labelFillColor="true"
    app:labelMargin="10dp"
    app:labelPaddingHorizontal="4dp"
    app:labelPaddingVertical="6dp"
    app:labelStrokeColor="@color/colorAccent"
    app:labelStrokeWidth="1dp"
    app:labelTextColor="#fff"
    app:labelTextSize="12sp"
    />

code:

    text.setLabelText("奶茶妹妹")
    text.setOriginalText(originalText)

更新记录

详见 Release

About

Handle TextView with label and click to show more lines

Resources

Stars

Watchers

Forks

Packages

No packages published