Make items read by swiping disappear
This commit is contained in:
parent
8c5f4268a4
commit
5377e6c0f8
@ -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)
|
||||
}
|
||||
|
@ -300,4 +300,6 @@ class RepositoryImpl(private val api: SelfossApi, private val apiDetails: ApiDet
|
||||
apiMajorVersion = settings.getInt("apiVersionMajor", 0)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Handle offline actions
|
||||
}
|
Loading…
Reference in New Issue
Block a user