Commit 15b989a1 authored by jyx's avatar jyx

添加空页面

parent b9f4fdbc
......@@ -119,7 +119,6 @@ class TaskActivity : BaseActivity(), OnItemClickListener, OnRefreshListener, Cor
mTaskAdapter?.let {
val position = it.getPosition()
if (mFakeTaskList.size == 0 || mFakeTaskList[position].state == 3) return
val currentPkgName = mFakeTaskList[position].currentPkgName
if (currentPkgName != null) {
......@@ -165,6 +164,7 @@ class TaskActivity : BaseActivity(), OnItemClickListener, OnRefreshListener, Cor
}
private fun clickDialog(position: Int) {
taskDialog = TaskDialog(this)
taskDialog?.setData(mTaskList[position], needUseTime, mCoin)
taskDialog?.show()
......@@ -175,6 +175,7 @@ class TaskActivity : BaseActivity(), OnItemClickListener, OnRefreshListener, Cor
}
override fun onLoadSuccess(dataList: MutableList<CoralAD>?) {
iv_empty.visibility = View.GONE
hideLoading()
srl_task.finishRefresh()
......@@ -191,6 +192,7 @@ class TaskActivity : BaseActivity(), OnItemClickListener, OnRefreshListener, Cor
}
override fun onLoadFail() {
iv_empty.visibility = View.VISIBLE
showToast("加载失败,请下拉刷新重试")
hideLoading()
......@@ -262,7 +264,7 @@ class TaskActivity : BaseActivity(), OnItemClickListener, OnRefreshListener, Cor
override fun onItemChildClick(view: View?, position: Int) {
when (mFakeTaskList[position].state) {
// 0 立即下载, 1 去试玩, 2 领取奖励
// 0 立即下载, 1 去试玩, 2 领取奖励 3 已领取 4 继续试玩
0 -> {
tryTimeOut = false
if (AppUtil.isOpenUsageStats()) {
......
......@@ -19,10 +19,24 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recy_task"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/iv_empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@mipmap/ic_record_empty"
android:visibility="gone" />
</FrameLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
\ 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