Skip to content

Commit

Permalink
Move size based logic to separate function
Browse files Browse the repository at this point in the history
  • Loading branch information
mouselangelo authored and mikehardy committed Jul 23, 2019
1 parent 05d485d commit fb0f1da
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,13 @@ private static DeviceType getDeviceType(ReactApplicationContext reactContext) {
return DeviceType.TV;
}

return getDeviceTypeFromPhysicalSize(reactContext);
}

private static DeviceType getDeviceTypeFromPhysicalSize(ReactApplicationContext reactContext) {
// Find the current window manager, if none is found we can't measure the device physical size.
WindowManager windowManager = (WindowManager) reactContext.getSystemService(Context.WINDOW_SERVICE);

if (windowManager == null) {
return DeviceType.UNKNOWN;
}
Expand Down

0 comments on commit fb0f1da

Please sign in to comment.