ShowMoreText
This is simple library for creating textview expandable. Like Continue or Less. This library extended versiion TextView. Easy to use.
Install / Use
/learn @mahimrocky/ShowMoreTextREADME
ShowMoreText
This is simple library for creating textview expandable. Like Continue or Less. This library extended versiion TextView. Easy to use.
Sample
<p align="center"> <img src="https://github.com/mahimrocky/ShowMoreText/blob/master/screenshot1.png" width="200" height="400" /> <img src="https://github.com/mahimrocky/ShowMoreText/blob/master/screenshot2.png" width="200" height="400" /> </p>Root Gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
App Gradle:
dependencies {
implementation 'com.github.mahimrocky:ShowMoreText:1.0.2'
}
You have to use just this xml. You can modify or set color your own textView. But don`t need to use maxLength or maxLine in text view. It may be confilict with library.
XML Section
<com.skyhope.showmoretextview.ShowMoreTextView
android:id="@+id/text_view_show_more"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/text"
/>
So this part describe how you sort your text? You can sort your text by line number or character length
In Activity you can use like:
ShowMoreTextView textView = findViewById(R.id.text_view_show_more);
//You have to use following one of method
// For using character length
textView.setShowingChar(numberOfCharacter);
//number of line you want to short
textView.setShowingLine(numberOfLine);
You can change text of Show more or Show less
textView.addShowMoreText("Continue");
textView.addShowLessText("Less");
You can change text color of Show more or Show less
textView.setShowMoreColor(Color.RED); // or other color
textView.setShowLessTextColor(Color.RED); // or other color
Happy Coding
Related Skills
node-connect
349.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
