Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rail focus issue when D-pad UP #289

Open
Anuragjain01 opened this issue Dec 11, 2024 · 1 comment
Open

Rail focus issue when D-pad UP #289

Anuragjain01 opened this issue Dec 11, 2024 · 1 comment

Comments

@Anuragjain01
Copy link

Hi @rubensousa i am facing one issue is
i have 5 rails in dpadrecylerview and let say my focus on third rail and i add new rail added at 2nd position then when i move d-pad up then focus not move to up it remove from d-pad recyclerview and when i press-d-pad down and then left or right then its working fine. and when rail is added below the rail that have already focus then its working fine.
val diffCallback = RowDiffCallback(items, rows)
val diffResult = DiffUtil.calculateDiff(diffCallback)
items.clear()
items.addAll(rows)
diffResult.dispatchUpdatesTo(this)

    if (recyclerView?.hasFocus()==true) {
        recyclerView?.requestLayout()
    }

and after add rail if i do recyclerView?.requestLayout() then its working but issue will in performance

@rubensousa
Copy link
Owner

@Anuragjain01 that DiffUtil usage doesn't seem correct. Can you please create a sample that showcases this issue? Otherwise I can't really help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants