@@ -546,31 +546,33 @@ private void formatMask(final Editable editable) {
546
546
nextCharIsText = true ;
547
547
indexInStyle += Character .charCount (ESCAPE_MASK_POINT );
548
548
} else {
549
- String cur = new StringBuilder ().appendCodePoint (charInStyle ).toString ();
549
+ String stringInStyle =
550
+ mFormatStyle .substring (indexInStyle , indexInStyle + charInStyleCount );
550
551
if (mPlaceholderFilters != null ) {
551
552
PlaceholderConverter converter = mPlaceholderFilters .get (charInStyle );
552
553
if (converter != null ) {
553
554
char [] chars = new char [indexInText ];
554
555
editable .getChars (0 , indexInText , chars , 0 );
555
- String textInStyle = converter .convert (String .valueOf (chars ), cur );
556
+ String textInStyle =
557
+ converter .convert (String .valueOf (chars ), stringInStyle );
556
558
if (textInStyle == null
557
559
|| textInStyle .codePointCount (0 , textInStyle .length ()) != 1 ) {
558
560
throw new IllegalArgumentException (
559
- "the converted must be length one character" );
561
+ "The converted must be length one character" );
560
562
}
561
- cur = textInStyle ;
563
+ stringInStyle = textInStyle ;
564
+ charInStyleCount = stringInStyle .length ();
562
565
}
563
566
}
564
- int charCount = cur .length ();
565
- editable .insert (indexInText , cur );
567
+ editable .insert (indexInText , stringInStyle );
566
568
editable .setSpan (
567
569
new PlaceholderSpan (),
568
570
indexInText ,
569
- indexInText + charCount ,
571
+ indexInText + charInStyleCount ,
570
572
Spanned .SPAN_EXCLUSIVE_EXCLUSIVE );
571
573
nextCharIsText = false ;
572
- indexInText += charCount ;
573
- indexInStyle += charCount ;
574
+ indexInText += charInStyleCount ;
575
+ indexInStyle += charInStyleCount ;
574
576
}
575
577
}
576
578
if (!havingEmptyOrHint && indexOfLastLiteral != editable .length ()) {
0 commit comments