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

Fixed getDeviceType method. #571

Merged
merged 2 commits into from
Feb 13, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private static DeviceType getDeviceType(ReactApplicationContext reactContext) {

// Calculate physical size.
double widthInches = metrics.widthPixels / (double) metrics.xdpi;
double heightInches = metrics.widthPixels / (double) metrics.xdpi;
double heightInches = metrics.heightPixels / (double) metrics.xdpi;
Copy link
Contributor

Choose a reason for hiding this comment

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

oops, bad copy/paste on my part in the original. I wonder if metrics.xdpi in the end of this should be metrics.ydpi instead though?

Copy link
Contributor Author

@vladrozhnev vladrozhnev Feb 13, 2019

Choose a reason for hiding this comment

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

@fxdemolisher it seems you are right.

double diagonalSizeInches = Math.sqrt(Math.pow(widthInches, 2) + Math.pow(heightInches, 2));

if (diagonalSizeInches >= 3.0 && diagonalSizeInches <= 6.9) {
Expand Down