TextDecorator

A library that helps to decorate TextView easily

License

License

Categories

Categories

KeY Data Data Formats Formal Verification
GroupId

GroupId

com.tuyenmonkey
ArtifactId

ArtifactId

text-decorator
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

aar
Description

Description

TextDecorator
A library that helps to decorate TextView easily
Project URL

Project URL

https://github.com/nntuyen/text-decorator
Source Code Management

Source Code Management

https://github.com/nntuyen/text-decorator

Download text-decorator

How to add to project

<!-- https://jarcasting.com/artifacts/com.tuyenmonkey/text-decorator/ -->
<dependency>
    <groupId>com.tuyenmonkey</groupId>
    <artifactId>text-decorator</artifactId>
    <version>1.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.tuyenmonkey/text-decorator/
implementation 'com.tuyenmonkey:text-decorator:1.0.0'
// https://jarcasting.com/artifacts/com.tuyenmonkey/text-decorator/
implementation ("com.tuyenmonkey:text-decorator:1.0.0")
'com.tuyenmonkey:text-decorator:aar:1.0.0'
<dependency org="com.tuyenmonkey" name="text-decorator" rev="1.0.0">
  <artifact name="text-decorator" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.tuyenmonkey', module='text-decorator', version='1.0.0')
)
libraryDependencies += "com.tuyenmonkey" % "text-decorator" % "1.0.0"
[com.tuyenmonkey/text-decorator "1.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
com.android.support » appcompat-v7 jar 25.1.0

Project Modules

There are no modules declared in this project.

Text Decorator

Build Status

Decorate your TextView easily

Usage

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

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

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 at

   http://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.

Versions

Version
1.0.0