Skip to content

Commit 7a6266d

Browse files
committed
Added option to specify pre and quote padding separately.
1 parent ecf39e3 commit 7a6266d

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
455455
styles.getDimensionPixelSize(R.styleable.AztecText_quoteMargin, 0),
456456
styles.getDimensionPixelSize(R.styleable.AztecText_quotePadding, 0),
457457
styles.getDimensionPixelSize(R.styleable.AztecText_quoteWidth, 0),
458-
verticalParagraphPadding),
458+
styles.getDimensionPixelSize(R.styleable.AztecText_quoteVerticalPadding, verticalParagraphPadding)),
459459
headerStyle = BlockFormatter.HeaderStyles(verticalHeadingMargin, mapOf(
460460
AztecHeadingSpan.Heading.H1 to BlockFormatter.HeaderStyles.HeadingStyle(
461461
styles.getDimensionPixelSize(R.styleable.AztecText_headingOneFontSize, 0),
@@ -486,7 +486,7 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
486486
styles.getColor(R.styleable.AztecText_preformatBackground, 0),
487487
getPreformatBackgroundAlpha(styles),
488488
styles.getColor(R.styleable.AztecText_preformatColor, 0),
489-
verticalParagraphPadding,
489+
styles.getDimensionPixelSize(R.styleable.AztecText_preformatVerticalPadding, verticalParagraphPadding),
490490
styles.getDimensionPixelSize(R.styleable.AztecText_preformatLeadingMargin,
491491
resources.getDimensionPixelSize(R.dimen.preformat_leading_margin)),
492492
styles.getColor(R.styleable.AztecText_preformatBorderColor, 0),

aztec/src/main/res/values/attrs.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@
3232
<attr name="preformatBorderThickness" format="reference|dimension" />
3333
<attr name="preformatLeadingMargin" format="reference|dimension" />
3434
<attr name="preformatTextSize" format="reference|dimension" />
35+
<attr name="preformatVerticalPadding" format="reference|dimension" />
3536
<attr name="quoteBackground" format="reference|color" />
3637
<attr name="quoteBackgroundAlpha" format="reference|fraction" />
3738
<attr name="quoteColor" format="reference|color" />
3839
<attr name="quoteTextColor" format="reference|color" />
3940
<attr name="quoteMargin" format="reference|dimension" />
4041
<attr name="quotePadding" format="reference|dimension" />
4142
<attr name="quoteWidth" format="reference|dimension" />
43+
<attr name="quoteVerticalPadding" format="reference|dimension" />
4244
<attr name="textColor" format="reference|color" />
4345
<attr name="textColorHint" format="reference|color" />
4446
<attr name="exclusiveBlocks" format="reference|boolean" />

aztec/src/main/res/values/dimens.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
<dimen name="preformat_leading_margin">8dp</dimen>
4949
<dimen name="preformat_text_size">16sp</dimen>
50+
<dimen name="preformat_vertical_padding">12dp</dimen>
5051

5152
<dimen name="text_dialog">14sp</dimen>
5253

aztec/src/main/res/values/styles.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<item name="preformatBorderThickness">1dp</item>
4747
<item name="preformatLeadingMargin">@dimen/preformat_leading_margin</item>
4848
<item name="preformatTextSize">@dimen/preformat_text_size</item>
49+
<item name="preformatVerticalPadding">@dimen/preformat_vertical_padding</item>
4950
<!-- Quote -->
5051
<item name="quoteBackground">@color/blue_wordpress</item>
5152
<item name="quoteBackgroundAlpha">75%</item>
@@ -54,6 +55,7 @@
5455
<item name="quoteMargin">@dimen/quote_margin</item>
5556
<item name="quotePadding">@dimen/quote_padding</item>
5657
<item name="quoteWidth">@dimen/quote_width</item>
58+
<item name="quoteVerticalPadding">@dimen/block_vertical_padding</item>
5759
<!-- General Text -->
5860
<item name="textColor">@android:color/white</item>
5961
<item name="textColorHint">@android:color/darker_gray</item>

0 commit comments

Comments
 (0)