Skip to content

Commit 296fa71

Browse files
committed
Added object for pre and quote style values.
1 parent 19c76a2 commit 296fa71

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
449449
quoteStyle = BlockFormatter.QuoteStyle(
450450
styles.getColor(R.styleable.AztecText_quoteBackground, 0),
451451
styles.getColor(R.styleable.AztecText_quoteColor, 0),
452+
styles.getColor(R.styleable.AztecText_quoteTextColor,
453+
ContextCompat.getColor(context, R.color.text)),
452454
styles.getFraction(R.styleable.AztecText_quoteBackgroundAlpha, 1, 1, 0f),
453455
styles.getDimensionPixelSize(R.styleable.AztecText_quoteMargin, 0),
454456
styles.getDimensionPixelSize(R.styleable.AztecText_quotePadding, 0),
@@ -484,7 +486,13 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
484486
styles.getColor(R.styleable.AztecText_preformatBackground, 0),
485487
getPreformatBackgroundAlpha(styles),
486488
styles.getColor(R.styleable.AztecText_preformatColor, 0),
487-
verticalParagraphPadding),
489+
verticalParagraphPadding,
490+
styles.getDimensionPixelSize(R.styleable.AztecText_preformatLeadingMargin,
491+
resources.getDimensionPixelSize(R.dimen.preformat_leading_margin)),
492+
styles.getColor(R.styleable.AztecText_preformatBorderColor, 0),
493+
styles.getDimensionPixelSize(R.styleable.AztecText_preformatBorderRadius, 0),
494+
styles.getDimensionPixelSize(R.styleable.AztecText_preformatBorderThickness, 0),
495+
),
488496
alignmentRendering = alignmentRendering,
489497
exclusiveBlockStyles = BlockFormatter.ExclusiveBlockStyles(styles.getBoolean(R.styleable.AztecText_exclusiveBlocks, false), verticalParagraphPadding),
490498
paragraphStyle = BlockFormatter.ParagraphStyle(verticalParagraphMargin)

aztec/src/main/kotlin/org/wordpress/aztec/formatting/BlockFormatter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ class BlockFormatter(editor: AztecText,
6060
}
6161
}
6262

63-
data class QuoteStyle(val quoteBackground: Int, val quoteColor: Int, val quoteBackgroundAlpha: Float, val quoteMargin: Int, val quotePadding: Int, val quoteWidth: Int, val verticalPadding: Int)
64-
data class PreformatStyle(val preformatBackground: Int, val preformatBackgroundAlpha: Float, val preformatColor: Int, val verticalPadding: Int)
63+
data class QuoteStyle(val quoteBackground: Int, val quoteColor: Int, val quoteTextColor: Int, val quoteBackgroundAlpha: Float, val quoteMargin: Int, val quotePadding: Int, val quoteWidth: Int, val verticalPadding: Int)
64+
data class PreformatStyle(val preformatBackground: Int, val preformatBackgroundAlpha: Float, val preformatColor: Int, val verticalPadding: Int, val leadingMargin: Int, val preformatBorderColor: Int, val preformatBorderRadius: Int, val preformatBorderThickness: Int )
6565
data class HeaderStyles(val verticalPadding: Int, val styles: Map<AztecHeadingSpan.Heading, HeadingStyle>) {
6666
data class HeadingStyle(val fontSize: Int, val fontColor: Int)
6767
}

0 commit comments

Comments
 (0)