Compare commits
1 Commits
edaf6cb79d
...
3b383d3d24
Author | SHA1 | Date | |
---|---|---|---|
3b383d3d24 |
@ -12,6 +12,7 @@ import androidx.recyclerview.widget.RecyclerView
|
||||
import bou.amine.apps.readerforselfossv2.android.R
|
||||
import bou.amine.apps.readerforselfossv2.android.UpsertSourceActivity
|
||||
import bou.amine.apps.readerforselfossv2.android.databinding.SourceListItemBinding
|
||||
import bou.amine.apps.readerforselfossv2.android.testing.CountingIdlingResourceSingleton
|
||||
import bou.amine.apps.readerforselfossv2.android.utils.glide.circularDrawable
|
||||
import bou.amine.apps.readerforselfossv2.model.SelfossModel
|
||||
import bou.amine.apps.readerforselfossv2.repository.Repository
|
||||
@ -104,8 +105,10 @@ class SourcesListAdapter(
|
||||
source: SelfossModel.SourceDetail,
|
||||
position: Int,
|
||||
) {
|
||||
CountingIdlingResourceSingleton.increment()
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
val successfullyDeletedSource = repository.deleteSource(source.id, source.title)
|
||||
CountingIdlingResourceSingleton.increment()
|
||||
launch(Dispatchers.Main) {
|
||||
if (successfullyDeletedSource) {
|
||||
items.removeAt(position)
|
||||
@ -119,7 +122,9 @@ class SourcesListAdapter(
|
||||
Toast.LENGTH_SHORT,
|
||||
).show()
|
||||
}
|
||||
CountingIdlingResourceSingleton.decrement()
|
||||
}
|
||||
CountingIdlingResourceSingleton.decrement()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user