Android评论功能

Android评论功能

最近有个评论功能的需求,便学习了下,做个demo练练手,话说这也开启了我自定义view学习的旅途了吧,ok,先看下效果图吧

点击回复展开/收起回复列表


代码实现

整个项目的结构图大家先看下,文尾附源码链接
这里写图片描述

布局文件xml

这个主要是用到自定义view知识,其中评论,回复分别是一个自定义view,布局都差不多,评论的xml代码如下:

<LinearLayout               xmlns:android="http://schemas.android.com/apk/res/android"      xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
    >
 <LinearLayout
    android:id="@+id/ll_comment_item"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    >
 <com.example.studycommentdemo.testcommentdemo.CircleImageView
        android:id="@+id/iv_avater"
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:src="@mipmap/touxiang"
        app:civ_border_color="#FFEEEEEE"
        app:civ_border_width="1dp" />
    <LinearLayout
        android:layout_wid
  • 3
    点赞
  • 70
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值