亲宝软件园·资讯

展开

android 全文 收起 Android仿微信朋友圈全文、收起功能的实例代码

wildma 人气:0
想了解Android仿微信朋友圈全文、收起功能的实例代码的相关内容吗,wildma在本文为您仔细讲解android 全文 收起的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:android,全文,收起,android,微信朋友圈收起,下面大家一起来学习吧。

前言

一般在社交APP中都有类似朋友圈的功能,其中发表的动态内容很长的时候不可能让它全部显示。这里就需要做一个仿微信朋友圈全文、收起功能来解决该问题。在网上看到一个例子-->https://m.qb5200.com/,写的很不错,但是有个bug,他这个Demo只有在条目固定的时候才正常,当增加、删除条目的时候会出现全文、收起显示混乱的问题。原因是他使用了固定的position作为key来保存当前显示的状态。这篇文章在他的基础上进行优化。

效果图

具体代码

(详细解释在代码注释中都有,这里就省略了)

MainActivity.java

packagehttps://m.qb5200.com/com.wildma.wildmaexpandfoldtext; importhttps://m.qb5200.com/android.os.Bundle; importhttps://m.qb5200.com/android.support.v7.app.AppCompatActivity; importhttps://m.qb5200.com/android.support.v7.widget.LinearLayoutManager; importhttps://m.qb5200.com/android.support.v7.widget.RecyclerView; importhttps://m.qb5200.com/java.util.ArrayList; importhttps://m.qb5200.com/java.util.List; /** https://m.qb5200.com/*https://m.qb5200.com/Authorhttps://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/wildma https://m.qb5200.com/*https://m.qb5200.com/DATEhttps://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/2017/8/3 https://m.qb5200.com/*https://m.qb5200.com/Deshttps://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/${TODO} https://m.qb5200.com/*/ publichttps://m.qb5200.com/classhttps://m.qb5200.com/MainActivityhttps://m.qb5200.com/extendshttps://m.qb5200.com/AppCompatActivityhttps://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/privatehttps://m.qb5200.com/RecyclerViewhttps://m.qb5200.com/mRecyclerView; https://m.qb5200.com/https://m.qb5200.com/List<ExpandFoldTextBean>https://m.qb5200.com/mListhttps://m.qb5200.com/=https://m.qb5200.com/newhttps://m.qb5200.com/ArrayList<>(); https://m.qb5200.com/https://m.qb5200.com/@Override https://m.qb5200.com/https://m.qb5200.com/protectedhttps://m.qb5200.com/voidhttps://m.qb5200.com/onCreate(Bundlehttps://m.qb5200.com/savedInstanceState)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/super.onCreate(savedInstanceState); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/setContentView(R.layout.activity_main); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/initData(); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/ExpandFoldTextAdapterhttps://m.qb5200.com/adapterhttps://m.qb5200.com/=https://m.qb5200.com/newhttps://m.qb5200.com/ExpandFoldTextAdapter(mList,https://m.qb5200.com/this); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/mRecyclerViewhttps://m.qb5200.com/=https://m.qb5200.com/(RecyclerView)https://m.qb5200.com/findViewById(R.id.recyclerview); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/mRecyclerView.setLayoutManager(newhttps://m.qb5200.com/LinearLayoutManager(this,https://m.qb5200.com/LinearLayoutManager.VERTICAL,https://m.qb5200.com/false)); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/mRecyclerView.setAdapter(adapter); https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com//** https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/*https://m.qb5200.com/初始化数据 https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/*/ https://m.qb5200.com/https://m.qb5200.com/privatehttps://m.qb5200.com/voidhttps://m.qb5200.com/initData()https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/Stringhttps://m.qb5200.com/longContenthttps://m.qb5200.com/=https://m.qb5200.com/"-->游泳、快走、慢跑、骑自行车,及一切有氧运动都能锻炼心脏。有氧运动好处多:能锻炼心肺、增强循环系统功能、燃烧脂肪、加大肺活量、降低血压,甚至能预防糖尿病,减少心脏病的发生。美国运动医学院建议,想知道有氧运动强度是否合适,可在运动后测试心率,以达到最高心率的60%—90%为宜。如果想通过有氧运动来减肥,可以选择低度到中度的运动强度,同时延长运动时间,这种方法消耗的热量更多。运动频率每周3—5次,每次20—60分钟。想要锻炼肌肉,可以练举重、做体操以及其他重复伸、屈肌肉的运动。肌肉锻炼可以燃烧热量、增强骨密度、减少受伤,尤其是关节受伤的几率,还能预防骨质疏松。https://m.qb5200.com/在做举重运动前,先测一下,如果连续举8次你最多能举多重的东西,就从这个重量开始练习。当你可以连续12次举起这个重量时,试试增加5%的重量。注意每次练习时,要连续举8—12次,这样可以达到肌肉最大耐力的70%—80%,锻炼效果较好。每周2—3次,但要避免连续两天锻炼同一组肌肉群,https://m.qb5200.com/以便让肌肉有充分的恢复时间。"; https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/Stringhttps://m.qb5200.com/shortContenthttps://m.qb5200.com/=https://m.qb5200.com/"-->健身是一种体育项目,如各种徒手健美操、韵律操、形体操以及各种自抗力动作。"; https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/forhttps://m.qb5200.com/(inthttps://m.qb5200.com/ihttps://m.qb5200.com/=https://m.qb5200.com/0;https://m.qb5200.com/ihttps://m.qb5200.com/<https://m.qb5200.com/20;https://m.qb5200.com/i++)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/ExpandFoldTextBeanhttps://m.qb5200.com/beanhttps://m.qb5200.com/=https://m.qb5200.com/newhttps://m.qb5200.com/ExpandFoldTextBean(); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/ifhttps://m.qb5200.com/(ihttps://m.qb5200.com/%https://m.qb5200.com/2https://m.qb5200.com/==https://m.qb5200.com/0)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/bean.setContent(ihttps://m.qb5200.com/+https://m.qb5200.com/shortContent); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/bean.setId(i); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/}https://m.qb5200.com/elsehttps://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/bean.setContent(ihttps://m.qb5200.com/+https://m.qb5200.com/longContent); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/bean.setId(i); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/mList.add(bean); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/} }

ExpandFoldTextAdapter.java

packagehttps://m.qb5200.com/com.wildma.wildmaexpandfoldtext; importhttps://m.qb5200.com/android.app.Activity; importhttps://m.qb5200.com/android.support.v7.widget.RecyclerView; importhttps://m.qb5200.com/android.util.SparseArray; importhttps://m.qb5200.com/android.view.View; importhttps://m.qb5200.com/android.view.ViewGroup; importhttps://m.qb5200.com/android.view.ViewTreeObserver; importhttps://m.qb5200.com/android.widget.TextView; importhttps://m.qb5200.com/java.util.List; /** https://m.qb5200.com/*https://m.qb5200.com/Authorhttps://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/wildma https://m.qb5200.com/*https://m.qb5200.com/DATEhttps://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/2017/8/3 https://m.qb5200.com/*https://m.qb5200.com/Deshttps://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/${展开折叠文本适配器} https://m.qb5200.com/*/ publichttps://m.qb5200.com/classhttps://m.qb5200.com/ExpandFoldTextAdapterhttps://m.qb5200.com/extendshttps://m.qb5200.com/RecyclerView.Adapter<ExpandFoldTextAdapter.MyViewHolder>https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/privatehttps://m.qb5200.com/Activityhttps://m.qb5200.com/mContent; https://m.qb5200.com/https://m.qb5200.com/privatehttps://m.qb5200.com/finalhttps://m.qb5200.com/inthttps://m.qb5200.com/MAX_LINE_COUNThttps://m.qb5200.com/=https://m.qb5200.com/3;//最大显示行数 https://m.qb5200.com/https://m.qb5200.com/privatehttps://m.qb5200.com/finalhttps://m.qb5200.com/inthttps://m.qb5200.com/STATE_UNKNOWhttps://m.qb5200.com/=https://m.qb5200.com/-1;//未知状态 https://m.qb5200.com/https://m.qb5200.com/privatehttps://m.qb5200.com/finalhttps://m.qb5200.com/inthttps://m.qb5200.com/STATE_NOT_OVERFLOWhttps://m.qb5200.com/=https://m.qb5200.com/1;//文本行数小于最大可显示行数 https://m.qb5200.com/https://m.qb5200.com/privatehttps://m.qb5200.com/finalhttps://m.qb5200.com/inthttps://m.qb5200.com/STATE_COLLAPSEDhttps://m.qb5200.com/=https://m.qb5200.com/2;//折叠状态 https://m.qb5200.com/https://m.qb5200.com/privatehttps://m.qb5200.com/finalhttps://m.qb5200.com/inthttps://m.qb5200.com/STATE_EXPANDEDhttps://m.qb5200.com/=https://m.qb5200.com/3;//展开状态 https://m.qb5200.com/https://m.qb5200.com//** https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/*https://m.qb5200.com/注意:保存文本状态集合的key一定要是唯一的,如果用position。 https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/*https://m.qb5200.com/如果使用position作为key,则删除、增加条目的时候会出现显示错乱 https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/*/ https://m.qb5200.com/https://m.qb5200.com/privatehttps://m.qb5200.com/SparseArray<Integer>https://m.qb5200.com/mTextStateList;//保存文本状态集合 https://m.qb5200.com/https://m.qb5200.com/List<ExpandFoldTextBean>https://m.qb5200.com/mList; https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/ExpandFoldTextAdapter(List<ExpandFoldTextBean>https://m.qb5200.com/list,https://m.qb5200.com/Activityhttps://m.qb5200.com/context)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/mContenthttps://m.qb5200.com/=https://m.qb5200.com/context; https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/this.mListhttps://m.qb5200.com/=https://m.qb5200.com/list; https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/mTextStateListhttps://m.qb5200.com/=https://m.qb5200.com/newhttps://m.qb5200.com/SparseArray<>(); https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/@Override https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/MyViewHolderhttps://m.qb5200.com/onCreateViewHolder(ViewGrouphttps://m.qb5200.com/parent,https://m.qb5200.com/inthttps://m.qb5200.com/viewType)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/returnhttps://m.qb5200.com/newhttps://m.qb5200.com/MyViewHolder(mContent.getLayoutInflater().inflate(R.layout.item_expand_fold_text,https://m.qb5200.com/parent,https://m.qb5200.com/false)); https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/@Override https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/voidhttps://m.qb5200.com/onBindViewHolder(finalhttps://m.qb5200.com/MyViewHolderhttps://m.qb5200.com/holder,https://m.qb5200.com/finalhttps://m.qb5200.com/inthttps://m.qb5200.com/position)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/inthttps://m.qb5200.com/statehttps://m.qb5200.com/=https://m.qb5200.com/mTextStateList.get(mList.get(position).getId(),https://m.qb5200.com/STATE_UNKNOW); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com///第一次初始化,未知状态 https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/ifhttps://m.qb5200.com/(statehttps://m.qb5200.com/==https://m.qb5200.com/STATE_UNKNOW)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.content.getViewTreeObserver().addOnPreDrawListener(newhttps://m.qb5200.com/ViewTreeObserver.OnPreDrawListener()https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/@Override https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/booleanhttps://m.qb5200.com/onPreDraw()https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com///这个回掉会调用多次,获取完行数后记得注销监听 https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.content.getViewTreeObserver().removeOnPreDrawListener(this); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com///holder.content.getViewTreeObserver().addOnPreDrawListener(null); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com///如果内容显示的行数大于最大显示行数 https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/ifhttps://m.qb5200.com/(holder.content.getLineCount()https://m.qb5200.com/>https://m.qb5200.com/MAX_LINE_COUNT)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.content.setMaxLines(MAX_LINE_COUNT);//设置最大显示行数 https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.expandOrFold.setVisibility(View.VISIBLE);//显示“全文” https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.expandOrFold.setText("全文"); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/mTextStateList.put(mList.get(position).getId(),https://m.qb5200.com/STATE_COLLAPSED);//保存状态 https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/}https://m.qb5200.com/elsehttps://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.expandOrFold.setVisibility(View.GONE); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/mTextStateList.put(mList.get(position).getId(),https://m.qb5200.com/STATE_NOT_OVERFLOW); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/returnhttps://m.qb5200.com/true; https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/}); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.content.setMaxLines(Integer.MAX_VALUE);//设置文本的最大行数,为整数的最大数值 https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.content.setText(mList.get(position).getContent()); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/}https://m.qb5200.com/elsehttps://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com///如果之前已经初始化过了,则使用保存的状态。 https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/switchhttps://m.qb5200.com/(state)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/casehttps://m.qb5200.com/STATE_NOT_OVERFLOW: https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.expandOrFold.setVisibility(View.GONE); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/break; https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/casehttps://m.qb5200.com/STATE_COLLAPSED: https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.content.setMaxLines(MAX_LINE_COUNT); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.expandOrFold.setVisibility(View.VISIBLE); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.expandOrFold.setText("全文"); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/break; https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/casehttps://m.qb5200.com/STATE_EXPANDED: https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.content.setMaxLines(Integer.MAX_VALUE); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.expandOrFold.setVisibility(View.VISIBLE); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.expandOrFold.setText("收起"); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/break; https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.content.setText(mList.get(position).getContent()); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com///全文和收起的点击事件 https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.expandOrFold.setOnClickListener(newhttps://m.qb5200.com/View.OnClickListener()https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/@Override https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/voidhttps://m.qb5200.com/onClick(Viewhttps://m.qb5200.com/v)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/inthttps://m.qb5200.com/statehttps://m.qb5200.com/=https://m.qb5200.com/mTextStateList.get(mList.get(position).getId(),https://m.qb5200.com/STATE_UNKNOW); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/ifhttps://m.qb5200.com/(statehttps://m.qb5200.com/==https://m.qb5200.com/STATE_COLLAPSED)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.content.setMaxLines(Integer.MAX_VALUE); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.expandOrFold.setText("收起"); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/mTextStateList.put(mList.get(position).getId(),https://m.qb5200.com/STATE_EXPANDED); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/}https://m.qb5200.com/elsehttps://m.qb5200.com/ifhttps://m.qb5200.com/(statehttps://m.qb5200.com/==https://m.qb5200.com/STATE_EXPANDED)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.content.setMaxLines(MAX_LINE_COUNT); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.expandOrFold.setText("全文"); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/mTextStateList.put(mList.get(position).getId(),https://m.qb5200.com/STATE_COLLAPSED); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/}); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com///删除点击事件 https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/holder.delete.setOnClickListener(newhttps://m.qb5200.com/View.OnClickListener()https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/@Override https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/voidhttps://m.qb5200.com/onClick(Viewhttps://m.qb5200.com/view)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/mList.remove(position); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/notifyDataSetChanged(); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/}); https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/@Override https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/inthttps://m.qb5200.com/getItemCount()https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/returnhttps://m.qb5200.com/mList.size(); https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/classhttps://m.qb5200.com/MyViewHolderhttps://m.qb5200.com/extendshttps://m.qb5200.com/RecyclerView.ViewHolderhttps://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/TextViewhttps://m.qb5200.com/nickname; https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/TextViewhttps://m.qb5200.com/content; https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/TextViewhttps://m.qb5200.com/delete; https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/TextViewhttps://m.qb5200.com/expandOrFold; https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/MyViewHolder(Viewhttps://m.qb5200.com/itemView)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/super(itemView); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/nicknamehttps://m.qb5200.com/=https://m.qb5200.com/(TextView)https://m.qb5200.com/itemView.findViewById(R.id.tv_nickname); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/contenthttps://m.qb5200.com/=https://m.qb5200.com/(TextView)https://m.qb5200.com/itemView.findViewById(R.id.tv_content); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/deletehttps://m.qb5200.com/=https://m.qb5200.com/(TextView)https://m.qb5200.com/itemView.findViewById(R.id.tv_delete); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/expandOrFoldhttps://m.qb5200.com/=https://m.qb5200.com/(TextView)https://m.qb5200.com/itemView.findViewById(R.id.tv_expand_or_fold); https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/} }

ExpandFoldTextBean.java

packagehttps://m.qb5200.com/com.wildma.wildmaexpandfoldtext; /** https://m.qb5200.com/*https://m.qb5200.com/Authorhttps://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/wildma https://m.qb5200.com/*https://m.qb5200.com/DATEhttps://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/2017/8/3 https://m.qb5200.com/*https://m.qb5200.com/Deshttps://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/${TODO} https://m.qb5200.com/*/ publichttps://m.qb5200.com/classhttps://m.qb5200.com/ExpandFoldTextBeanhttps://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/privatehttps://m.qb5200.com/Stringhttps://m.qb5200.com/content;//内容 https://m.qb5200.com/https://m.qb5200.com/privatehttps://m.qb5200.com/inthttps://m.qb5200.com/id;//该条数据的id https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/Stringhttps://m.qb5200.com/getContent()https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/returnhttps://m.qb5200.com/content; https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/voidhttps://m.qb5200.com/setContent(Stringhttps://m.qb5200.com/content)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/this.contenthttps://m.qb5200.com/=https://m.qb5200.com/content; https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/inthttps://m.qb5200.com/getId()https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/returnhttps://m.qb5200.com/id; https://m.qb5200.com/https://m.qb5200.com/} https://m.qb5200.com/https://m.qb5200.com/publichttps://m.qb5200.com/voidhttps://m.qb5200.com/setId(inthttps://m.qb5200.com/id)https://m.qb5200.com/{ https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/this.idhttps://m.qb5200.com/=https://m.qb5200.com/id; https://m.qb5200.com/https://m.qb5200.com/} }

activity_main.xml

<?xmlhttps://m.qb5200.com/version="1.0"https://m.qb5200.com/encoding="utf-8"?> <RelativeLayout https://m.qb5200.com/https://m.qb5200.com/android:id="@+id/activity_main" https://m.qb5200.com/https://m.qb5200.com/xmlns:android="http://schemas.android.com/apk/res/android" https://m.qb5200.com/https://m.qb5200.com/android:layout_width="match_parent" https://m.qb5200.com/https://m.qb5200.com/android:layout_height="match_parent" https://m.qb5200.com/https://m.qb5200.com/android:paddingBottom="@dimen/activity_vertical_margin" https://m.qb5200.com/https://m.qb5200.com/android:paddingLeft="@dimen/activity_horizontal_margin" https://m.qb5200.com/https://m.qb5200.com/android:paddingRight="@dimen/activity_horizontal_margin" https://m.qb5200.com/https://m.qb5200.com/android:paddingTop="@dimen/activity_vertical_margin"> https://m.qb5200.com/https://m.qb5200.com/<android.support.v7.widget.RecyclerView https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:id="@+id/recyclerview" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_width="match_parent" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_height="match_parent"> https://m.qb5200.com/https://m.qb5200.com/</android.support.v7.widget.RecyclerView> </RelativeLayout>

item_expand_fold_text.xml

<?xmlhttps://m.qb5200.com/version="1.0"https://m.qb5200.com/encoding="utf-8"?> <LinearLayouthttps://m.qb5200.com/xmlns:android="http://schemas.android.com/apk/res/android" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_width="match_parent" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_height="wrap_content" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:orientation="vertical" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:paddingBottom="@dimen/activity_vertical_margin" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:paddingLeft="@dimen/activity_horizontal_margin" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:paddingRight="@dimen/activity_horizontal_margin" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:paddingTop="@dimen/activity_vertical_margin"> https://m.qb5200.com/https://m.qb5200.com/<LinearLayout https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_width="match_parent" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_height="wrap_content" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_gravity="center_vertical" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:orientation="horizontal"> https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/<ImageView https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_width="40dp" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_height="40dp" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_marginRight="16dp" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:gravity="center" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:scaleType="centerCrop" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:src="@mipmap/ic_launcher"/> https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/<RelativeLayout https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_width="match_parent" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_height="wrap_content"> https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/<TextView https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:id="@+id/tv_nickname" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_width="wrap_content" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_height="wrap_content" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:text="wildma" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:textColor="@android:color/black" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:textSize="14sp"/> https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/<TextView https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:id="@+id/tv_delete" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_width="wrap_content" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_height="wrap_content" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_alignParentRight="true" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_marginLeft="12dp" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:paddingLeft="5dp" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:paddingRight="5dp" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:text="删除" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:textColor="@android:color/holo_red_dark" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:textSize="14sp"/> https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/</RelativeLayout> https://m.qb5200.com/https://m.qb5200.com/</LinearLayout> https://m.qb5200.com/https://m.qb5200.com/<LinearLayout https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_width="match_parent" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_height="wrap_content" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_marginLeft="56dp" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:orientation="vertical" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:paddingBottom="8dp"> https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/<TextView https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:id="@+id/tv_content" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_width="wrap_content" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_height="wrap_content" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_marginBottom="8dp" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:alpha="0.85" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:ellipsize="end" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:text="内容" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:textColor="@android:color/black" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:textSize="14sp"/> https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/<TextView https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:id="@+id/tv_expand_or_fold" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_width="wrap_content" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_height="wrap_content" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:text="全文" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:textColor="@color/colorPrimaryDark" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:textSize="14sp"/> https://m.qb5200.com/https://m.qb5200.com/</LinearLayout> https://m.qb5200.com/https://m.qb5200.com/<View https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_width="match_parent" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:layout_height="0.5dp" https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/https://m.qb5200.com/android:background="@android:color/black"/> </LinearLayout>

源码地址:https://github.com/wildma/WildmaExpandFoldText

加载全部内容

相关教程
猜你喜欢
用户评论