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
[ x ] I have read the CONTRIBUTING document.
[ x ] My code follows the code style of this project.
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
- [ x ] I have read the **CONTRIBUTING** document.
- [ x ] My code follows the code style of this project.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ x ] All new and existing tests passed.
- [ x ] This is **NOT** translation related.
This closes issue #162
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 view rather than the binding of the item viewholder.
Now the functions are more explicit to avoid future errors.
Pulled up a few members from ItemCardAdapter and ItemListAdapter to ItemAdapter.
Removed in the previous commit, the item adapter accepts a method to update the articles list in the home page.
Renamed the method to make its objective more clear.
Removed a debugging log.
Reverted change to function name.
Sorry, I pushed a bit too quickly. I’ve reverted the changes and renamed updateItems in the adapter to updateHomeItems to make its purpose clearer.
Sorry, I pushed a bit too quickly. I’ve reverted the changes and renamed `updateItems` in the adapter to `updateHomeItems` to make its purpose clearer.
AmineB
approved these changes 2024-11-20 08:31:26 +00:00
AmineB
merged commit 62f58fbc00 into master2024-11-20 08:31:34 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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
HomeActivityhave an updateditemsarray. 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)openLinkfunction does not open the link. It should be renamed. I think thathandleLinkOpeningwas 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
updateItemsin the adapter toupdateHomeItemsto make its purpose clearer.Thanks !