@@ -27,7 +27,7 @@ public class EllipsizingTextView extends AppCompatTextView {
27
27
final static String TAG = "EllipsizingTextView" ;
28
28
29
29
private TextUtils .TruncateAt ellipsize = null ;
30
- private TextUtils .TruncateAt multiLineEllipsize = null ;
30
+ // private TextUtils.TruncateAt multiLineEllipsize = null;
31
31
private boolean isEllipsized = false ;
32
32
private boolean needsEllipsing = false ;
33
33
private boolean needsResizing = false ;
@@ -380,7 +380,7 @@ public void setText(CharSequence text, BufferType type) {
380
380
381
381
private void updateShouldEllipsize () {
382
382
// log("EllipsizingTextView updateShouldEllipsize");
383
- needsEllipsize = (ellipsize != null || multiLineEllipsize != null ) && fullText != null && fullText .length () > 0 ;
383
+ needsEllipsize = (ellipsize != null ) && fullText != null && fullText .length () > 0 ;
384
384
385
385
}
386
386
@@ -418,16 +418,16 @@ protected void onTextChanged(final CharSequence text, final int start, final int
418
418
}
419
419
}
420
420
421
- public void setMultiLineEllipsize (TextUtils .TruncateAt where ) {
422
- // log("EllipsizingTextView setMultiLineEllipsize");
423
- multiLineEllipsize = where ;
424
- updateShouldEllipsize ();
425
- updateEllipsize ();
426
- }
421
+ // public void setMultiLineEllipsize(TextUtils.TruncateAt where) {
422
+ // // log("EllipsizingTextView setMultiLineEllipsize");
423
+ // multiLineEllipsize = where;
424
+ // updateShouldEllipsize();
425
+ // updateEllipsize();
426
+ // }
427
427
428
- public TextUtils .TruncateAt getMultiLineEllipsize () {
429
- return multiLineEllipsize ;
430
- }
428
+ // public TextUtils.TruncateAt getMultiLineEllipsize() {
429
+ // return multiLineEllipsize;
430
+ // }
431
431
432
432
private void refitText (String text , int textWidth ) {
433
433
// log("EllipsizingTextView refitText");
@@ -520,7 +520,7 @@ private void ellipseText(int width, int height) {
520
520
521
521
if (fullText instanceof Spanned ) {
522
522
SpannableStringBuilder htmlWorkingText = new SpannableStringBuilder (fullText );
523
- if (this .singleline == false && multiLineEllipsize != null ) {
523
+ if (this .singleline == false ) {
524
524
SpannableStringBuilder newText = new SpannableStringBuilder ();
525
525
String str = htmlWorkingText .toString ();
526
526
String [] separated = str .split ("\n " );
@@ -554,7 +554,7 @@ private void ellipseText(int width, int height) {
554
554
555
555
CharSequence lastLine = newText .subSequence (newStart , newStart + lineSpanned .length ());
556
556
if (createWorkingLayout (lastLine , width ).getLineCount () > 1 )
557
- lastLine = getEllipsedTextForOneLine (lastLine , multiLineEllipsize , width );
557
+ lastLine = getEllipsedTextForOneLine (lastLine , ellipsize , width );
558
558
559
559
newText .replace (newStart , newStart + lineSpanned .length (), lastLine );
560
560
}
@@ -564,7 +564,7 @@ private void ellipseText(int width, int height) {
564
564
newStart = newText .length ();
565
565
}
566
566
workingText = newText ;
567
- } else {
567
+ } else {
568
568
Layout layout = createWorkingLayout (workingText , width );
569
569
int linesCount = getLinesCount (layout , height );
570
570
if (layout .getLineCount () > linesCount && ellipsize != null ) {
@@ -584,15 +584,15 @@ private void ellipseText(int width, int height) {
584
584
}
585
585
}
586
586
} else {
587
- if (this .singleline == false && multiLineEllipsize != null ) {
587
+ if (this .singleline == false ) {
588
588
String str = workingText .toString ();
589
589
String newText = new String ();
590
590
String [] separated = str .split ("\n " );
591
591
for (int i = 0 ; i < separated .length ; i ++) {
592
592
String linestr = separated [i ];
593
593
if (linestr .length () > 0 ) {
594
594
if (createWorkingLayout (linestr , width ).getLineCount () > 1 )
595
- newText += getEllipsedTextForOneLine (linestr , multiLineEllipsize , width );
595
+ newText += getEllipsedTextForOneLine (linestr , ellipsize , width );
596
596
else
597
597
newText += linestr ;
598
598
}
0 commit comments