This commit is contained in:
Benoit Marty 2021-12-13 18:21:27 +01:00
parent 808c401675
commit c302148e89

View File

@ -43,14 +43,14 @@ class SpanUtils @Inject constructor() {
} }
// Workaround for https://issuetracker.google.com/issues/188454876 // Workaround for https://issuetracker.google.com/issues/188454876
private fun canUseTextFuture(charSequence: Spanned): Boolean { private fun canUseTextFuture(spanned: Spanned): Boolean {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) {
// On old devices, it works correctly // On old devices, it works correctly
return true return true
} }
return charSequence return spanned
.getSpans(0, charSequence.length, Any::class.java) .getSpans(0, spanned.length, Any::class.java)
.all { it !is StrikethroughSpan && it !is UnderlineSpan && it !is MetricAffectingSpan } .all { it !is StrikethroughSpan && it !is UnderlineSpan && it !is MetricAffectingSpan }
} }