@@ -28,9 +28,12 @@ import androidx.core.view.ViewCompat
2828import android.text.Editable
2929import android.text.Layout
3030import android.text.Spanned
31+ import android.text.TextPaint
32+ import android.text.style.CharacterStyle
33+ import android.text.style.LeadingMarginSpan
3134import android.text.style.LineBackgroundSpan
3235import android.text.style.LineHeightSpan
33- import android.text.style.QuoteSpan
36+ import android.text.style.UpdateAppearance
3437import android.text.style.UpdateLayout
3538import androidx.collection.ArrayMap
3639import org.wordpress.aztec.AlignmentRendering
@@ -44,7 +47,7 @@ fun createAztecQuoteSpan(
4447 nestingLevel : Int ,
4548 attributes : AztecAttributes = AztecAttributes (),
4649 alignmentRendering : AlignmentRendering ,
47- quoteStyle : BlockFormatter .QuoteStyle = BlockFormatter .QuoteStyle (0, 0, 0f, 0, 0, 0, 0)
50+ quoteStyle : BlockFormatter .QuoteStyle = BlockFormatter .QuoteStyle (0, 0, 0, 0f, 0, 0, 0, 0)
4851) = when (alignmentRendering) {
4952 AlignmentRendering .SPAN_LEVEL -> AztecQuoteSpanAligned (nestingLevel, attributes, quoteStyle, null )
5053 AlignmentRendering .VIEW_LEVEL -> AztecQuoteSpan (nestingLevel, attributes, quoteStyle)
@@ -69,11 +72,12 @@ open class AztecQuoteSpan(
6972 override var nestingLevel : Int ,
7073 override var attributes : AztecAttributes ,
7174 var quoteStyle : BlockFormatter .QuoteStyle
72- ) : QuoteSpan() ,
75+ ) : CharacterStyle(), LeadingMarginSpan ,
7376 LineBackgroundSpan ,
7477 IAztecBlockSpan ,
7578 LineHeightSpan ,
76- UpdateLayout {
79+ UpdateLayout ,
80+ UpdateAppearance {
7781
7882 override var endBeforeBleed: Int = - 1
7983 override var startBeforeCollapse: Int = - 1
@@ -199,4 +203,8 @@ open class AztecQuoteSpan(
199203 }
200204
201205 override val textFormat: ITextFormat = AztecTextFormat .FORMAT_QUOTE
206+
207+ override fun updateDrawState (tp : TextPaint ? ) {
208+ tp?.color = quoteStyle.quoteTextColor
209+ }
202210}
0 commit comments