Katex Mathview


Source link: https://github.com/lingarajsankaravelu/Katex

Katex

A KhanAcademy Katex based Library for Rendering math faster in various Android Devices. This a View which is created from extending webview. This view allows you to render latex in your android devices. It can load normal text, text with latex and latex alone. The only thing you have to make sure is your latex should be enclosed inside either $your latex formula$ or $$your latex formula$$. This will also allow you to beautify your formula text by setting color and text size.

Accepted Inputs

$x=\frac{
1+y
}
{
1+2z^2
}
$ 

or

 $$x=\frac{
1+y
}
{
1+2z^2
}
$$ 

or

 sum of ratios =4+3=7 $=\frac{
4
}
{
7
}
\times560=320$ 

or

 Data Included inside HTML TAGS
 <p>If <span class="latexEle" data-latex="x:35::48:60">$x:35::48:60$</span><span>??</span>, find the value of <span class="latexEle" data-latex="x">$x$</span><span>??</span>.</p> 

Setup

Dependencies {

compile 'in.hourglass.mathrender:katexmathview:1.0' 
}
 

Attributes supported

 setTextColor

 -> Allows you to beautify your latex with specific color of your choice  setTextSize

  -> Allows you to set text size of the latex displayed on screen  setViewBackgroudColor -> set the background color of the view.  setClickable

i.True
  -> Setting this to true will allow KatexMathview to act as Textview and it will also intercept parent layout touchevent useful to register click
  when this view is used with List,Recyclerview.
 ii.False
-> Setting this to false will make katexMathvview act as an webview with zoom in controls etc.  

Adding to your XML Layout


 <katex.hourglass.in.mathlib.MathView

 app:setTextColor="@color/primary"

 app:setTextSize="14sp"

 app:setClickable="true"

 app:setText="@string/single_formula"

 android:layout_gravity="center"

 android:layout_width="match_parent"

 android:layout_height="wrap_content" /> 

Adding at runtime


 MathView mathView = new MathView(getApplicationContext());

  mathView.setClickable(true);

  mathView.setTextSize(14);

  mathView.setTextColor(ContextCompat.getColor(getApplicationContext(),android.R.color.white));

  mathView.setDisplayText(getResources().getString(R.string.runtime_formula));

  mathView.setViewBackgroundColor(ContextCompat.getColor(getApplicationContext(),android.R.color.black));

  parent_layout.addView(mathView);
 

Demo

You can have look into complete Demo project code in here.

License

 The MIT License (MIT)
Copyright (c) 2017 Lingaraj Sankaravelu
Permission is hereby granted, free of charge, to any person obtaining a copy  of this software and associated documentation files (the "Software"), to deal  in the Software without restriction, including without limitation the rights  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell  copies of the Software, and to permit persons to whom the Software is  furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all  copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  SOFTWARE. 

Resources

A slim & clean & typeable Adapter without VIEWHOLDER.

Features:

  • No ViewHolder any more
  • No Reflection
  • Fluent & simple API
  • Multi-typeable adapter
  • Support Kotlin
  • Support Simple DiffUtils

A camera view to capture long image merged from small captured images as it is in Shoparoo app!

This library uses CameraView from Google as the backbone of camera functionality and adds auto-support of creating long or wide images from multiple images.

Features:

  • Built-in Camera UI and activity
  • Built-in Image Viewer with pinch-fling gestures for zoom/move/rotate etc.
  • TouchImageView with gestures support for zoom/move/rotate etc.
  • Built-in permission handling for Camera and Storage
  • Horizontal or Vertical image merging

Android Runtime Permission is an easy way to handle single or multiple permission very easily.

In-App Android Debugging Tool With Enhanced Logging, Networking Info, Crash reporting And More.

The debugger tool for Android developer. Display logs, network request, while using the app. Easy accessible with its bubble head button :radio_button:. Easy to integrate in any apps, to handle development or testing apps easier. First version, there is plenty of room for improvement.

Quoteable is a simple library to request random quotes from the free Forismatic Quote API to help implement quotes into your app.

A synchronous CallAdapter.Factory implementation for Retrofit 2. This project brings Retrofit 1's synchronous usage to Retrofit 2.

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