-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Use WindowMetrics API. #8656
Use WindowMetrics API. #8656
Conversation
b1a1ccf
to
3f9caca
Compare
Mmmh, why is the new library needed? According to the docs:
All of the mentioned functions belong to the official Android API, so there shouldn't be a need to use libraries. Anyway, how many Kb does the library add to the app? |
I tried using the Android API, but faced some SonarQube issues.
I believe around 5 KB. |
3f9caca
to
986731b
Compare
Oh, which was the issue? |
986731b
to
f564103
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested and it works fine. Thank you for implementing this without libraries. The Sonar warnings are normal, because the usage of deprecated methods was not removed, but that's normal in this case, as the deprecated methods are only used on older devices.
@@ -1078,6 +1077,20 @@ public void updateTabLayoutVisibility() { | |||
} | |||
} | |||
|
|||
private int getWindowHeight(@NonNull final WindowManager windowManager) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this method in util/DeviceUtils
f564103
to
4d7a6fb
Compare
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works, thanks
What is it?
Description of the changes in your PR
WindowMetrics
API inVideoDetailFragment
andPopupPlayerUi
, asDisplay#getSize()
andDisplay#getMetrics()
have been deprecated in favor of it.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.
Due diligence