TracyEminem / ReadMoreTextView

Super easy TextView with 'Read More'

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is ReadMoreTextView

  • Sometimes if TextView's text is too long, we want collapse text
  • It looks like facebook's feature

  • ReadMoreTextView is super easy TextView with 'Read More'



Demo

Sample Review list Profile





Setup

Gradle

Maven Central

dependencies {
    implementation 'kr.co.prnd:readmore-textview:x.x.x'
    //implementation 'kr.co.prnd:readmore-textview:1.0.0'    
}

If you think this library is useful, please press star button at upside.


How to use

<kr.co.prnd.readmore.ReadMoreTextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="@string/long_text"
    app:readMoreColor="@color/colorPrimary"
    app:readMoreMaxLine="4"
    app:readMoreText="…더보기" />

Function

  • toggle(), expand(), collapse(): Change expand/collapse state dynamically
  • isExpanded, isCollased, state: Get state
  • ChangeListener: Observe state change using listener





License

Copyright 2020 PRNDcompany

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.

About

Super easy TextView with 'Read More'


Languages

Language:Kotlin 100.0%