package no.hyper.imagecrop;

import android.content.Context;
import android.graphics.BitmapFactory;
import android.graphics.Point;
import android.view.Display;
import android.view.WindowManager;


/**
 * Created by chang@hyper.no on 5/26/2015.
 */
public class Utils {
    public static class ScreenSize {

        public static int getWidth(Context ctx) {
            WindowManager wm = (WindowManager)ctx.getSystemService(Context.WINDOW_SERVICE);
            Display display = wm.getDefaultDisplay();
            Point size = new Point();
            display.getSize(size);
            int width = size.x;
            int height = size.y;

            return width;
        }

        public static int getHeight(Context ctx) {
            WindowManager wm = (WindowManager)ctx.getSystemService(Context.WINDOW_SERVICE);
            Display display = wm.getDefaultDisplay();
            Point size = new Point();
            display.getSize(size);
            int width = size.x;
            int height = size.y;

            return height;
        }
    }

    public static class Image {

        public static BitmapFactory.Options getImageInfo(String path) {
            BitmapFactory.Options bmOptions = new BitmapFactory.Options();
            bmOptions.inJustDecodeBounds = true;
            BitmapFactory.decodeFile(path, bmOptions);

            return bmOptions;
        }
    }
}

@@ -572,73 +572,8 @@
 ze);
-%0A            int width = size.x;%0A            int height = size.y;
 %0A%0A  
@@ -589,21 +589,22 @@
  return 
-width
+size.x
 ;%0A      
@@ -882,99 +882,34 @@
 e);%0A
-            int width = size.x;%0A            int height = size.y;%0A%0A            return height
+%0A            return size.y
 ;%0A  

Simplify Utils.ScreenSize