Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jamesnguyenhub/text-decorator
Decorate your TextView easily
https://github.com/jamesnguyenhub/text-decorator
android custom-view decorator java open-source textview
Last synced: 3 months ago
JSON representation
Decorate your TextView easily
- Host: GitHub
- URL: https://github.com/jamesnguyenhub/text-decorator
- Owner: jamesnguyenhub
- License: apache-2.0
- Created: 2016-12-24T04:39:39.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-10T04:50:57.000Z (over 6 years ago)
- Last Synced: 2024-07-27T21:30:02.652Z (3 months ago)
- Topics: android, custom-view, decorator, java, open-source, textview
- Language: Java
- Size: 1.08 MB
- Stars: 399
- Watchers: 13
- Forks: 42
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-android-ui - text-decorator - 轻松装饰TextView (TextView)
README
# Text Decorator
[![Build Status](https://travis-ci.org/nntuyen/text-decorator.svg?branch=master)](https://travis-ci.org/nntuyen/text-decorator)Decorate your TextView easily
![](screenshot/screenshot2.gif)
## Usage
```java
TextDecorator
.decorate(textView, text)
.setTextColor(R.color.colorAccent, 0, 5)
.setBackgroundColor(R.color.colorPrimary, 6, 11)
.strikethrough(12, 26)
.setTextStyle(Typeface.BOLD | Typeface.ITALIC, 27, 40)
.setTypeface("serif", 70, 77)
.setSuperscript(78, 86)
.setSubscript(87, 92)
.underline(120, 200)
.blur(3, BlurMaskFilter.Blur.NORMAL, 0, 2)
.makeTextClickable(new OnTextClickListener() {
@Override public void onClick(View view, String text) {
Toast.makeText(MainActivity.this, text, Toast.LENGTH_SHORT).show();
}
}, 250, 270, false)
.build();
```
or```java
TextDecorator
.decorate(textView, text)
.setTextColor(R.color.colorAccent, "Lorem", "amet")
.setBackgroundColor(R.color.colorPrimary, "dolor", "elit")
.strikethrough("Duis", "Praesent")
.underline("sodales", "quam")
.setSubscript("vitae")
.makeTextClickable(new OnTextClickListener() {
@Override public void onClick(View view, String text) {
Toast.makeText(MainActivity.this, text, Toast.LENGTH_SHORT).show();
}
}, false, "porta", "commodo", "tempor venenatis nulla")
.setTextColor(android.R.color.holo_green_light, "porta", "commodo", "tempor venenatis nulla")
.build();
```## Download
Gradle```javascript
dependencies {
compile 'com.tuyenmonkey:text-decorator:1.0.0'
}
```## License
Copyright 2016 Tuyen Monkey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.