MarkdownView
WebView implementation supporting Markdown rendering.
Prerequisites
Add this in your root build.gradle
file (not your module build.gradle
file):
Dependency
Add this to your module's build.gradle
file (make sure the version matches the JitPack badge above):
Basic usage
NOTE: You will need to specify INTERNET permission in your project if you want to load Internet resources.
First of all, all the View where you want:
Loading Markdown text:
Loading Markdown from a File:
Loading Markdown from Android assets:
Loading Markdown from URL:
Advanced usage
MarkdownView uses css
files to stylize everything, you can customize them too:
Internally, MarkdownView uses an OkHttpClient
to load files from URLs, you can set a custom one if you want:
You can also set the margins of the content (in px):
There's also a rendering listener which will provide you info if there's an error rendering the Markdown and when it has finished rendering (near perfect timing).