GithubHelp home page GithubHelp logo

expandabletext-example's Introduction

ExpandableText-Example


一.简介

仿小红书实现的文本展开/收起的功能

二.方法说明

在设置文本之前,必须手动调用initWidth初始化文本显示的宽

方法 说明
initWidth(int width) 初始化ExpandableText宽度,必须在setOriginalText()之前调用
setMaxLines(int maxLines) 设置最多显示行数
setOpenSuffix(String openSuffix) 设置需要展开时显示的文字,默认为展开
setOpenSuffixColor(@ColorInt int openSuffixColor) 设置需要展开时显示的文字的文字颜色
setCloseSuffix(String closeSuffix) 设置需要收起时显示的文字,默认为收起
setCloseSuffixColor(@ColorInt int closeSuffixColor) 设置需要收起时显示的文字的文字颜色
setCloseInNewLine(boolean closeInNewLine) 设置需要收起时收起文字是否另起一行
setOpenAndCloseCallback(OpenAndCloseCallback callback) 设置展开&收起的点击Callback
setCharSequenceToSpannableHandler(CharSequenceToSpannableHandler handler) 设置文本转换成Spannable的预处理回调,可以处理特殊的文本样式

expandabletext-example's People

Contributors

mrtrying avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.