Commit 15b989a1 authored by jyx's avatar jyx

添加空页面

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