@@ -788,8 +788,9 @@ public void draw(@NonNull Canvas canvas) {
788
788
return ;
789
789
}
790
790
791
- if (shouldDrawMultiline ()) {
792
- drawMultinlineTransition (canvas , currentExpandedX , y );
791
+ if (shouldDrawMultiline ()
792
+ && (!fadeModeEnabled || expandedFraction > fadeModeThresholdFraction )) {
793
+ drawMultilineTransition (canvas , currentExpandedX , y );
793
794
} else {
794
795
canvas .translate (x , y );
795
796
textLayout .draw (canvas );
@@ -803,7 +804,7 @@ private boolean shouldDrawMultiline() {
803
804
return maxLines > 1 && (!isRtl || fadeModeEnabled ) && !useTexture ;
804
805
}
805
806
806
- private void drawMultinlineTransition (@ NonNull Canvas canvas , float currentExpandedX , float y ) {
807
+ private void drawMultilineTransition (@ NonNull Canvas canvas , float currentExpandedX , float y ) {
807
808
int originalAlpha = textPaint .getAlpha ();
808
809
// positon expanded text appropriately
809
810
canvas .translate (currentExpandedX , y );
@@ -821,20 +822,22 @@ private void drawMultinlineTransition(@NonNull Canvas canvas, float currentExpan
821
822
/* x = */ 0 ,
822
823
lineBaseline ,
823
824
textPaint );
824
- // Remove ellipsis for Cross-section animation
825
- String tmp = textToDrawCollapsed .toString ().trim ();
826
- if (tmp .endsWith (ELLIPSIS_NORMAL )) {
827
- tmp = tmp .substring (0 , tmp .length () - 1 );
825
+ if (!fadeModeEnabled ) {
826
+ // Remove ellipsis for Cross-section animation
827
+ String tmp = textToDrawCollapsed .toString ().trim ();
828
+ if (tmp .endsWith (ELLIPSIS_NORMAL )) {
829
+ tmp = tmp .substring (0 , tmp .length () - 1 );
830
+ }
831
+ // Cross-section between both texts (should stay at original alpha)
832
+ textPaint .setAlpha (originalAlpha );
833
+ canvas .drawText (
834
+ tmp ,
835
+ /* start = */ 0 ,
836
+ min (textLayout .getLineEnd (0 ), tmp .length ()),
837
+ /* x = */ 0 ,
838
+ lineBaseline ,
839
+ textPaint );
828
840
}
829
- // Cross-section between both texts (should stay at original alpha)
830
- textPaint .setAlpha (originalAlpha );
831
- canvas .drawText (
832
- tmp ,
833
- /* start = */ 0 ,
834
- min (textLayout .getLineEnd (0 ), tmp .length ()),
835
- /* x = */ 0 ,
836
- lineBaseline ,
837
- textPaint );
838
841
}
839
842
840
843
private boolean calculateIsRtl (@ NonNull CharSequence text ) {
0 commit comments