1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 16:40:32 +00:00

use ellipsis character

This commit is contained in:
yausername 2019-03-22 05:56:56 +05:30
parent a026143a84
commit 07f8dcb3ca

View File

@ -118,9 +118,9 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder {
private void ellipsize() {
if (itemContentView.getLineCount() > commentDefaultLines){
int endOfLastLine = itemContentView.getLayout().getLineEnd(commentDefaultLines - 1);
int end = itemContentView.getText().toString().lastIndexOf(' ', endOfLastLine -3);
if(end == -1) end = Math.max(endOfLastLine -3, 0);
String newVal = itemContentView.getText().subSequence(0, end) + "...";
int end = itemContentView.getText().toString().lastIndexOf(' ', endOfLastLine -2);
if(end == -1) end = Math.max(endOfLastLine -2, 0);
String newVal = itemContentView.getText().subSequence(0, end) + "";
itemContentView.setText(newVal);
}
linkify();