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.R
|
||||||
import bou.amine.apps.readerforselfossv2.android.UpsertSourceActivity
|
import bou.amine.apps.readerforselfossv2.android.UpsertSourceActivity
|
||||||
import bou.amine.apps.readerforselfossv2.android.databinding.SourceListItemBinding
|
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.android.utils.glide.circularDrawable
|
||||||
import bou.amine.apps.readerforselfossv2.model.SelfossModel
|
import bou.amine.apps.readerforselfossv2.model.SelfossModel
|
||||||
import bou.amine.apps.readerforselfossv2.repository.Repository
|
import bou.amine.apps.readerforselfossv2.repository.Repository
|
||||||
@ -104,8 +105,10 @@ class SourcesListAdapter(
|
|||||||
source: SelfossModel.SourceDetail,
|
source: SelfossModel.SourceDetail,
|
||||||
position: Int,
|
position: Int,
|
||||||
) {
|
) {
|
||||||
|
CountingIdlingResourceSingleton.increment()
|
||||||
CoroutineScope(Dispatchers.IO).launch {
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
val successfullyDeletedSource = repository.deleteSource(source.id, source.title)
|
val successfullyDeletedSource = repository.deleteSource(source.id, source.title)
|
||||||
|
CountingIdlingResourceSingleton.increment()
|
||||||
launch(Dispatchers.Main) {
|
launch(Dispatchers.Main) {
|
||||||
if (successfullyDeletedSource) {
|
if (successfullyDeletedSource) {
|
||||||
items.removeAt(position)
|
items.removeAt(position)
|
||||||
@ -119,7 +122,9 @@ class SourcesListAdapter(
|
|||||||
Toast.LENGTH_SHORT,
|
Toast.LENGTH_SHORT,
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
|
CountingIdlingResourceSingleton.decrement()
|
||||||
}
|
}
|
||||||
|
CountingIdlingResourceSingleton.decrement()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user