Skip to content

jamesnguyenhub/text-decorator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b2f304d · Jun 26, 2017

History

47 Commits
Dec 25, 2016
Mar 13, 2017
Mar 19, 2017
Mar 19, 2017
Dec 25, 2016
Dec 24, 2016
Mar 19, 2017
Dec 24, 2016
Jan 7, 2017
Jun 26, 2017
Mar 19, 2017
Dec 29, 2016
Mar 13, 2017
Mar 13, 2017
Dec 24, 2016

Repository files navigation

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.