Skip to content

Commit 339a11d

Browse files
authored
Merge pull request #40 from Arashvscode/master
Document update
2 parents 0985563 + 0c870d5 commit 339a11d

7 files changed

Lines changed: 49 additions & 48 deletions

File tree

docs/add-to-xml.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
It's easy to add CodeView in your XML layout, notes that CodeView is based on AppCompatMultiAutoCompleteTextView,
44
so you can easily customize it like any AutoCompleteTextView
55

6-
```
6+
``` xml
77
<com.amrdeveloper.codeview.CodeView
88
android:id="@+id/codeView"
99
android:layout_width="match_parent"
@@ -13,4 +13,4 @@ so you can easily customize it like any AutoCompleteTextView
1313
android:dropDownHorizontalOffset="0dp"
1414
android:dropDownSelector="@color/darkGrey"
1515
android:gravity="top|start" />
16-
```
16+
```

docs/auto-complete.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ You have many options to provide an auto complete feature with CodeView
44

55
### Providing a simple auto complete from an array of strings
66

7-
```
7+
``` java
88
// Your language keywords
99
String[] languageKeywords = .....
1010
// List item custom layout
@@ -22,7 +22,7 @@ codeView.setAdapter(adapter);
2222
- This option is better if you want to provide title and prefix for your keywords,
2323
also it more easier to use it with snippets feature.
2424

25-
```
25+
``` java
2626
List<Code> codes = new ArrayList<>();
2727
codes.add(new Keyword(..., ..., ...));
2828

@@ -40,18 +40,18 @@ codeView.setAdapter(codeAdapter);
4040
In both options you can provide custom layout and custom tokenizer if you need that.
4141

4242

43-
```
43+
``` java
4444
codeView.setAutoCompleteTokenizer(tokenizer);
4545
```
4646

4747
You can limit the number of suggestions result in the auto complete dialog
4848

49-
```
49+
``` java
5050
codeView.setMaxSuggestionsSize(maxSize);
5151
```
5252

5353
Set the auto complete list item size in dp to use it to calculate the full dialog size
5454

55-
```
55+
``` java
5656
codeView.setAutoCompleteItemHeightInDp(50);
57-
```
57+
```

docs/auto-indenting.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@ Now after you understanding how auto indenting works, it's time to know how to c
1313

1414
### Set Indentations Starts set of characters
1515

16-
```
16+
``` java
1717
codeView.setIndentationStarts(indentationStart);
1818
```
1919

2020
### Set Indentations Ends set of characters
2121

22-
```
22+
``` java
2323
codeView.setIndentationEnds(indentationEnds);
2424
```
2525

2626
### Enable/Disable Auto Indentation
2727

28-
```
28+
``` java
2929
codeView.setEnableAutoIndentation(enableIndentation);
3030
```
3131

3232
### Set Tab length
3333

34-
```
34+
``` java
3535
codeView.setTabLength(tabLength);
36-
```
36+
```

docs/find-and-replace.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,44 @@ Starting From version 1.2.1 CodeView now have support for find and replace featu
44

55
- To get a list of tokens that matchs your regex, you can use findMatches method.
66

7-
```
7+
``` java
88
List<Token> tokens = codeView.findMatches(regex);
99
```
1010

1111
- To highlight and get the next matching token you can use findNextMatch
12-
13-
```
12+
13+
``` java
1414
Token token = codeView.findNextMatch();
1515
```
1616

1717
- To highlight and get the previous matching token you can use findPrevMatch
1818

19-
```
19+
``` java
2020
Token token = codeView.findPrevMatch();
2121
```
2222

2323
- You can set differnt color for highlighting matching token depend on your theme
2424

25-
```
25+
``` java
2626
codeView.setMatchingHighlightColor(color);
2727
```
2828

2929
- To clear all the matches tokens
3030

31-
```
31+
``` java
3232
codeView.clearMatches();
3333
```
3434

3535
- You can replace the first string that matching the regex with other string.
3636

37-
```
37+
``` java
3838
codeView.replaceFirstMatch(regex, replacement);
3939
```
4040

4141
- You can replace all strings that matching the regex with other string.
4242

43-
```
43+
``` java
4444
codeView.replaceAllMatches(regex, replacement);
4545
```
4646

47-
You will find a full example with UI dialog for this feature in the example app
47+
You will find a full example with UI dialog for this feature in the example app

docs/line-number.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,60 @@ Starting From version 1.1.1 CodeView now have support for line number.
44

55
### Enable/Disable line number
66

7-
```
8-
codeView.setEnableLineNumber(enableLineNumber);
7+
``` java
8+
codeView.setEnableLineNumber(true and false);
99
```
1010

1111
### Check if line number feature is enabled
1212

13-
```
13+
``` java
1414
codeView.isLineNumberEnabled();
1515
```
1616

1717
### Enable/Disable relative line number
1818

19-
```
20-
codeView.setEnableRelativeLineNumber(enableRelativeLineNumber);
19+
``` java
20+
codeView.setEnableRelativeLineNumber(true and false);
2121
```
2222

2323
### Check if relative line number feature is enabled
2424

25-
```
25+
``` java
2626
codeView.isLineRelativeNumberEnabled();
2727
```
2828

2929
### Enable/Disable highlight current line
3030

31-
```
32-
codeView.setEnableHighlightCurrentLine(enableHighlightCurrentLine);
31+
``` java
32+
codeView.setEnableHighlightCurrentLine(true and false);
3333
```
3434

3535
### Check if highlight current line feature is enabled
3636

37-
```
37+
``` java
3838
codeView.isHighlightCurrentLineEnabled();
3939
```
4040

4141
### Set highlight current line color
4242

43-
```
43+
``` java
4444
codeView.setHighlightCurrentLineColor(Color.GREY);
4545
```
4646

4747
### Set line number text color
4848

49-
```
49+
``` java
5050
codeView.setLineNumberTextColor(Color.GREY);
5151
```
5252

5353
### Set line number text size
5454

55-
```
56-
codeView.setLineNumberTextSize(size);
55+
``` java
56+
codeView.setLineNumberTextSize(size like 30f);
5757
```
5858

5959
### Set line number typeface
6060

61-
```
61+
``` java
6262
codeView.setLineNumberTypeface(typeface);
6363
```

docs/pair-complete.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,48 @@ or closing braces complete.
66

77
This features is disabled by default to enable or disable it
88

9-
```
9+
``` java
1010
codeView.enablePairComplete(enableFeature);
1111
```
1212

1313
To enable or disable move the cursor to the center of the pair after inset it
1414

15-
```
15+
``` java
1616
codeView.enablePairCompleteCenterCursor(enableFeature);
1717
```
1818

1919
To use this feature you need to create a Map that contains the pairs keys and values for example
2020

21-
```
21+
``` java
2222
Map<Character, Character> pairCompleteMap = new HashMap<>();
2323
pairCompleteMap.put('{', '}');
2424
pairCompleteMap.put('[', ']');
2525
pairCompleteMap.put('(', ')');
2626
pairCompleteMap.put('<', '>');
2727
pairCompleteMap.put('"', '"');
28+
2829
```
2930

3031
To add your full pairs map
3132

32-
```
33+
``` java
3334
codeView.setPairCompleteMap(pairCompleteMap);
3435
```
3536

3637
To add a single pair
3738

38-
```
39+
``` java
3940
codeView.addPairCompleteItem('[', ']');
4041
```
4142

4243
To remove a single pair
4344

44-
```
45+
``` java
4546
codeView.removePairCompleteItem('[');
4647
```
4748

4849
To remove all the pairs
4950

50-
```
51+
``` java
5152
codeView.clearPairCompleteMap();
52-
```
53+
```

docs/snippets.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Starting From version 1.1.1 CodeView now have support for snippts.
44

55
In the CodeView library keywords and snippets are classes that implementing the Code interface.
66

7-
```
7+
``` java
88
public interface Code {
99
String getCodeTitle();
1010
String getCodePrefix();
@@ -22,17 +22,17 @@ This class has three attributes title, prefix and body, It’s important to know
2222

2323
Add Custom AutoComplete Adapter that support Snippets
2424

25-
```
25+
``` java
2626
List<Code> codes = new ArrayList<>();
2727
codes.add(new Snippet(..., ..., ...));
2828

2929
// Your language keywords
3030
String[] languageKeywords = .....
3131
// List item custom layout
3232
int layoutId = .....
33-
// TextView id on your custom layout to put suggestion on it
33+
// TextView id on your custom layout to put suggestion on it R.layout.yourlayout
3434
int viewId = .....
3535

3636
CodeViewAdapter codeAdapter = new CodeViewAdapter(context, layoutId, viewId, codes);
3737
codeView.setAdapter(codeAdapter);
38-
```
38+
```

0 commit comments

Comments
 (0)