Add comment

This commit is contained in:
Zhiheng Xu 2021-05-23 10:44:17 -04:00
parent 9b1861417c
commit 8f4c6fb6ac

View file

@ -589,12 +589,14 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
@Override @Override
public void afterTextChanged(final Editable s) { public void afterTextChanged(final Editable s) {
// Remove rich text formatting
final CharacterStyle[] toBeRemovedSpans = s.getSpans( final CharacterStyle[] toBeRemovedSpans = s.getSpans(
0, s.length(), CharacterStyle.class 0, s.length(), CharacterStyle.class
); );
for (final CharacterStyle toBeRemovedSpan : toBeRemovedSpans) { for (final CharacterStyle toBeRemovedSpan : toBeRemovedSpans) {
s.removeSpan(toBeRemovedSpan); s.removeSpan(toBeRemovedSpan);
} }
final String newText = searchEditText.getText().toString(); final String newText = searchEditText.getText().toString();
suggestionPublisher.onNext(newText); suggestionPublisher.onNext(newText);
} }