TextAttributes (@Nullable TextAttributes under, @Nullable TextAttributes above) { if (under == null) return above; if (above == null) return under; TextAttributes attrs = under.clone(); if (above.getBackgroundColor() != null){ attrs.setBackgroundColor(above.getBackgroundColor()); } if (above.getForegroundColor() != null){ attrs.setForegroundColor(above.getForegroundColor()); } attrs.setFontType(above.getFontType() | under.getFontType()); TextAttributesEffectsBuilder.create(under).coverWith(above).applyTo(attrs); return attrs; }