Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

leodan11/ReadMoreOptions

Repository files navigation

Read More Options

API LICENSE

Convert your TextView in ExpandableTextView with added options ReadMore/ReadLess.

Demo

alt text

Credits

This is just an updated version of ReadMoreOptions and applying some of the active pull requests in it. Credits go completely to its creator and the people who has contributed with those pull requests.

Installation

Gradle
  • Step 1. Add the JitPack repository to your build file

    Add it in your root build.gradle at the end of repositories:

    allprojects {
      repositories {
        ...
        maven { url 'https://jitpack.io' }
        }
    }
  • Step 2. Add the dependency

    dependencies {
      implementation 'com.github.leodan11:ReadMoreOptions:{latest version}'
    }
Kotlin
  • Step 1. Add the JitPack repository to your build file.

    Add it in your root build.gradle at the end of repositories:

    repositories {
        ...
        maven(url = "https://jitpack.io")
    }
  • Step 2. Add the dependency

    dependencies {
      implementation("com.github.leodan11:ReadMoreOptions:${latest version}")
    }

Usage

val readMoreOption = ReadMoreOption.Builder(this)
            .textLength(3)
            .labelUnderLine(true)
            //.moreLabelColor(Color.BLUE) Optional
            //.moreLabel(getString(R.string.text_value_read_more)) Optional
            //.lessLabelColor(Color.RED) Optional
            //.lessLabel(getString(R.string.text_value_read_less)) Optional
            .textLengthType(ReadMoreOption.TYPE_LINE) // Or .textLengthType(ReadMoreOption.TYPE_CHARACTER)
            .expandAnimation(true)
            .build()

readMoreOption.addReadMoreTo(textViewExample, R.string.text_value) //Or addReadMoreTo(textViewExample, "Example Text")

About

Convert your TextView in ExpandableTextView with added options ReadMore/ReadLess.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages