// Set the color spans according to the theme. The deprecated `getResources()` must be used until the minimum API >= 23.
if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
// Set the color spans according to the theme. The deprecated `getResources()` must be used until the minimum API >= 23.
if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
redColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.red_900));
} else {
blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_700));
redColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.red_900));
} else {
blueColorSpan = new ForegroundColorSpan(getResources().getColor(R.color.blue_700));