Building an EPG
If we want to make our EPG useful, it should show several channels, and both current and future TV programs at the same time. Also, it'd be nice to clearly see what's currently playing, and have clear indicators of when other TV programs start and end.
In this specific component, we will opt for one method of rendering that covers these points. You can use it as an example, but there are many other ways to render the same kind of information. Also, it won't be connected to a backend service providing the EPG data. All EPG data will be mocked up, but it can be easily connected to any service, although some changes might need to be done.
EPG basics and animation setup
We'll start by creating a class-extending view. On its onDraw()
method we will draw the following parts:
- The view background
- The EPG body with all the channels and TV programs
- A top time bar hinting at the time
- A vertical line indicating the current time
We'll also need to trigger a redraw cycle if we are animating some...