Skip to content

Conversation

@Isira-Seneviratne
Copy link
Member

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

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.

Due diligence

@AudricV AudricV added the codequality Improvements to the codebase to improve the code quality label Jul 10, 2021
@TacoTheDank
Copy link
Member

Dev notes: Be sure to read the changes between Core 1.3.2 and 1.6.0: https://developer.android.com/jetpack/androidx/releases/core

windowManager.getDefaultDisplay());

final int viewPagerVisibleHeight = displaySize.y - pagerHitRect.top;
final int viewPagerVisibleHeight = mode.getPhysicalHeight() - pagerHitRect.top;
Copy link
Member

@Stypox Stypox Jul 18, 2021

Choose a reason for hiding this comment

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

This is not correct. viewPagerVisibleHeight should represent the height of the view pager that is visible on the screen, but here the size of Android's bottom bar is also summed, since getPhysicalHeight() is used. But now that I see it, it seems like it was also wrong before, since getDefaultDisplay().getSize() returned the height of the app and the above difference was also wrong. What viewPagerVisibleHeight should be equal to is "y_of_the_bottom_of_the_activity (i.e. just above Android's bottom bar) - y_of_the_top_of_viewPager". Is there a way to do this with the compat library? I saw that getDefaultDisplay().getSize() was deprecated in API 30 in favour of WindowMetrics, and WindowMetrics#getBounds() would provide us with "y_of_the_bottom_of_the_activity", but that method has not yet been backported in the compat library.

Copy link
Member Author

@Isira-Seneviratne Isira-Seneviratne Jul 18, 2021

Choose a reason for hiding this comment

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

There's a Window Manager library which backports WindowMetrics, but it's still in alpha.

@Redirion Redirion mentioned this pull request Jul 19, 2021
5 tasks
@Stypox
Copy link
Member

Stypox commented Jul 19, 2021

There's a Window Manager library which backports WindowMetrics, but it's still in alpha.

Mmmh, then I'd rather not merge this and keep the old behaviour, that has proven to work well (I haven't seen any issue about it and for me it works fine). If you or someone from the team disagrees, feel free to reopen ;-)
I'd also not switch to the Window Manager library even after it comes out of alpha, for the same reason.
Thank you for your work anyway :-D

@Stypox Stypox closed this Jul 19, 2021
@Isira-Seneviratne Isira-Seneviratne deleted the Use_DisplayCompat branch August 1, 2021 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codequality Improvements to the codebase to improve the code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants