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