GithubHelp home page GithubHelp logo

finalyang / moretextview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from binny1024/moretextview

0.0 0.0 0.0 616 KB

:fire:”QQ:交流群 :192268854。这个群我不维护了,让给同学了。简介:1、在文本末尾,实现点击“展开”---展开所有文本,并把“展开”改为“收起”;点击“收起”,则收起文本; 2、“展开”和“收起”紧跟文本末尾。并且不换行。

Java 100.00%

moretextview's Introduction

MoreTextView

一行代码实现TextView的“展开”和“收起”

引用

compile 'com.smart.moretext:moretext:1.0.0

需求介绍:

1、在文本末尾,实现点击“展开”---展开所有文本,并把“展开”改为“收起”;点击“收起”,则收起文本; 2、“展开”和“收起”紧跟文本末尾。并且不换行。

函数说明

1.1 构造函函数

1.1.1 文字形式
    /**
     * @param textView  文本框
     * @param oriMsg    原始信息
     * @param textOpen  展开性质的文字
     * @param textClose 关闭性质的文字
     */
    public UtilMoreText(final TextView textView, String oriMsg, String textOpen, String textClose) {
    }
1.1.2 文字形式
    /**
     * @param textView 文本框
     * @param oriMsg   原始文字
     */
    public UtilMoreText(final TextView textView, String oriMsg) {
    
    }
1.1.3 图片形式
    /**
     * @param textView      文本框
     * @param oriMsg        原始文字
     * @param drawableOpen  展开图标
     * @param drawableColse 关闭图标
     */
    public UtilMoreText(final TextView textView, String oriMsg, Drawable drawableOpen, Drawable drawableColse) {
    }

####成员方法介绍

/** 设置结尾 文字的颜色
 * @param spanTextColor 颜色id
 * @return 本类实例
 */
public UtilMoreText setSpanTextColor(int spanTextColor) {
   
}

使用说明

设置文本

new UtilMoreText(tv1,msg).setSpanTextColor(R.color.colorAccent).createString();

设置图标

new UtilMoreText(tv2,msg,down,up).createImg();

UtilMoreText.java 源码地址

https://github.com/XBean1024/MoreTextView/blob/master/moretext/src/main/java/com/smart/moretext/UtilMoreText.java

效果图,(结尾随意找的图片,项目中更换一下)

推荐,其他网友的一个组合view实现的,效果也不错

先看下效果图吧:

simple.gif

地址

https://github.com/XBean1024/MoreTextView-1

QQ:交流群 :192268854

moretextview's People

Contributors

binny1024 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.