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] val i = items[position]
CoroutineScope(Dispatchers.IO).launch { CoroutineScope(Dispatchers.IO).launch {
repository.markAsRead(i.id) repository.markAsRead(i.id)
// TODO: update db
} }
// Todo: if (repository.displayedItems == "unread") {
// if (SharedItems.displayedItems == "unread") { items.remove(i)
// items.remove(i) notifyItemRemoved(position)
// notifyItemRemoved(position) updateItems(items)
// updateItems(items) } else {
// } else { notifyItemChanged(position)
// notifyItemChanged(position) }
// }
if (showSnackbar) { if (showSnackbar) {
unmarkSnackbar(i, position) unmarkSnackbar(i, position)
} }

View File

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