fix: 修复主页签到提示异常出现
This commit is contained in:
parent
db7cda174e
commit
e3668c1b8d
|
|
@ -4,6 +4,7 @@ import android.content.Context
|
|||
import android.util.Log
|
||||
import android.view.ViewGroup
|
||||
import androidx.work.Data
|
||||
import androidx.work.hasKeyWithValueOfType
|
||||
import com.alibaba.android.vlayout.DelegateAdapter
|
||||
import com.alibaba.android.vlayout.LayoutHelper
|
||||
import com.alibaba.android.vlayout.layout.SingleLayoutHelper
|
||||
|
|
@ -42,7 +43,7 @@ class OKSignProgressAdapter(
|
|||
override fun onBindViewHolder(holder: MyViewHolder, position: Int) {
|
||||
Log.i("OKSignProgressAdapter", "${holder.itemView}")
|
||||
data.let {
|
||||
if (it == null || closed) {
|
||||
if (it == null || !it.hasKeyWithValueOfType<Boolean>(DATA_SUCCESS) || closed) {
|
||||
holder.setVisibility(R.id.oksign_progress, false)
|
||||
return@let
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,9 +198,14 @@ class MainForumListFragment : BaseFragment(), Refreshable, Toolbar.OnMenuItemCli
|
|||
appPreferences.oksignWorkId = id.toString()
|
||||
okSignProgressAdapter.data = null
|
||||
okSignProgressAdapter.closed = false
|
||||
} else {
|
||||
okSignProgressData = workInfo.progress
|
||||
}
|
||||
val progressData = workInfo.progress
|
||||
okSignProgressData =
|
||||
if (progressData.hasKeyWithValueOfType<Boolean>(DATA_SUCCESS)) {
|
||||
progressData
|
||||
} else {
|
||||
null
|
||||
}
|
||||
val workInfoLiveData =
|
||||
WorkManager.getInstance(attachContext).getWorkInfoByIdLiveData(id)
|
||||
workInfoLiveData.observe(viewLifecycleOwner) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue