Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rework, optimize GridFragment #1812

Merged
merged 1 commit into from
Jul 8, 2022
Merged

Conversation

Andy2244
Copy link
Contributor

@Andy2244 Andy2244 commented Jul 3, 2022

Changes
The grid now auto adapts to the actual screen size/dimensions, while the grid itself is density independent. So the size settings will always produce a consistent row/columns view result. The spacing's, padding, chunk size now also auto adapts. We now use the resource focus scaling % directly to determine padding/spacing.

The "default" naming, was also confusing and inconsistent. The user should directly see what the actual values are and not guess what "default" means.

My beta testers also reported that the "small" layout was still too big for large screens, so after feedback we decided on 2 new size options to address this.

  • add auto image size logic
  • add two new size options
  • rename/remove superfluous "Default" and "Auto" options
  • fix grid layout fragment to follow screen layout/size
  • fix card refresh not working after resume
  • fix/optimize chunk size logic
  • fix card padding/spacing
  • remove vertical grid "hacks"
  • remove unnecessary grid reload's
  • reduce status-line update timer 400->250ms to feel more responsive

Issues
fixes #1774

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 14 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 14 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 16 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 18 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 19 potential problems in the proposed changes. Check the Files changed tab for more details.

@nielsvanvelzen
Copy link
Member

Right now this is a mix of fixes and features. It will be a lot easier to review when split into multiple pull requests. Can you do that?

@nielsvanvelzen
Copy link
Member

To be more specific, can you split the "play from the grid view" feature to a separate PR. Everything else can stay in this one.

@Andy2244
Copy link
Contributor Author

Andy2244 commented Jul 6, 2022

To be more specific, can you split the "play from the grid view" feature to a separate PR. Everything else can stay in this one.

ok will try, i know its not a ideal PR, but i had to-do quite some iterations, before i ended-up with this version, being new to the code and all.
On the upside, myself and a couple of beta testers are using the changes for two weeks now and i have no outstanding issues, only feature requests.

@Andy2244
Copy link
Contributor Author

Andy2244 commented Jul 6, 2022

ok only has the grid changes/fixes now

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 14 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link
Member

@nielsvanvelzen nielsvanvelzen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opening the albums grid view for a music libraries with medium poster images in a vertical direction doesn't behave properly.

Same happens for artists, I think because they both use a square size instead of poster size when set to "poster".

app/src/main/java/org/jellyfin/androidtv/util/Utils.java Outdated Show resolved Hide resolved
@Andy2244
Copy link
Contributor Author

Andy2244 commented Jul 7, 2022

Opening the albums grid view for a music libraries with medium poster images in a vertical direction doesn't behave properly.

Same happens for artists, I think because they both use a square size instead of poster size when set to "poster".

Ah ok, i remember there was special music poster handling, should be easy to fix.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 16 potential problems in the proposed changes. Check the Files changed tab for more details.

@Andy2244
Copy link
Contributor Author

Andy2244 commented Jul 7, 2022

ok music views are fixed, yet check the horizontal vs vertical card sizes/aspect. I understand that the horizontal special handling was to allow for slightly none 1.0 aspect posters or combined front+back covers.

Yet i find the varying grid item offsets that are the result of this, kinda weird and visually unpleasing. So i personally would rather scale/cutoff those none 1.0 cases, instead of adapting the card to it?
We could still allow the special handling for large 1 row grids?

Just a idea.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 16 potential problems in the proposed changes. Check the Files changed tab for more details.

@nielsvanvelzen
Copy link
Member

Yeah I just noticed when viewing music artists that I have a single entry with a 1182x548 image, it shows as a square now in the vertical view but looks really bad and displaces all other items in the horizontal view. I think forcing all items to a single size would be best (even for single row).

@Andy2244
Copy link
Contributor Author

Andy2244 commented Jul 7, 2022

Yeah I just noticed when viewing music artists that I have a single entry with a 1182x548 image, it shows as a square now in the vertical view but looks really bad and displaces all other items in the horizontal view. I think forcing all items to a single size would be best (even for single row).

Ok will add the change to horizontal grids as well.

PS: Btw off-topic, whats-up with the translations PR? Specifically with the seemingly, still auto-translations?
I mean there is a Android-Studio google-translate plugin, that will translate all empty/missing entries?
Why is this not used, so we get at least basic google-translates for everything?

@nielsvanvelzen
Copy link
Member

For translations we only modify the values/strings.xml file. Translations can then be added on our Weblate instance at https://translate.jellyfin.org.
We don't allow translations in pull requests because those caused a lot of conflicts in the past, even causing Weblate to stop pushing changes to the repository.

The translations are made by actual people, not by machine. We'd rather have the app show an English string instead of a badly machine translated string.

@Andy2244
Copy link
Contributor Author

Andy2244 commented Jul 7, 2022

We'd rather have the app show an English string instead of a badly machine translated string.

mhh ok, but depending on language and country, a bad google translation is often still better than the english one.
I mean i don't see many dev's working on the AndroidTv client, so there are translations missing for very easy stuff?

In my fork i have to work with chinese documentation web-pages using google translate and this works surprisingly well, so i think google translate has a somewhat outdated "bad" reputation.

@Andy2244
Copy link
Contributor Author

Andy2244 commented Jul 7, 2022

ok using uniform aspect for all grid views now.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 16 potential problems in the proposed changes. Check the Files changed tab for more details.

add auto image size logic
add/change Ui size names
remove superfluous "Default" naming
fix grid layout fragment to following screen layout/size
fix card refresh not working after resume
fix/optimize chunk size logic
fix card padding/spacing
remove vertical grid "hacks"
remove unnecessary grid reload's
reduce status-line update timer 400->250ms to feel more responsive
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 12 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 12 potential problems in the proposed changes. Check the Files changed tab for more details.

@nielsvanvelzen nielsvanvelzen merged commit cec666a into jellyfin:master Jul 8, 2022
@nielsvanvelzen
Copy link
Member

Works perfect now, thanks!

@Andy2244 Andy2244 deleted the grid-rework branch July 8, 2022 13:30
@nielsvanvelzen nielsvanvelzen added the release-highlight Pull request might be suitable for mentioning in the release blog post label Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-highlight Pull request might be suitable for mentioning in the release blog post
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Layout/UI poster wall issues in 4k, lots of wasted space?
2 participants