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

Fix grid span count calculation #6705

Merged
merged 1 commit into from
Jul 19, 2021
Merged

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Jul 19, 2021

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Fix grid span count calculation
  • Move the duplicate methods shouldUseGridLayout() and getGridSpanCount() into ThemeHelper. They were both duplicated in three classes: BaseLocalListFragment, FeedFragment and SubscriptionFragment and had a different (maybe wrong) implementation each time.
  • In getGridSpanCount(), instead of doing (int) Math.floor(screenWidth / ((float) minWidth)), I just do screenWidth / minWidth since the default integer division already yields the floor-ed result.

Before/After Screenshots/Screen Record

Before After

Fixes the following issue(s)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.
@onkq @Thewisem does this work for you?

Due diligence

@Thewisem
Copy link

Yeah I checked. Its fixed

@Thewisem
Copy link

Hmmm is this commit gonna fix the reordering of grids as you reload the feed?

Copy link
Member

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

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

Code looks good to me. I did not have the chance to test it yet.

@Stypox
Copy link
Member Author

Stypox commented Jul 19, 2021

Hmmm is this commit gonna fix the reordering of grids as you reload the feed?

@Thewisem nope, it just fixes the text/thumbnail-too-big problems

@triallax triallax added bug Issue is related to a bug GUI Issue is related to the graphical user interface labels Jul 19, 2021
@Thewisem
Copy link

Tested it out. Working ok

@TobiGr TobiGr merged commit 63fdc10 into TeamNewPipe:dev Jul 19, 2021
@Stypox Stypox mentioned this pull request Jul 20, 2021
@Stypox Stypox deleted the big-text-info-items branch August 4, 2022 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug GUI Issue is related to the graphical user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0.21.6 Tablets thumbnails+title too big
4 participants