5 Commits

Author SHA1 Message Date
Cyrus Bakhtiari-Haftlang
dc52771459 MarkwonView and MarkwonViewCompat now support styling from XML
The styles that are denoted with an asterisk (*), when defined,
completely override the default spans. The others, when defined, add
spans before the default spans (if any) so that when reversed, take
precedence. Example:

```
<ru.noties.markwon.view.MarkwonViewCompat
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:mv_H2Style="?android:textAppearanceLarge"
    app:mv_markdown="## Opening hours" />
```
In the above case, as ?android:textAppearanceLarge most likely is
resolved into an actual style, the spans that are added by the Markwon-
library (including heading line break) will no be added.

```
<ru.noties.markwon.view.MarkwonViewCompat
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:mv_CodeSpanStyle="?textAppearanceSmall"
    app:mv_markdown="`private int count = 5`" />
```
Conversely, defining a style for mv_CodeSpanStyle will still result in
that background is added to the code text and it will by styled
according to the resolved style of `android:textAppearanceSmall`.

Supported style attributes:
*mv_H1Style
*mv_H2Style
*mv_H3Style
*mv_H4Style
*mv_H5Style
*mv_H6Style

*mv_EmphasisStyle
*mv_StrongEmphasisStyle

mv_BlockQuoteStyle
mv_CodeSpanStyle
mv_MultilineCodeSpanStyle
mv_OrderedListItemStyle
mv_BulletListItemStyle
mv_TaskListItemStyle
mv_TableRowStyle
mv_LinkStyle
2018-08-13 10:09:18 +02:00
Dimitry Ivanov
332675cdee Added library-view module 2017-05-27 15:51:41 +03:00
Dimitry Ivanov
99f2879f6a Testing if we can display svg & gif, yeah... 2017-05-16 23:20:28 +03:00
Dimitry Ivanov
87d03793a8 Packages refactoring (+ created Markwon class) 2017-05-16 20:33:26 +03:00
Dimitry Ivanov
6f5fd08de4 Extracting functionality into library 2017-05-11 17:15:39 +03:00