Make items read by swiping disappear

This commit is contained in:
davide 2022-08-13 17:48:13 +02:00
parent 8c5f4268a4
commit 5377e6c0f8
2 changed files with 9 additions and 10 deletions

View File

@ -80,17 +80,14 @@ abstract class ItemsAdapter<VH : RecyclerView.ViewHolder?> : RecyclerView.Adapte
val i = items[position]
CoroutineScope(Dispatchers.IO).launch {
repository.markAsRead(i.id)
// TODO: update db
}
// Todo:
// if (SharedItems.displayedItems == "unread") {
// items.remove(i)
// notifyItemRemoved(position)
// updateItems(items)
// } else {
// notifyItemChanged(position)
// }
if (repository.displayedItems == "unread") {
items.remove(i)
notifyItemRemoved(position)
updateItems(items)
} else {
notifyItemChanged(position)
}
if (showSnackbar) {
unmarkSnackbar(i, position)
}

View File

@ -300,4 +300,6 @@ class RepositoryImpl(private val api: SelfossApi, private val apiDetails: ApiDet
apiMajorVersion = settings.getInt("apiVersionMajor", 0)
}
}
// TODO: Handle offline actions
}