MarkdownView


Source link: https://github.com/fiskurgit/MarkdownView

MarkdownView

Markdown view for Android. Display Markdown in your apps, useful for FAQs, Help, Size Guides, About screens etc. To make things really easy there's an Activity included, just use the included IntentBuilder.

This library is essentially just a wrapper around Marked.js and uses Github Markdown CSS to style the generated Markdown.

Usage

Activity

Launch the activity using the builder and supply one of three sources for the Markdown content: markdown(String), resourceId(R.string.markdown_string), or a .md file in the res/raw directory: rawFileId(R.raw.markdown_file).

Intent intent = MarkdownActivity.IntentBuilder.getBuilder()
  .showToolbar(true)
  .title("Markdown")
  .displayHomeAsUp(true)
  .markdown("# Hello Markdown\n\n[fiskurgit](https://github.com/fiskurgit)")
  .allowGestures(false)
  .build(MainActivity.this);
  startActivity(intent);

View

The cleanest way to display markdown is to add the 'markdown' namespace to your parent layout: xmlns:markdown="http://schemas.android.com/apk/res-auto" and then use the markdown:rawFile and markdown:markdown xml attributes in your MarkdownView declaration:

<eu.fiskur.markdownview.MarkdownView
  markdown:rawFile="@raw/markdown_file"
  android:layout_width="match_parent"
  android:layout_height="115dp" />

<eu.fiskur.markdownview.MarkdownView
  markdown:markdown="@string/markdown_string_resource"
  android:layout_width="match_parent"
  android:layout_height="115dp" />

or do it in code from a Fragment or Activity:

MarkdownView markdownView = (MarkdownView) findViewById(R.id.markdown_view);
  //load a md file from the raw directory: markdownView.showMarkdown(R.raw.markdown_file);
  //or use a String markdownView.showMarkdown("# Hello Markdown\n\n[fiskurgit](https://github.com/fiskurgit)");

##Dependency

Add jitpack.io to your root build.gradle, eg:

allprojects {

  repositories {

jcenter()

maven {
 url "https://jitpack.io" 
}

  
}
 
}

then add the dependency to your project build.gradle:

dependencies {

  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile 'com.github.fiskurgit:MarkdownView:1.1.0' 
}

You can find the latest version in the releases tab above: https://github.com/fiskurgit/MarkdownView/releases

More options at jitpack.io: https://jitpack.io/#fiskurgit/MarkdownView

##Licence

Full licence here: https://github.com/fiskurgit/MarkdownView/blob/master/LICENSE

In short:

The MIT License is a permissive license that is short and to the point. It lets people do anything they want with your code as long as they provide attribution back to you and don’t hold you liable.

Resources

Servant will create and manage GoogleApiClient from Google Play Services for you so you can focus on the important actions and requests you want to perform with them.

Gradle plugin for creating fat/uber JARs with support for package relocation.

Easily add "New Post" popup button with the feeds (RecyclerView) of your app.

A nice breathing progress component.

Lightweight Android MVP library with easy implementation.

It's just an example of material transition.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes