本文实例为大家分享了Android实现朋友圈评论回复列表的具体代码,供大家参考,具体内容如下
Android实现朋友圈评论回复列表
Android实现朋友圈点赞列表
Android实现朋友圈多图显示功能
<强>正文强>
还是老流程,先来看一下效果图:
<>强然后是主要实现代码:强>
CommentsView
公开课CommentsView LinearLayout{延伸 私人上下文mContext; 私人ListmDatas; 私人> 公开课CircleMovementMethod延伸BaseMovementMethod { 私人最终静态int DEFAULT_COLOR_ID=android.R.color.transparent;/* * *整个textView的背景色 */私人int textViewBgColor;/* * *点击部分文字时部分文字的背景色 */私人int clickableSpanBgClor; 私人BackgroundColorSpan mBgSpan; 私人ClickableSpan [] mClickLinks;/* * * @param clickableSpanBgClor点击选中部分时的背景色 */公共CircleMovementMethod (int clickableSpanBgClor) { 这一点。clickableSpanBgClor=clickableSpanBgClor; }/* * * @param clickableSpanBgClor点击选中部分时的背景色 * @param textViewBgColor整个textView点击时的背景色 */公共CircleMovementMethod (int clickableSpanBgClor int textViewBgColor) { 这一点。textViewBgColor=textViewBgColor; 这一点。clickableSpanBgClor=clickableSpanBgClor; } 公共布尔> 公共类CommentsBean实现Serializable { 私人int commentsId; 私人字符串内容; 私人出发replyUser;//回复人信息 私人出发commentsUser;//评论人信息 公共int getCommentsId () { 返回commentsId; } 公共空间setCommentsId (int commentsId) { this.commentsId=commentsId; } 公共字符串getContent () { 返回内容; } 公共空间setContent(字符串内容){ 这一点。内容=内容; } 公共出发getReplyUser () { 返回replyUser; } 公共空间setReplyUser(出发replyUser) { 这一点。replyUser=replyUser; } 公共出发getCommentsUser () { 返回commentsUser; } 公共空间setCommentsUser(出发commentsUser) { this.commentsUser=commentsUser; } } >之前 出发
公共类出发实现Serializable { 私人int标识; 私人字符串的用户名; 公共int getUserId () { 返回标识; } 公共空间setUserId (int userId) { 这一点。用户id=标识; } 公共字符串getUserName () { 返回用户名; } 公共空间setUserName(字符串的用户名){ 这一点。用户名=用户名; } } >之前<强>用法强>
& lt; com.lvfq.myworkingtest.dynamic.view.CommentsView android: id=癅 + id/commentView” android: layout_width=" match_parent " android: layout_height=" wrap_content " android: layout_margin=癅dimen/dp_20”/比; commentView=LvV。找到(这个,R.id.commentView); commentView.setList (Data.getComments ()); commentView。setOnItemClickListener(新CommentsView.onItemClickListener () { @Override 公共空间onItemClick (int位置,CommentsBean bean) { } }); commentView.notifyDataSetChanged (); >之前代码已整理到Github
附:如果需要完整朋友圈项目的话,这里推荐一个Github项目仿微信实现的朋友圈
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
Android实现朋友圈评论回复列表