-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
It's working well.
` TextView tv_content = holder.tv_content;
tv_content.setText(strContent);
tv_content.post(new Runnable() {
@Override
public void run() {
int lineCount = tv_content.getLineCount();
if (lineCount < 4) {
return;
}
int start = tv_content.getLayout().getLineStart(0);
int end = tv_content.getLayout().getLineEnd(2);
int lmitLength;
try {
lmitLength = strContent.substring(start, end).length() - 2;
} catch (Exception e) {
return;
}
if (lmitLength < 0) {
return;
}
CustomReadMoreOption readMoreOption = new CustomReadMoreOption.Builder(mContext)
.textLength(lmitLength, ReadMoreOption.TYPE_CHARACTER)
.moreLabel("more")
.lessLabel("less")
.build();
readMoreOption.addReadMoreTo(tv_content, strContent);
}
});``
Metadata
Metadata
Assignees
Labels
No labels