android / tv-samples

Multiple samples showing best practices in app development on Android TV.
Apache License 2.0
1.05k stars 332 forks source link

[JetStream] Movie card titles are no longer horizontally constraint. #144

Open dheineman opened 9 months ago

dheineman commented 9 months ago

In the recent pull request https://github.com/android/tv-samples/pull/142 the explicit width was removed from the modifier on the StandardCardLayout in the common/Moviesrow.kt file. This will cause the card to horizontally expand as needed to place the title of the item on the screen.

It is generally not noticeable in the sample as all the movie titles in movies.json are small enough but as the screenshot below shows longer titles will cause issues.

Screenshot_20231212_113257

vighnesh153 commented 9 months ago

The title parameter in the cards accepts a composable as value. It is the responsibility of the card's consumer to clip off the extra text which might overflow. Additionally, users can also choose to append the text with an ellipsis.

dheineman commented 9 months ago

Hey vighnesh, I opened the issue because i noticed it broke in the JetStream sample/demo application which itself is a consumer of the card. The MoviesRowItemText in the sample also uses overflow = TextOverflow.Ellipsis however this does not prevent the above from happening.