disabled the dark mode for the application with
<item name="android:forceDarkAllowed">false</item>
But in the input in the case, when you need to remove Span, the textСolor is reset to white and becomes invisible.
Пример: text: Editable? start: Int
val spans = text?.getSpans(start, start, ForegroundColorSpan::class.java)
spans?.forEach { span ->
text.removeSpan(span)
}
if you change styles textColorPrimary to red, for example, the color does not change. But if you make it in the direction of dark , then this color is inverted to light red