Feat: Add optional clock to TV player#2941
Conversation
JelleSThijs
commented
Jun 22, 2026
- Add a new TV layout clock setting to the player option menu.
- Add a new Text clock to the tv player layout. Take 12AM/PM and 24 hour clocks into account.
fire-light42
left a comment
There was a problem hiding this comment.
A very elegant solution with TextClock! Good code and clean implementation.
There are only some minor nitpicks which are difficult (if not impossible) for a first-time contributor to know about.
… the fully shared ui logic
- Transfer tv_layout_clock_key from strings.xml to donottranslate-strings.xml. - Rename the string value to adhere to the already existing keys.
- Use playerBinding?.playerVideoClock instead of using getViewById. - Use isVisible instead of an if statement for the visibility logic
fire-light42
left a comment
There was a problem hiding this comment.
Everything looks good!
@KingLucius what do you think?
Code is very clean and elegant as you said 👍 but I have a concern on UI TextClock position, I was thinking about put it in the middle, I didn't try it though Also, clock is needed on Home page also, was thinking on adding it to top of navbar (that's what I was working on) to avoid crowded right area above the provider selector buttons. |
|
I will add the clock to the homepage, but i don't know how you would want to place the clock in the top center in the player, since that might overlap with the download header. |
|
Should the option be moved to the layout settings page, since it now also displays a clock on the home screen? |
- Add invisible text clock to the normal home layout for Unified ui logic - Add the functional text clock to the TV layout
- Set visibility based on layout and the appropriate setting - Apply the same scroll effect to the clock as for the home api holder
… settings This was done since the clock now also appears on the homescreen
…across the player and home screens - move the strings so that they are now located next to the appropriate settings - update the title and description to now include that the clock is now also on the homescreen
|
What about it to navbar header? Do you think it will be nice looking? |
|
Thank you for responding. I don't quite understand what you mean with the navbar header. There seem to be quite a few nav like search results in the project, but I don't see any for a navbar header. |
On Homepage there is a navbar on the left, I think header or footer it will be nice in my opinion |
|
Is this good to review? |
|
It should be good to merge. I looked at the navbar, but there isn't really any space for a clock in my opinion. So I placed the clock at the top of the homescreen and made it disappear when the user scrolls down like the buttons to the right of it. I resolved the merge conflict, but i do now have 2 issues found in CodeFactor. These issues aren't with my code, so I don't know if this is a problem. |
|
CodeFactor is more of a suggestion than a blocker. There is no problem if that fails. I will try to fit in a review tomorrow 👍 |
fire-light42
left a comment
There was a problem hiding this comment.
Code is good, just a matter of trailer_custom_layout.
What do you think of a left-aligned home clock?
| android:textAlignment="viewEnd" | ||
| android:textColor="@color/white" | ||
| android:textSize="20sp" | ||
| android:visibility="visible" | ||
| android:format12Hour="hh:mm a" | ||
| android:format24Hour="HH:mm" | ||
| android:fontFamily="@font/google_sans" | ||
| android:textStyle="bold" | ||
| android:gravity="end" |
There was a problem hiding this comment.
| android:textAlignment="viewEnd" | |
| android:textColor="@color/white" | |
| android:textSize="20sp" | |
| android:visibility="visible" | |
| android:format12Hour="hh:mm a" | |
| android:format24Hour="HH:mm" | |
| android:fontFamily="@font/google_sans" | |
| android:textStyle="bold" | |
| android:gravity="end" | |
| android:textColor="@color/white" | |
| android:textSize="20sp" | |
| android:visibility="visible" | |
| android:format12Hour="hh:mm a" | |
| android:format24Hour="HH:mm" | |
| android:fontFamily="@font/google_sans" | |
| android:textStyle="bold" | |
| android:gravity="start" |
I would prefer if the clock is on the left, otherwise it looks too uneven.
| </LinearLayout> | ||
|
|
||
| <TextClock | ||
| android:id="@+id/player_video_clock" |
There was a problem hiding this comment.
Remember to also place a dummy clock in trailer_custom_layout.xml 👍