Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/testica/codeeditor
Code editor android library (custom syntax highlighting, number lines, etc)
https://github.com/testica/codeeditor
android android-library code-editor editor edittext highlight-syntax kotlin
Last synced: 3 months ago
JSON representation
Code editor android library (custom syntax highlighting, number lines, etc)
- Host: GitHub
- URL: https://github.com/testica/codeeditor
- Owner: testica
- License: mit
- Created: 2019-03-18T01:08:30.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-20T09:06:39.000Z (about 2 years ago)
- Last Synced: 2024-10-11T20:14:37.205Z (4 months ago)
- Topics: android, android-library, code-editor, editor, edittext, highlight-syntax, kotlin
- Language: Kotlin
- Homepage:
- Size: 729 KB
- Stars: 40
- Watchers: 1
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Code Editor
[ ![Download](https://api.bintray.com/packages/testica-android/maven/codeeditor/images/download.svg) ](https://bintray.com/testica-android/maven/codeeditor/_latestVersion)Code Editor is an Android library that simplify the display of code, making easy syntax highlighting and showing number of lines.
![]()
## Requirements
- minSdkVersion 15
- compileSdkVersion 28## Download
Include into the build.gradle file:
```groovy
dependencies {
implementation 'me.testica:codeeditor:1.0.2'
}
```
## UsageFrom layout:
```xml```
Then, manipulate programmatically:
Java:
```java
Editor editor = (Editor) findViewById(R.id.editor);
editor.setText("Hello Android");
```
Kotlin:
```kotlin
editor.setText("Hello Android")
```### Syntax Highlight Rules
Define a list of rules using a regular expression and color
Java:
```java
editor.setSyntaxHighlightRules(
new SyntaxHighlightRule("[0-9]*", "#00838f"),
new SyntaxHighlightRule("/\\\\*(?:.|[\\\\n\\\\r])*?\\\\*/|(?