Commit b9f4fdbc authored by mengcuiguang's avatar mengcuiguang

代码优化

parent c396c906
......@@ -80,6 +80,8 @@ class TaskActivity : BaseActivity(), OnItemClickListener, OnRefreshListener, Cor
mCoralDownload = CoralDownload(CoralDownload.RELEASE_TASK_TYPE).setOnAdLoadListener(this)
CacheUtil.clearAllCache(context)
initView()
initListener()
......@@ -116,7 +118,7 @@ class TaskActivity : BaseActivity(), OnItemClickListener, OnRefreshListener, Cor
private fun refreshDemoTask() {
mTaskAdapter?.let {
val position = it.getPosition()
if (mFakeTaskList.size == 0 || tryTimeOut || mFakeTaskList[position].state == 3) return
if (mFakeTaskList.size == 0 || mFakeTaskList[position].state == 3) return
val currentPkgName = mFakeTaskList[position].currentPkgName
......@@ -130,8 +132,11 @@ class TaskActivity : BaseActivity(), OnItemClickListener, OnRefreshListener, Cor
mDownloadProcess?.reportAppActivated()
} else {
if (AppTryPlayManager.getTryPlayIsOK(currentPkgName, 5)) {
tryTimeOut = true
// 试玩时间不足
if (tryTimeOut) {
return
}
tryTimeOut = true
mFakeTaskList[position].state = 4
it.notifyItemChanged(it.getPosition())
......@@ -207,7 +212,6 @@ class TaskActivity : BaseActivity(), OnItemClickListener, OnRefreshListener, Cor
mCoralDownload?.destroy()
mDownloadProcess = null
DownloadApkManager.destroy()
CacheUtil.clearAllCache(context)
if (mReceiverBroadcastReceiver != null) {
mContext.stopService(Intent(context, AppInstallService::class.java))
mContext.unregisterReceiver(mReceiverBroadcastReceiver)
......
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