mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 16:40:32 +00:00
use ellipsis character
This commit is contained in:
parent
a026143a84
commit
07f8dcb3ca
@ -118,9 +118,9 @@ public class CommentsMiniInfoItemHolder extends InfoItemHolder {
|
|||||||
private void ellipsize() {
|
private void ellipsize() {
|
||||||
if (itemContentView.getLineCount() > commentDefaultLines){
|
if (itemContentView.getLineCount() > commentDefaultLines){
|
||||||
int endOfLastLine = itemContentView.getLayout().getLineEnd(commentDefaultLines - 1);
|
int endOfLastLine = itemContentView.getLayout().getLineEnd(commentDefaultLines - 1);
|
||||||
int end = itemContentView.getText().toString().lastIndexOf(' ', endOfLastLine -3);
|
int end = itemContentView.getText().toString().lastIndexOf(' ', endOfLastLine -2);
|
||||||
if(end == -1) end = Math.max(endOfLastLine -3, 0);
|
if(end == -1) end = Math.max(endOfLastLine -2, 0);
|
||||||
String newVal = itemContentView.getText().subSequence(0, end) + "...";
|
String newVal = itemContentView.getText().subSequence(0, end) + " …";
|
||||||
itemContentView.setText(newVal);
|
itemContentView.setText(newVal);
|
||||||
}
|
}
|
||||||
linkify();
|
linkify();
|
||||||
|
Loading…
Reference in New Issue
Block a user