22
33[ ![ Android Arsenal] ( https://img.shields.io/badge/Android%20Arsenal-codeview--android-green.svg?style=true )] ( https://android-arsenal.com/details/1/4216 )
44[ ![ Release] ( https://jitpack.io/v/softwee/codeview-android.svg )] ( https://jitpack.io/#softwee/codeview-android )
5+ [ ![ Build Status] ( https://travis-ci.org/Softwee/codeview-android.svg?branch=master )] ( https://travis-ci.org/Softwee/codeview-android )
56
67CodeView helps to show code content with syntax highlighting in native way.
78
@@ -72,10 +73,14 @@ or eplixit (see available extensions below):
7273codeView. highlightCode(" js" ); // it will work fast!
7374```
7475
75- Extend default color theme:
76+ Use default color theme:
7677``` java
77- int myColor = ContextCompat . getColor(this , R . color. code_content_background);
78- codeView. setColorTheme(ColorTheme . SOLARIZED_LIGHT. withBgContent(myColor));
78+ codeView. setColorTheme(ColorTheme . SOLARIZED_LIGHT );
79+ ```
80+ or extend default:
81+ ``` java
82+ int myColor = ContextCompat . getColor(this , R . color. my_color);
83+ codeView. setColorTheme(ColorTheme . MONOKAI. withBgContent(myColor));
7984```
8085or provide your own (don't forget to open PR with this stuff!)
8186``` java
@@ -102,7 +107,7 @@ Sometimes you may want to add some content under line. You can create your own i
102107
1031081 . Create your model to store data, for example some ``` MyModel ``` class.<br >
1041092 . Extend ``` AbstractCodeAdapter<MyModel> ``` typed by your model class.<br >
105- 3 . Implement necessary methods in obtained ``` MyCodeAdapter<MyModel> ``` :
110+ 3 . Implement necessary methods in obtained ``` MyCodeAdapter ``` :
106111``` kotlin
107112// Kotlin
108113class MyCodeAdapter : AbstractCodeAdapter <MyModel > {
@@ -123,7 +128,7 @@ public class MyCodeAdapter extends AbstractCodeAdapter<MyModel> {
123128 @NotNull
124129 @Override
125130 public View createFooter (@NotNull Context context , CustomModel entity , boolean isFirst ) {
126- return /* init your view here */ ;
131+ return /* your initialized view here */ ;
127132 }
128133}
129134```
0 commit comments