8 Commits

Author SHA1 Message Date
Cyrus Bakhtiari-Haftlang
6c25acf29e 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_ParagraphStyle
mv_LinkStyle
2018-08-14 12:54:57 +02:00
Dimitry Ivanov
1cb656c32b Remove duplicated code to publish local artifact 2018-08-06 16:25:15 +03:00
Dimitry
7c7b1f59a8
V1.1.0 (#53)
* Update build configuration

* Update commonmark to 0.11.0 and android-gif to 1.2.14

* Add  module `library-syntax`

* Add default prism4j theme implementation

* Add syntax highlight to sample app

* Update syntax highlight to use SpannableStringBuilder

* Working with syntax rendering

* Add darkula theme to syntax highlight

* Add  attribute for image-loader module

* Update version to 1.1.0-SNAPSHOT

* Updating build configuration for snapshot publish

* Add headingTypeface, headingTextSizes to SpannableTheme (#51)

* Add headingTypeface to SpannableTheme, use a custom heading typeface in the sample app

* Add headingTextSizes

* Switching to headingTextSizeMultipliers, adding validating annotations, adding example

* Consolidate logic, add crash if header index is out of bounds

* Add small version clarifications

* Introduce MediaDecoder abstraction for image-loader module

* Switch to use SpannableFactory

* Switch to use SpannableFactory for html parsing

* Update sample application to add play-pause functionality for gifs

* Small cleanup

* Update prism4j version 1.1.0

* Update build configuration

* Add README to library-syntax module

* Update README
2018-07-30 15:19:42 +02:00
Dimitry Ivanov
c9d688dd68 Update maven push script 2018-05-22 11:18:28 +03:00
Dimitry
79fceb6f69
Custom extension sample (#27)
* Initialized custom extension module

* Upgraded android gradle plugin to 3.0.1

* Shaping up the custom extension module

* Added README to  module

* Small improvement for IconVisitor (added color null check)
2018-02-16 18:19:38 +03: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
6f5fd08de4 Extracting functionality into library 2017-05-11 17:15:39 +03:00