Expandable Text View Android Library
build.gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}implementation 'com.github.prongbang:expandabletextview:1.0.1'implementation 'com.github.prongbang:expandabletextview:2.0.0'MainActivity.kt
btnExpand.setOnClickListener {
tvDescription.expandTextView()
}
btnCollapse.setOnClickListener {
tvDescription.collapseTextView()
}
btnCycle.setOnClickListener {
tvDescription.cycleTextViewExpansion()
}activity_main.xml
<com.prongbang.widget.ExpandableTextView
android:id="@+id/tvDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="5"
app:collapsedMaxLines="5"
app:autoDuration="true"
android:text="@string/label_description" />Properties
app:duration="200"
app:collapsedMaxLines="5"
app:autoDuration="true"