Skip to content

Commit 203e68d

Browse files
authored
Update README.md
1 parent 947af0d commit 203e68d

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,89 @@
11
# Syntax-View-Android
22
Beautiful Android Syntax View with line counter it will automatically highlight the code,you can design your own IDE using this view
3+
# USAGE
4+
<b>1st way:</b>
5+
6+
- Step 1:
7+
add this to your activity_main.xml or any other activity you want:
8+
```
9+
<net.cryptobrewery.syntaxview.SyntaxView
10+
android:id="@+id/syn"
11+
android:layout_width="match_parent"
12+
android:layout_height="match_parent">
13+
</net.cryptobrewery.syntaxview.SyntaxView>
14+
```
15+
- Step 2:
16+
add this to your java code
17+
```
18+
//declaration
19+
SyntaxView syntax_view = findViewById(R.id.syn);
20+
21+
//this will set the color of Code Text background
22+
syntax_view.setBgColor("#2b2b2b");
23+
//this will set the color of strings between " "
24+
syntax_view.setPrintStatmentsColor("#6a8759");
25+
//this will set the default code text color other than programming keywords!
26+
syntax_view.setCodeTextColor("#ffffff");
27+
//this will set programming keywords color like String,int,for,etc...
28+
syntax_view.setKeywordsColor("#cc7832");
29+
//this will set the numbers color in code | ex: return 0; 0 will be colored
30+
syntax_view.setNumbersColor("#4a85a3");
31+
//this will set the line number view background color at left
32+
syntax_view.setRowNumbersBgColor("#2b2b2b");
33+
//this will set the color of numbers in the line number view at left
34+
syntax_view.setRowNumbersColor("#cc7832");
35+
//this will set color of Annotations like super,@Nullable,etc ....
36+
syntax_view.setAnnotationsColor("#1932F3");
37+
//this will set special characters color like ;
38+
syntax_view.setSpecialCharsColor("#cc7832");
39+
40+
```
41+
<b>2nd way:</b>
42+
```
43+
//this way will set default methods
44+
SyntaxView syntax_view = new SyntaxView(this);
45+
setContentView(syntax_view);
46+
```
47+
<b>3rd way:</b>
48+
```
49+
//other colors can be set manually if needed using set methods like setAnnotationsColor
50+
SyntaxView syntax_view = new SyntaxView(this,"#2b2b2b","#cc7832","#4a85a3","#cc7832","#6a8759");
51+
setContentView(syntax_view);
52+
```
53+
# How to add to your app
54+
55+
add this to your dependencies in build.gradle file
56+
```
57+
implementation 'com.github.Badranh:Syntax-View-Android:0.1.0'
58+
```
59+
Add it in your root build.gradle at the end of repositories:
60+
61+
```
62+
allprojects {
63+
repositories {
64+
...
65+
maven { url 'https://jitpack.io' }
66+
}
67+
}
68+
```
69+
70+
# Example
71+
Colors can be modified as you want
72+
73+
![Screenshot](http://cryptobrewery.net/scn/3.png)
74+
75+
76+
# Changes:
77+
6/25/2018:
78+
- Uploaded Syntax View
79+
- Syntax Highlighting
80+
- Line Number Counter
81+
- Color Flexibility to meet user requirements
82+
83+
# Contribute
84+
Next update:
85+
- User will have the ability to choose a language like " C,Java,Python" So we can do a faster UI and Highlighting(feel free to implement this update if you are able to do so)
86+
- You can contribute to this project for missing programming key words so we can include
87+
them in the next update.
88+
89+
License : MIT

0 commit comments

Comments
 (0)