Skip to content

Commit b53b36d

Browse files
authored
Update README.md
1 parent 0c0e601 commit b53b36d

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ CodeView helps to show code content with syntax highlighting in native way.
33

44
## Description
55
CodeView contains 3 core parts to implement necessary logic:<br>
6-
1. <b>CodeClassifier</b> is trying to define what language presented in code snippet. It built upon <a href="https://github.com/ptnplanet/Java-Naive-Bayes-Classifier">Naive Bayes classifier</a>. There is no need to work with this class directly & you must just follow instructions below.<br>
6+
7+
1. <b>CodeClassifier</b> is trying to define what language presented in code snippet. It built upon <a href="https://github.com/ptnplanet/Java-Naive-Bayes-Classifier">Naive Bayes classifier</a>. There is no need to work with this class directly & you must just follow instructions below. <font color="red">Experimental module, doesn't work properly!</font><br>
8+
79
2. For highlighting it uses <b>CodeHighlighter</b>, just highlights your code & returns formatted content. It based on Google Prettify and <a href="https://github.com/twalcari/java-prettify">their fork</a>.<br>
8-
3. <b>CodeView</b> & necessary adapter.<br>
10+
11+
3. <b>CodeView</b> & related adapter.<br>
912

1013
## Download
1114
Add it in your root ```build.gradle``` at the end of repositories:
@@ -56,15 +59,15 @@ codeView.highlightCode("java");
5659
You can use both forms for build & built view, but note: ```setCodeContent(String)``` is final step when you build your view, otherwise not. If you firstly highlight and then set code content, code will not be highlighted. Instructions above helps you to avoid errors. View has state to handle this behavior.
5760

5861
## Customizing
59-
1. Use implicit or eplixit form to code highlighting:
62+
Use implicit or eplixit form to code highlighting:
6063
```java
6164
codeView.highlightCode();
6265
```
6366
```java
6467
codeView.highlightCode("js"); // it will work fast!
6568
```
6669

67-
2. Extend default color theme or create your own (don't forget to open PR with this stuff!):
70+
Extend default color theme or create your own (don't forget to open PR with this stuff!):
6871
```java
6972
int myColor = ContextCompat.getColor(this, R.color.code_content_background);
7073
codeView.setColorTheme(ColorTheme.SOLARIZED_LIGHT.withBgContent(myColor));
@@ -73,7 +76,7 @@ codeView.setColorTheme(ColorTheme.SOLARIZED_LIGHT.withBgContent(myColor));
7376
codeView.setColorTheme(new ColorThemeData(new SyntaxColors(...)));
7477
```
7578

76-
3. Handle user clicks on code lines:
79+
Handle user clicks on code lines:
7780
```java
7881
codeView.setCodeListener(new OnCodeLineClickListener() {
7982
@Override
@@ -83,6 +86,11 @@ codeView.setCodeListener(new OnCodeLineClickListener() {
8386
});
8487
```
8588

89+
## How it looks in app
90+
See <a href="https://github.com/Softwee/codeview-android/tree/master/example">example</a>.<br>
91+
92+
[![CodeView_Android_Screenshot.png](https://s10.postimg.org/ckzv9xmm1/Code_View_Android_Screenshot.png)](https://postimg.org/image/6wtkj1i9h/)
93+
8694
## License MIT
8795
Copyright (c) 2016 Softwee
8896

0 commit comments

Comments
 (0)