Ahmad-Hamwi / TabSync

An Android lightweight synchronizer between (Views) RecyclerView & TabLayout, (Compose) LazColumn and TabRow.
Apache License 2.0
154 stars 13 forks source link

Would it be to make categories always selectable #6

Closed ArleyPereira closed 1 year ago

ArleyPereira commented 1 year ago

Hello, thanks for sharing this project. I think I found a glitch, when I scroll to the end, the last categories fail to be selected. How Would it be to make categories always selectable ?

WhatsApp-Video-2023-08-29-at-16 21 48

Ahmad-Hamwi commented 1 year ago

Hi, thank you sharing your issue!

The first thing comes to my mind is that the values in the indices list are off.

Could you please share what values are you passing to mIndices in the Views library, or syncedIndices if you're on the Compose one? As the behavior that you have described is handled by the both libraries if the values of the indices are passed in correctly.

Here's a working Views example, and a working Compose example to guide you further in the usage of the library you're using.

If the issue still exists, please don't hesitate to share a minimal working project to investigate.

ArleyPereira commented 1 year ago

Sorry, forgot to inform. I'm using the module in compose and passing the indexes contained in the dummy categories, but in a smaller amount

Screenshot at Aug 30 10-15-53

Ahmad-Hamwi commented 1 year ago

Every value in the array syncedIndices indicates that there is going to be a tab synced with an item with an index of that value.

I can see that you are synchronizing the first 3 tabs only, and you must be passing in the values [0, 1, 2] to the syncedIndices list.

You either need to: 1- Pass in the values [0, 1, 2, 3, 4] or dummyCategories.indices.toList() in order to sync the whole tabs. OR 2- Remove the last 2 tabs so that you're syncing the first 3 tabs only.

ArleyPereira commented 1 year ago

I'm passing dummy dummyCategories.indices.toList().

Perhaps this is not a problem, but normal behavior.

1 2

Ahmad-Hamwi commented 1 year ago

But you've previously mentioned this:

passing the indexes contained in the dummy categories, but in a smaller amount

So this must be the problem.

When you have passed in dummyCategories.indices.toList(), did the problem go away?

ArleyPereira commented 1 year ago

I magically cloned the project again and it started working correctly again. Again, thank you so much for sharing your project.

Ahmad-Hamwi commented 1 year ago

Always make sure to pass in the correct indices that you want the tabs to sync with.

I'm always happy to help. Have a nice day!