Skip to content

Commit

Permalink
removed useless checkers
Browse files Browse the repository at this point in the history
  • Loading branch information
Legementarion committed Mar 20, 2018
1 parent 01837c6 commit 4c41d26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
17 changes: 8 additions & 9 deletions ucrop/src/main/java/com/yalantis/ucrop/util/BitmapLoadUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,18 @@ public static int exifToTranslation(int exifOrientation) {
@SuppressWarnings({"SuspiciousNameCombination", "deprecation"})
public static int calculateMaxBitmapSize(@NonNull Context context) {
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();

Point size = new Point();
Display display;
int width, height;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
Point size = new Point();

if (wm != null) {
display = wm.getDefaultDisplay();
display.getSize(size);
width = size.x;
height = size.y;
} else {
width = display.getWidth();
height = display.getHeight();
}

width = size.x;
height = size.y;

// Twice the device screen diagonal as default
int maxBitmapSize = (int) Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));

Expand Down
3 changes: 1 addition & 2 deletions ucrop/src/main/java/com/yalantis/ucrop/view/OverlayView.java
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ private void updateGridPoints() {
}

protected void init() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2 &&
Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) {
setLayerType(LAYER_TYPE_SOFTWARE, null);
}
}
Expand Down

0 comments on commit 4c41d26

Please sign in to comment.