Comments (12)
It should be possible, since the cells are created dynamically, only the ones you see on the screen are stored in memory. You could try extending the ranges to like 1 month, and see what happens :)
from android-tv-program-guide.
Could you point the place in the code where I can do it ?
from android-tv-program-guide.
Hello Ivan,
Here's a diff where I change the timeline to extend to 90 days, and I also fill the demo program with random data for those days. Only thing that needs to be fixed is that the day selector should also update based on the current day (as the time-of-day-selector does), but that shouldn't be too hard :)
from android-tv-program-guide.
You are savior. Thank you so much)
I haven't even thought this way.
from android-tv-program-guide.
Hi, I have a similar problem with implementing scrolling for multiple days in the past and future. Specifically, I want to implement scrolling for 7 days into the past and 7 days into the future. These days are set from the current day. I tried your code and it works for days in the "future".
Your code:
EpgFragment.kt
val MIN_CHANNEL_END_TIME =
localDate.atStartOfDay().plusDays(89).withHour(21).truncatedTo(ChronoUnit.HOURS)
.atZone(DISPLAY_TIMEZONE)
val MAX_CHANNEL_END_TIME =
localDate.plusDays(90).atStartOfDay().withHour(4).truncatedTo(ChronoUnit.HOURS)
.atZone(DISPLAY_TIMEZONE)
ProgramGuideManager.kt
val timelineEndsAt =
timelineStartsAt.plusDays(90).withHour(DAY_ENDS_NEXT_DAY_AT_HOUR)
By analogy, I changed the code for days in the "past" and it works strangely.
My code:
ProgramGuideManager.kt
val timelineStartsAt =
selectedDate.minusDays(7).atStartOfDay(timeZone).withHour(DAY_STARTS_AT_HOUR)
EpgFragment.kt
val MIN_CHANNEL_START_TIME =
localDate.atStartOfDay().minusDays(7).withHour(2).truncatedTo(ChronoUnit.HOURS)
.atZone(DISPLAY_TIMEZONE)
val MAX_CHANNEL_START_TIME =
localDate.atStartOfDay().minusDays(7).withHour(8).truncatedTo(ChronoUnit.HOURS)
.atZone(DISPLAY_TIMEZONE)
It broked the "live" day, shows only 3 days, and the scroll works only for 3 days. I'm a beginner and don't quite understand what needs to be changed.
from android-tv-program-guide.
Hi @AaravPatel1999 could you upload a diff perhaps?
from android-tv-program-guide.
sure
file.txt
from android-tv-program-guide.
I think your issue is this - your code looks something like:
val timelineStartsAt =
selectedDate.atStartOfDay(timeZone).minusDays(7).withHour(DAY_STARTS_AT_HOUR)
val timelineEndsAt =
timelineStartsAt.plusDays(7).withHour(DAY_ENDS_NEXT_DAY_AT_HOUR)
Which means that first, the timeline will start at 7 days before - but then you add 7 days to the timeline start, ending at today. You need to either add 14 days to the start date, or 7 days to the selectedDate, then it should work.
Btw, your diff did not apply, so probably mine won't work on your branch, but I think it is short enough that you get the gist of it. This version works if you apply it on the main branch in this repo: 7days_before_after.txt
from android-tv-program-guide.
Thank you very much, this solution was quite helpful, and I also made some adjustments. I have one more question: can we incorporate pagination into your solution?
I attempted a pagination solution for a normal RecyclerView, and each time a new page of items is loaded, the grid thinks I am loading a completely new list. It seems logical, but I haven't yet figured out how to modify it.
I also tried to implement pagination within ProgramGuideManager. So, I load my full list into ProgramGuideManager, but inside ProgramGuideManager, I show only 20 items. In the onRequestChildFocus method, I catch when the user scrolls to the very bottom and load more items from ProgramGuideManager. But this solution has an issue with the initial load; for some reason, it takes 10-12 seconds.
from android-tv-program-guide.
Is the issue that focus is not kept on the current item, and it just jumps to the top?
I could investigate if you send me the full example code, but without that, I can not see what is going on.
from android-tv-program-guide.
The problem is that I don’t understand how to correctly implement pagination for the ProgramGuideManager.
from android-tv-program-guide.
I'm sorry, I'm not able to help with that. I do have the time to help debugging issues with the current features of this library, but won't be able to assist extending the library with new features. If you need some explanation regarding the code in the library, I can help you with that though.
from android-tv-program-guide.
Related Issues (20)
- how can i use this project in Android Studio
- Unable to parse DateTime HOT 7
- not able to refresh data with new schedule list HOT 2
- current program view not updating currectly HOT 2
- How to Set time to 12 hour Format HOT 1
- Channel Image Focusable HOT 1
- Program cell behind the channel bar is getting focused. HOT 6
- Date field is not updating immediately on scroll of programs HOT 2
- How to use an XMLTV url with the code HOT 1
- Java implementation needed HOT 3
- Api to have 24-hour rolling window in grid view starting from previous half hour HOT 11
- Left Most Focus Issue HOT 4
- Help On Updating Large Amount Of Epg Data HOT 1
- autoScrollToBestProgramme/focusCurrentProgram don't always focus correctly on the corrent program
- Android TV Program Guide HOT 4
- Jetpack compose HOT 2
- Need help with timeline and line LIVE HOT 1
- While Video Length is Larger then It skipping the Row and focused changed to 3rd row. HOT 1
- Updating grid data in chunks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-tv-program-guide.