fix: Fixed handling of position in card adapter.
All checks were successful
continuous-integration/drone/tag Build is passing
All checks were successful
continuous-integration/drone/tag Build is passing
This commit is contained in:
parent
db166ca9d4
commit
7870ca8976
@ -94,10 +94,10 @@ class ItemCardAdapter(
|
||||
position: Int,
|
||||
) {
|
||||
with(holder) {
|
||||
val itm = items[position]
|
||||
val itm = items[holder.bindingAdapterPosition]
|
||||
|
||||
handleClickListeners(position)
|
||||
handleLinkOpening(position)
|
||||
handleClickListeners(holder.bindingAdapterPosition)
|
||||
handleLinkOpening(holder.bindingAdapterPosition)
|
||||
|
||||
binding.favButton.isSelected = itm.starred
|
||||
if (appSettingsService.getPublicAccess()) {
|
||||
|
@ -45,13 +45,13 @@ class ItemListAdapter(
|
||||
position: Int,
|
||||
) {
|
||||
with(holder) {
|
||||
val itm = items[position]
|
||||
val itm = items[holder.bindingAdapterPosition]
|
||||
|
||||
binding.root.setOnClickListener {
|
||||
repository.setReaderItems(items)
|
||||
c.openItemUrl(
|
||||
bindingAdapterPosition,
|
||||
items[bindingAdapterPosition].getLinkDecoded(),
|
||||
holder.bindingAdapterPosition,
|
||||
items[holder.bindingAdapterPosition].getLinkDecoded(),
|
||||
appSettingsService.isArticleViewerEnabled(),
|
||||
app,
|
||||
)
|
||||
|
@ -89,6 +89,7 @@ abstract class ItemsAdapter<VH : RecyclerView.ViewHolder?> : RecyclerView.Adapte
|
||||
if (repository.displayedItems == ItemType.UNREAD) {
|
||||
items.remove(item)
|
||||
notifyItemRemoved(position)
|
||||
notifyItemRangeChanged(position, itemCount)
|
||||
updateItems(items)
|
||||
} else {
|
||||
notifyItemChanged(position)
|
||||
|
Loading…
Reference in New Issue
Block a user