egeniq / android-tv-program-guide

Android TV Program Guide
Apache License 2.0
164 stars 66 forks source link

Scroll the center Program Guide Grid when move from right to left #31

Closed duongtainhan closed 3 years ago

duongtainhan commented 3 years ago

Hi,

I'm looking for a way to scroll the center Program Guide Grid when move from right to left. Can you guys tell me how to do it? Also there is a variable in ProgramGuideGridView I don't understand yet is overlapStart in line it.overlapStart = it.resources.getDimensionPixelOffset(R.dimen.programguide_channel_column_width). Can you explain to me what it is, please?

Thanks & Regards.

dzolnai commented 3 years ago

Hi!

I'm looking for a way to scroll the center Program Guide Grid when move from right to left

Can you be a bit more specific with what you want? You can move the entire grid using ProgramGuideManager.jumpTo() or ProgramGuideManager.shiftTime()

I don't understand yet is overlapStart

overlapStart is required for the focus finder. In the programs row, the programs can be behind the left channel column. When you want to focus the row, you don't want to put focus on the program behind that column, because the user won't see the higlight and will be lost. This overlapstart makes sure that on first focus, no program behind the column will be selected.

duongtainhan commented 3 years ago

overlapStart is required for the focus finder. In the programs row, the programs can be behind the left channel column. When you want to focus the row, you don't want to put focus on the program behind that column, because the user won't see the higlight and will be lost. This overlapstart makes sure that on first focus, no program behind the column will be selected.

Thanks for the explanation for me to understand. It helps a lot.

duongtainhan commented 3 years ago

Can you be a bit more specific with what you want? You can move the entire grid using ProgramGuideManager.jumpTo() or ProgramGuideManager.shiftTime()

I want when scrolling, the focus item will be in the center of recycler view. Like this:

https://user-images.githubusercontent.com/40598538/110455222-bf06b800-80fa-11eb-8c6a-3fb49f5b81e2.mp4

dzolnai commented 3 years ago

I see, that is quite difficult to change, I do not have the time to do that. You can try yourself, basically you need to change the focusSearch(...) method of ProgramGuideRowGridView, by calling scrollByTime at the correct time with the correct amount.

duongtainhan commented 3 years ago

I see, that is quite difficult to change, I do not have the time to do that. You can try yourself, basically you need to change the focusSearch(...) method of ProgramGuideRowGridView, by calling scrollByTime at the correct time with the correct amount.

Thanks for the suggestion to me. I will try handling focusSearch.