Skip to content

Commit

Permalink
fix(android): use context.getResources() get windowDisplayMetrics
Browse files Browse the repository at this point in the history
  • Loading branch information
siguangli2018 authored and zoomchan-cxj committed Feb 28, 2022
1 parent c77a853 commit a1fb410
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,7 @@ public static HippyMap getDimensions(int windowWidth, int windowHeight, Context
return null;
}

DisplayMetrics windowDisplayMetrics = PixelUtil.getMetrics();
if (windowDisplayMetrics == null) {
windowDisplayMetrics = context.getResources().getDisplayMetrics();
}
DisplayMetrics windowDisplayMetrics = context.getResources().getDisplayMetrics();
DisplayMetrics screenDisplayMetrics = new DisplayMetrics();
screenDisplayMetrics.setTo(windowDisplayMetrics);
WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Expand Down

0 comments on commit a1fb410

Please sign in to comment.