falnatsheh/MarkdownView


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

About

MarkdownView (Markdown For Android) is an Android library that helps you display Markdown text or files (local/remote) as formatted HTML, and style the output using CSS.

The MarkdownView itself extends Android Webview and adds the necessary logic to parse Markdown (using MarkdownJ) and display the output HTML on the view.

Getting started

  • To add MarkdownView to your project, add the following to build.gradle file:
 dependencies {

 compile 'us.feras.mdv:markdownview:1.1.0'  
}

Usage

Add MarkdownView to your layout:

 <us.feras.mdv.MarkdownView

android:layout_width="match_parent"

android:layout_height="match_parent"

android:id="@+id/markdownView" />

and reference it in your Activity/Fragment:

MarkdownView markdownView = (MarkdownView) findViewById(R.id.markdownView);
 markdownView.loadMarkdown("## Hello Markdown");
 

Note: You could also create the view by code. Below an example of how to set the whole activity to be a MarkdownView by Adding the following to your onCreate method:

  MarkdownView markdownView = new MarkdownView(this);

setContentView(markdownView);

markdownView.loadMarkdown("## Hello Markdown");
 

Screenshots

Demo App and Code Sample

The above screenshots taking from the demo app which could be found here. The demo app include code to demonstrate:

  • Loading Local Markdown File.
  • Loading Remote Markdown File.
  • Loading Markdown text.
  • Live Preview sample code (similar to Marked Mac app)
  • Themes

Loading Markdown text or file:

  • loadMarkdown(String text): Using this method will result in loading md string to the MarkdownView and displaying it as HTML.

  • loadMarkdownFile(String url): You can use this method to load local or online files.

To load a local file, you have to add it to your assets folder and pass a url that start with "file:///android_asset/" :

markdownView.loadMarkdownFile("file:///android_asset/myFile.md");

To load a remote file you need to pass the full url :

markdownView.loadMarkdownFile("http://www.my-site.com/myFile.md");

Theming

You could apply custom CSS to the MarkdownView. Example:

markdownView.loadMarkdownFile("file:///android_asset/hello.md","file:///android_asset/MyCustomTheme.css");

You could take a look at CSS example here, you could also view them in the sample app.

ChangeLog:

  • MarkdownView 1.1.0:
    • Support Loading Markdown file from assets subfolders (Thanks @echodjb).
  • MarkdownView 1.0.0:
    • Convert to Gradle Project (Avillable now on jCenter).
    • Fix CSS Issue (Thanks @swanson & @echodjb).
    • Update demo app.

License

Apache 2.0

Resources

Library for inject spherical metadata in photos and videos on Android. Only MP4 and JPEG formats supported.

Alternative for MediaPlayer for music files. Uses ExoPlayer 2 and MediaPlayer for lower APIs.

XmlToJson is an Android Studio Library which converts XML to JSON and JSON to XML.

It is fully configurable and easy to integrate with gradle.

Simple yet powerful SQLite database layer for Android that makes database handling feel like magic.

Overview:

  • Simple, intuitive & typesafe API
  • Minimal setup needed
  • Built in RxJava support with reactive stream semantics on queries and operations
  • Built in AutoValue immutable objects support
  • Full support for complex columns
  • Support for SQLite views
  • Persist any third party object with fully customizable object transformers
  • No reflection
  • Compile time annotation processing
  • Probably the fastest library for Android SQLite database operations (without memory caching)

SmartGL is a Graphic Engine for creating Android Games and Apps. It is based on OpenGL and handles 2D Sprites and 3D Textured Objects.

SmartGL is used by several games and apps.

AndroidGestureRecognizer is an Android implementation of the Apple's UIGestureRecognizer framework. https://developer.apple.com/reference/uikit/uigesturerecognizer

For more info about the ui gesture recognizers look this WWDC video https://developer.apple.com/videos/play/wwdc2012/233/

From Apple API reference:

UIGestureRecognizer is an abstract base class for concrete gesture-recognizer classes. A gesture-recognizer object—or, simply, a gesture recognizer—decouples the logic for recognizing a gesture and acting on that recognition. When one of these objects recognizes a common gesture or, in some cases, a change in the gesture, it sends an action message to each designated target object.

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