You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-5Lines changed: 13 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,12 @@ CodeView helps to show code content with syntax highlighting in native way.
3
3
4
4
## Description
5
5
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 <ahref="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 <ahref="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. <fontcolor="red">Experimental module, doesn't work properly!</font><br>
8
+
7
9
2. For highlighting it uses <b>CodeHighlighter</b>, just highlights your code & returns formatted content. It based on Google Prettify and <ahref="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>
9
12
10
13
## Download
11
14
Add it in your root ```build.gradle``` at the end of repositories:
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.
57
60
58
61
## Customizing
59
-
1.Use implicit or eplixit form to code highlighting:
62
+
Use implicit or eplixit form to code highlighting:
60
63
```java
61
64
codeView.highlightCode();
62
65
```
63
66
```java
64
67
codeView.highlightCode("js"); // it will work fast!
65
68
```
66
69
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!):
68
71
```java
69
72
int myColor =ContextCompat.getColor(this, R.color.code_content_background);
0 commit comments