sketchub icon

ShowMoreView - library

AbrorGo
50 Likes
12 Comments
319 Downloads

Screenshots

About

This lib is fully created by me, an advanced textview that uses (ReadMore/ ReadLess) buttons at the end of the text that longer than the specific length provided by the developer (default is 250)

this view can be modified by attributes in inject as following:

app:maxTextLength="250" // default 250
app:showMoreColor="#5865f2" // default #999999
app:showMoreText="ReadMore"
app:showLessText="ReadLess"
app:expandText="true" // default false

to use it directly from java codes as following:

final ShowMoreView moreText = new ShowMoreView(this);
moreText.setMaxTextLength(100); // Default: 250, Optinal code
moreText.setShowMoreColor(ShowMoreView.DEFAULT_COLOR); // Default: "#999999", Optional code
moreText.setShowMoreText("ShowMore", "ShowLess"); // Optional code
moreText.setContentText("your text here"); // Important Code
moreText.expandText(true); // Default: false, Optional code

you can also set a listener when the whole textview is clicked or longClicked to get the original text or do anything else:

moreText.setOnShowTextClickedListener(new OnShowTextClicked() {
  @Override
  public void onTextClicked() {
    String text = moreText.getOriginalText();
    showMessage(text);
  }

  @Override
  public void onTextLongClicked() {/* codes here */}
});

you guys are not allowed to modify this library/project and share it without a permission from me personally...

© Hussein Shakir (Smith), 2021

©2025 Sketchub | User Policy