GithubHelp home page GithubHelp logo

suifengpiaobo / expandabletextviewexample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jaydenxiao2016/expandabletextviewexample

0.0 2.0 0.0 4.62 MB

最轻量的可展开和收缩内容的TextView,可用于listview等列表或普通布局情况

Java 100.00%

expandabletextviewexample's Introduction

###非常轻量的可展开和收缩内容的TextView,可用于listview等列表或普通布局情况 ###项目介绍: 一个支持可展开和收缩内容的TextView,支持在listview等列表使用不错乱,支持在普通局部使用 ###国际案例:有图有真相 效果预览图 ###支持配置属性:

  • 显示内容最大显示行数配置
  • 显示内容字体大小颜色配置
  • 展开/收起图标配置
  • 展开/收起位置配置
  • 展开/收起字体大小颜色配置
  • 展开/收起变化监听

###使用方法

  • use Gradle:
dependencies {

compile 'com.jaydenxiao:ExpandableTextView:1.0.0'

}
  • Or Maven:
<dependency>
  <groupId>com.jaydenxiao</groupId>
  <artifactId>ExpandableTextView</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>
  • Or download the libray for your module:

######布局文件

 <jaydenxiao.com.expandabletextview.ExpandableTextView
        android:id="@+id/etv"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:animDuration="200"
        android:padding="8dp"
        app:collapseDrawable="@drawable/icon_green_arrow_down"
        app:collapseExpandGrarity="right"
        app:collapseExpandTextColor="@color/main_color"
        app:contentTextColor="@color/gray"
        app:contentTextSize="14sp"
        app:expandDrawable="@drawable/icon_green_arrow_up"
        app:maxCollapsedLines="5"
        app:textCollapse="@string/collapse"
        app:textExpand="@string/expand" />

######设置text值

  • 普通情况 expandableTextView.setText("content");
  • 列表情况(把item位置传入,记录状态) expandableTextView.setText("content",position);

更多精彩文章请关注微信公众号"Android经验分享":这里将长期为您分享Android高手经验、中外开源项目、源码解析、框架设计和Android好文推荐!

扫一扫加我哦

expandabletextviewexample's People

Contributors

jaydenxiao2016 avatar

Watchers

James Cloos avatar suifengpiaobo 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.