rubensousa / DpadRecyclerView

A RecyclerView built for Android TV with Compose in mind and as a replacement for Leanback's BaseGridView.
https://rubensousa.github.io/DpadRecyclerView/
Apache License 2.0
136 stars 17 forks source link

Focus is not working in 85 inch Tv #159

Closed pavelsust closed 1 year ago

pavelsust commented 1 year ago

Hello, Thanks for this awesome library. I had developed an android tv using this library. But I am facing one issue. In every tv focus is working except 85 inch tv. In 85 inch tv focus is not working. Any idea about this issue?

Screenshot 2023-08-14 at 3 14 42 AM
rubensousa commented 1 year ago

I would need more information on how you're setting up focus changes to understand what might be wrong. Did you do this? https://rubensousa.github.io/DpadRecyclerView/selection/

image

Otherwise, please attach a sample project doing exactly the same as you're doing in that project

pavelsust commented 1 year ago
Screenshot 2023-08-14 at 3 57 02 AM

I would need more information on how you're setting up focus changes to understand what might be wrong. Did you do this? https://rubensousa.github.io/DpadRecyclerView/selection/

image

Otherwise, please attach a sample project doing exactly the same as you're doing in that project

pavelsust commented 1 year ago

Here I have gained focus using setOnFocusChangeListener.

rubensousa commented 1 year ago

@pavelsust Do you have this part?

view.isFocusable = true
view.isFocusableInTouchMode = true
pavelsust commented 1 year ago

Yes I have it

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CategoryCustomViewHolder {
    val view = LayoutInflater.from(parent.context).inflate(R.layout.adapter_item_grid, parent , false)
    val params = view.layoutParams
    params.width = getWidthInPercent(parent.context , width)
    params.height = getHeightInPercent(parent.context , height)
    view.isFocusable = true
    view.isFocusableInTouchMode = true
    return CategoryCustomViewHolder(view)
}
rubensousa commented 1 year ago

Ok, then please attach a full sample here so I can inspect in more detail. Otherwise, it's hard for me to figure out what's wrong

rubensousa commented 1 year ago

Also a screen recording would help. Enable "Show layout bounds" and attach the recording please. Example for phones: https://whyingo.org/how-to-enable-or-disable-show-layout-bounds-android/

rubensousa commented 1 year ago

@pavelsust Any update here?

rubensousa commented 1 year ago

@pavelsust I'm closing this due to lack of activity and no response to my comments