Fix recycleview article positions #163
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "davidoskky/ReaderForSelfoss-multiplatform:incorrectArticles"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The articles were being opened by setting a click listener on the binding.
In card view this was being done through a function and as such it used the overall viewbind of the recyclerview rather than the binding of the item viewholder. I'm not really sure as to why it previously worked and then stopped doing so.
Now the functions are more explicit to avoid future errors.
Pulled up a few members from ItemCardAdapter and ItemListAdapter to ItemAdapter.
Types of changes
This closes issue #162
@ -663,4 +659,0 @@
private fun updateItems(adapterItems: ArrayList<SelfossModel.Item>) {
items = adapterItems
}
This was needed so the
HomeActivity
have an updateditems
array. This should be added back here and in the adapters.@ -100,2 +84,2 @@
handleClickListeners(holder.bindingAdapterPosition)
handleLinkOpening(holder.bindingAdapterPosition)
handleClickListeners(binding, position)
openLink(binding, position)
openLink
function does not open the link. It should be renamed. I think thathandleLinkOpening
was pretty clear.@ -72,1 +78,4 @@
protected fun openLink(holderBinding: ViewBinding, position: Int) {
holderBinding.root.setOnClickListener {
Log.d(
This log is not needed anymore
Sorry, I pushed a bit too quickly. I’ve reverted the changes and renamed
updateItems
in the adapter toupdateHomeItems
to make its purpose clearer.Thanks !