Commit 9bbc8c17 authored by chengkun's avatar chengkun

增加空视图

parent a75d4f61
...@@ -2,6 +2,7 @@ package com.yidian.shenghuoquan.buserorder.ui ...@@ -2,6 +2,7 @@ package com.yidian.shenghuoquan.buserorder.ui
import android.graphics.Typeface import android.graphics.Typeface
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.view.View
import androidx.activity.viewModels import androidx.activity.viewModels
import com.scwang.smart.refresh.layout.api.RefreshLayout import com.scwang.smart.refresh.layout.api.RefreshLayout
import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener
...@@ -52,8 +53,11 @@ class OrderListActivity : BaseMvvmActivity<BorderActivityOrderListBinding, Order ...@@ -52,8 +53,11 @@ class OrderListActivity : BaseMvvmActivity<BorderActivityOrderListBinding, Order
binding.smartRefresh.finishLoadMore() binding.smartRefresh.finishLoadMore()
} }
listAdapter.setList(it) listAdapter.setList(it)
var oldPos = listAdapter.itemCount if (listAdapter.itemCount == 0) {
setRecyclePos(oldPos) binding.orderlistEmptyView.visibility = View.VISIBLE
} else {
binding.orderlistEmptyView.visibility = View.GONE
}
}) })
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
name="vm" name="vm"
type="com.yidian.shenghuoquan.buserorder.viewmodel.OrderListViewModel" /> type="com.yidian.shenghuoquan.buserorder.viewmodel.OrderListViewModel" />
</data> </data>
<LinearLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
...@@ -34,10 +34,12 @@ ...@@ -34,10 +34,12 @@
tools:text="标题" /> tools:text="标题" />
</androidx.appcompat.widget.Toolbar> </androidx.appcompat.widget.Toolbar>
<LinearLayout <LinearLayout
android:id="@+id/ll_all_refund"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp44" android:layout_height="@dimen/dp44"
android:layout_marginTop="@dimen/dp2" android:layout_marginTop="@dimen/dp2"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_below="@+id/order_list_toolbar"
> >
<TextView <TextView
android:id="@+id/tv_orderlist_all" android:id="@+id/tv_orderlist_all"
...@@ -62,21 +64,28 @@ ...@@ -62,21 +64,28 @@
android:layout_gravity="center_vertical"> android:layout_gravity="center_vertical">
</TextView> </TextView>
</LinearLayout> </LinearLayout>
<com.scwang.smart.refresh.layout.SmartRefreshLayout <com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/smart_refresh" android:id="@+id/smart_refresh"
android:layout_width="@dimen/dp343" android:layout_width="@dimen/dp343"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center_horizontal"> android:layout_below="@+id/ll_all_refund"
android:layout_centerHorizontal="true">
<com.scwang.smart.refresh.header.ClassicsHeader <com.scwang.smart.refresh.header.ClassicsHeader
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
</com.scwang.smart.refresh.header.ClassicsHeader> </com.scwang.smart.refresh.header.ClassicsHeader>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rcv_order_list" android:id="@+id/rcv_order_list"
android:layout_width="343dp" android:layout_width="343dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"> app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager">
</androidx.recyclerview.widget.RecyclerView> </androidx.recyclerview.widget.RecyclerView>
<com.scwang.smart.refresh.footer.ClassicsFooter <com.scwang.smart.refresh.footer.ClassicsFooter
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp"> android:layout_height="0dp">
...@@ -84,5 +93,13 @@ ...@@ -84,5 +93,13 @@
</com.scwang.smart.refresh.footer.ClassicsFooter> </com.scwang.smart.refresh.footer.ClassicsFooter>
</com.scwang.smart.refresh.layout.SmartRefreshLayout> </com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout> <com.yidian.bcommon.widget.CommonEmptyPageView
android:id="@+id/orderlist_empty_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
app:CommonEmptyPageView_empty_tips_text="这里什么都没有"
app:CommonEmptyPageView_place_holder_img="@drawable/bcommon_icon_nothing_place_holder"
android:layout_centerInParent="true"/>
</RelativeLayout>
</layout> </layout>
\ 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