You should be able to use itemView.setEnabled(false)
to disable the clicks, then call setEnabled(true)
to re-enable the clicks.
For Kotlin I believe its itemView.isEnabled = {false | true}
Make sure these calls occur on the UI thread. Example using your comment:
private fun updateUsersJobs()
{
swipeContainer?.isRefreshing = true
itemView.isEnabled = false
model?.updateUsersJobs(this,
{
activity?.runOnUiThread
{
swipeContainer?.isRefreshing = false
itemView.isEnabled = true
}
},
{ error -> activity?.runOnUiThread
{
swipeContainer?.isRefreshing = false
itemView.isEnabled = true
}
};
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…