Commit 02f43bf2 by fengquan

feat: 倾诉列表添加空白页

parent 8c41ac44
...@@ -524,6 +524,11 @@ class ConfideHomeActivity : ...@@ -524,6 +524,11 @@ class ConfideHomeActivity :
if (null != soundBean) { if (null != soundBean) {
(cacheList as ArrayList).add(soundBean) (cacheList as ArrayList).add(soundBean)
} }
if (bean?.body != null && bean?.body.size == 0) {
cacheList?.add(ConfideHomeDataBean(IConfideHomeConfig.TYPE_EMPTY,null,null,null, -1))
}
listScrollListener?.moveToPosition(rv_list) listScrollListener?.moveToPosition(rv_list)
} }
......
...@@ -148,6 +148,11 @@ class ConfideHomeAdapter( ...@@ -148,6 +148,11 @@ class ConfideHomeAdapter(
) )
} }
//空白页
IConfideHomeConfig.TYPE_EMPTY -> {
return EmptyView(LayoutInflater.from(mContext).inflate(R.layout.confide_empty_layout, parent,false))
}
// //听声寻人 // //听声寻人
// IConfideHomeConfig.TYPE_SOUND -> { // IConfideHomeConfig.TYPE_SOUND -> {
//// return ConfideHomeListenAndFoundViewHolder(ConfideHomeListenAndFoundView(parent.context, confideHomeEvent)) //// return ConfideHomeListenAndFoundViewHolder(ConfideHomeListenAndFoundView(parent.context, confideHomeEvent))
...@@ -249,6 +254,9 @@ class ConfideHomeAdapter( ...@@ -249,6 +254,9 @@ class ConfideHomeAdapter(
*/ */
inner class SearchViewHolder(var searchView: View) : RecyclerView.ViewHolder(searchView) inner class SearchViewHolder(var searchView: View) : RecyclerView.ViewHolder(searchView)
inner class EmptyView(var emptyView: View): RecyclerView.ViewHolder(emptyView)
/** /**
* 听声寻人 viewHolder * 听声寻人 viewHolder
*/ */
......
...@@ -21,6 +21,7 @@ interface IConfideHomeConfig{ ...@@ -21,6 +21,7 @@ interface IConfideHomeConfig{
const val TYPE_SOUND = 6 const val TYPE_SOUND = 6
const val TYPE_VIDEO_SHOW = 7 const val TYPE_VIDEO_SHOW = 7
const val TYPE_SEARCH = 8 const val TYPE_SEARCH = 8
const val TYPE_EMPTY = 9
const val TYPE_FOOTER = 999 const val TYPE_FOOTER = 999
/** /**
* section id. 与上面相对应 * section id. 与上面相对应
...@@ -33,6 +34,7 @@ interface IConfideHomeConfig{ ...@@ -33,6 +34,7 @@ interface IConfideHomeConfig{
const val SECTION_SOUND = 10006 const val SECTION_SOUND = 10006
const val SECTION_CONSULTANT = 10007 const val SECTION_CONSULTANT = 10007
const val SECTION_SEARCH = 10008 const val SECTION_SEARCH = 10008
const val SECTION_EMPTY = 10009
const val SECTION_FOOTER = 19999 const val SECTION_FOOTER = 19999
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/empty_rl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
>
<View
android:layout_width="1dp"
android:layout_height="0dp"
android:layout_weight="2" />
<ImageView
android:id="@+id/empty_img"
android:layout_width="180dp"
android:layout_height="120dp"
android:src="@drawable/platform_ydl_net_loss" />
<TextView
android:id="@+id/hint_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_35"
android:text="没有搜到相关信息,换个关键词看看吧"
android:textColor="@color/platform_color_999999"
android:textSize="14dp" />
<View
android:layout_width="1dp"
android:layout_height="0dp"
android:layout_weight="10" />
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment