All Projects → avraampiperidis → Codeview

avraampiperidis / Codeview

Codeview is an Android library that lets you preview code in webview very easy and simple with highlights and colors.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Codeview

Elm Format
elm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guide
Stars: ✭ 1,240 (+1103.88%)
Mutual labels:  formatter
Flutter browser app
A Full-Featured Mobile Browser App (such as the Google Chrome mobile browser) created using Flutter and the features offered by the flutter_inappwebview plugin.
Stars: ✭ 85 (-17.48%)
Mutual labels:  webview
Laravel Oh Generators
This package extends the core file generators that are included with Laravel 5 or later.
Stars: ✭ 96 (-6.8%)
Mutual labels:  formatter
Plugin Php
Prettier PHP Plugin
Stars: ✭ 1,243 (+1106.8%)
Mutual labels:  formatter
Phonenumberformatter
UITextField subclass for formatting phone numbers. Allow different formats for different countries(patterns).
Stars: ✭ 85 (-17.48%)
Mutual labels:  formatter
Android Ssl Pinning Webviews
A simple demo app that demonstrates Certificate pinning and scheme/domain whitelisting in Android WebViews
Stars: ✭ 86 (-16.5%)
Mutual labels:  webview
Aspnetcorecsvimportexport
ASP.NET Core CSV import export custom formatters
Stars: ✭ 77 (-25.24%)
Mutual labels:  formatter
Snowonder
🔮 Magical import declarations formatter for Xcode
Stars: ✭ 100 (-2.91%)
Mutual labels:  formatter
Flutter inappwebview
A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.
Stars: ✭ 1,259 (+1122.33%)
Mutual labels:  webview
Unimport
A linter, formatter for finding and removing unused import statements.
Stars: ✭ 96 (-6.8%)
Mutual labels:  formatter
Black Playground
ambv/black online demo
Stars: ✭ 83 (-19.42%)
Mutual labels:  formatter
Coolindicator
A dazzling indicator
Stars: ✭ 85 (-17.48%)
Mutual labels:  webview
Iamport React Native
React Native용 아임포트 일반.결제 및 휴대폰 본인인증 모듈입니다.
Stars: ✭ 88 (-14.56%)
Mutual labels:  webview
Texttable
Swift package for easily rendering text tables. Inspired by the Python tabulate library.
Stars: ✭ 82 (-20.39%)
Mutual labels:  formatter
3dsview
Android UI component to process banking 3D Secure (MasterCard SecureCode / Verified By Visa) payment authorizations in Android apps.
Stars: ✭ 96 (-6.8%)
Mutual labels:  webview
React Native Web Webview
React Native for Web implementation of RN's WebView
Stars: ✭ 79 (-23.3%)
Mutual labels:  webview
Easy web view
Flutter Web Views on Mobile and Web made easy!
Stars: ✭ 85 (-17.48%)
Mutual labels:  webview
Unity Webview
主に gree/unity-webview のリファクタリング。本家を元に改良してく!
Stars: ✭ 102 (-0.97%)
Mutual labels:  webview
Kibana Object Format
A Kibana plugin for displaying objects and arrays of objects.
Stars: ✭ 100 (-2.91%)
Mutual labels:  formatter
React Native Webview Crosswalk
Crosswalk's WebView for React Native on Android.
Stars: ✭ 92 (-10.68%)
Mutual labels:  webview

Codeview


http://avraampiperidis.github.io/Codeview/
Android Arsenal

Codeview is a android library tha lets you preview code in webview very easy and simple with highlighs and colors. With styles to chooses and language.

Also you can inject html and text into webview or any extended webview class.

This library was inspired and is working thanks to highlight.js.
Apps using Codeview library.
https://play.google.com/store/apps/details?id=com.protectsoft.javatutorial
https://play.google.com/store/apps/details?id=com.protectsoft.pythontutorial

https://bintray.com/zeronerone/maven/Codeview#statistics

Usage

Codeview

Download/Install Gradle


repositories {
        jcenter()
    }
    
compile 'Codeview-1.0.0:webviewcode:1.0.0' 
1) Get a reference to your WebView or any extended WebView
WebView webview = (WebView) findViewById(R.id.webview);
//set settings here
2) Basic usage. Default style is Original, and default language is java.
//your string code 
String code = "public static void main(String[] args) { \n" +
                "\n" +
                "//comments\n" +
                "   for(int i =0; i < 10; i++) {\n" +
                "       addnum();\n" +
                "   }\n" +
                "\n" +
                "}\n";
								
Codeview.with(getApplicationContext())
		.withCode(code)
		.into(webview);
3) set style and language.
MyTouchWebView webview = (MyTouchWebView) findViewById(R.id.mytouchwebview);
//set settings here
//your string java code 
String code = "public static void main(String[] args) { \n" +
                "\n" +
                "//comments\n" +
                "   for(int i =0; i < 10; i++) {\n" +
                "       addnum();\n" +
                "   }\n" +
                "\n" +
                "}\n";
								
Codeview.with(getApplicationContext())
		.withCode(code)
		.setStyle(Settings.WithStyle.DARKULA)
        .setLang(Settings.Lang.JAVA)
		.into(webview);
4) Inject html head content and text.
WebView webview = (WebView) findViewById(R.id.webview);
//set settings here
//your string javascript code
        String code = "function Constructor(v1,v2,v3)\n" +
                "{\n" +
                "  this.v1 = v1;\n" +
                "  this.v2 = v2;\n" +
                "  this.funk = function()\n" +
                "  {\n" +
                "    console.log(\"Test: \"+ v3 );\n" +
                "  }\n" +
                "}\n" +
                "\n" +
                "var obj1 = new Constructor(\"par1\",\"par2\",\"par3\");\n" +
                "var arr = [\"w1\",\"w2\",\"w3\",obj1];\n" +
                "\n" +
                "function f2()\n" +
                "{            \n" +
                "  obj1.funk(); //works ok\n" +
                "  console.log(\"test \"+tablica[3].funk.call() ); //doesn't work\n" +
                "}";
                
                
        Codeview.with(getApplicationContext())
                .setHtmlHeadContent("<style> table,tr,td {" +
                        " border: 1px solid black;" +
                        " }" +
                        "" +
                        "</style>")
                .withHtml("<h1> h1 injected header</h1>")
                .withText("this text is always wrap inside pre tags")
                .withCode(code)
                .withHtml("<h1> h1 header after code </h1>")
                .withHtml("<table><tr><td> my html table </td></tr></table>")
                .setStyle(Settings.WithStyle.DARKSTYLE)
                .setLang(Settings.Lang.JAVASCRIPT)
                .setAutoWrap(true)
                .into(webView);

License

MIT License

Copyright (c) 2016 Avraam Piperidis

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].