-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #851 from wordpress-mobile/issue/1266_allow-paragr…
…aph-without-alignment-span Allow paragraph spans that do not extend AlignmentSpan
- Loading branch information
Showing
17 changed files
with
107 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
aztec/src/main/kotlin/org/wordpress/aztec/spans/IAztecAlignmentSpan.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.wordpress.aztec.spans | ||
|
||
import android.text.Layout | ||
import android.text.style.AlignmentSpan | ||
|
||
interface IAztecAlignmentSpan : AlignmentSpan { | ||
|
||
var align: Layout.Alignment? | ||
|
||
override fun getAlignment(): Layout.Alignment = align ?: Layout.Alignment.ALIGN_NORMAL | ||
|
||
fun shouldParseAlignmentToHtml(): Boolean = true | ||
} |
16 changes: 1 addition & 15 deletions
16
aztec/src/main/kotlin/org/wordpress/aztec/spans/IAztecParagraphStyle.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,8 @@ | ||
package org.wordpress.aztec.spans | ||
|
||
import android.text.Layout | ||
import android.text.style.AlignmentSpan | ||
|
||
/** | ||
* Marks spans that are going to be parsed with {@link org.wordpress.aztec.AztecParser#withinHtml()} | ||
* Created in order to distinguish between spans that implement ParagraphStyle for various reasons, but have separate | ||
* parsing logic, like {@link org.wordpress.aztec.spans.AztecHeadingSpan} | ||
**/ | ||
interface IAztecParagraphStyle : AlignmentSpan, IAztecSpan, IAztecNestable { | ||
|
||
var align: Layout.Alignment? | ||
|
||
override fun getAlignment(): Layout.Alignment { | ||
return align ?: Layout.Alignment.ALIGN_NORMAL | ||
} | ||
|
||
fun shouldParseAlignmentToHtml(): Boolean { | ||
return true | ||
} | ||
} | ||
interface IAztecParagraphStyle : IAztecSpan, IAztecNestable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters