// Path: HintCase/src/main/java/com/joanfuentes/hintcase/utils/DimenUtils.java
// public class DimenUtils {
//     public static int getStatusBarHeight(Context context) {
//         int statusBarHeight = 0;
//         Resources resources = context.getResources();
//         int id = resources.getIdentifier("status_bar_height", "dimen", "android");
//         if (id > 0) {
//             statusBarHeight = resources.getDimensionPixelSize(id);
//         }
//         return statusBarHeight;
//     }
// 
//     public static int getActionBarHeight(Context context) {
//         int actionBarHeight = 0;
//         TypedValue tv = new TypedValue();
//         if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
//             actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data,
//                     context.getResources().getDisplayMetrics());
//         }
//         return actionBarHeight;
//     }
// 
//     public static int dipToPixels(Context context, float valueInDP) {
//         DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
//         return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, valueInDP, displayMetrics);
//     }
// 
//     public static Point getNavigationBarSizeIfExistAtTheBottom(Context context) {
//         Point appUsableSize = getAppUsableScreenSize(context);
//         Point realScreenSize = getRealScreenSize(context);
//         Point navigationPoint;
//         boolean navigationBarIsPresent = appUsableSize.y < realScreenSize.y;
//         if (navigationBarIsPresent) {
//             navigationPoint = new Point(appUsableSize.x, realScreenSize.y - appUsableSize.y);
//         } else {
//             navigationPoint = new Point();
//         }
//         return navigationPoint;
//     }
// 
//     public static Point getNavigationBarSizeIfExistOnTheRight(Context context) {
//         Point appUsableSize = getAppUsableScreenSize(context);
//         Point realScreenSize = getRealScreenSize(context);
//         Point navigationPoint;
//         boolean navigationBarIsPresent = appUsableSize.x < realScreenSize.x;
//         if (navigationBarIsPresent) {
//             navigationPoint =  new Point(realScreenSize.x - appUsableSize.x, appUsableSize.y);
//         } else {
//             navigationPoint =  new Point();
//         }
//         return navigationPoint;
//     }
// 
//     public static Point getAppUsableScreenSize(Context context) {
//         WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
//         Display display = windowManager.getDefaultDisplay();
//         Point size = new Point();
//         display.getSize(size);
//         return size;
//     }
// 
//     public static Point getRealScreenSize(Context context) {
//         Point size = new Point();
//         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
//             WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
//             Display display = windowManager.getDefaultDisplay();
//             display.getRealSize(size);
//         } else {
//             View decorView = null;
//             if(context instanceof Activity) {
//                 decorView = ((Activity) context).getWindow().getDecorView();
//             } else if(context instanceof ContextThemeWrapper) {
//                 Context baseContext = ((ContextThemeWrapper) context).getBaseContext();
//                 if(baseContext instanceof Activity) {
//                     decorView = ((Activity) baseContext).getWindow().getDecorView();
//                 }
//             }
//             if(decorView != null) {
//                 size.x = decorView.getWidth();
//                 size.y = decorView.getHeight();
//             }
//         }
//         return size;
//     }
// }


import android.app.Activity;
import android.content.Context;
import android.support.annotation.DimenRes;
import android.view.View;
import com.joanfuentes.hintcase.utils.DimenUtils;

    private HintCaseView hintCaseView;
    private Context context;

    public Shape getShape() {
        return this.hintCaseView.getShape();
    }

    public void hide() {
        this.hintCaseView.performHide();
        this.hintCaseView = null;
    }

    public interface OnClosedListener {
        void onClosed();
    }

    public HintCase(View view) {
        this.context = view.getContext();
        this.hintCaseView = new HintCaseView(context, this);
        this.hintCaseView.setTargetInfo(null, new RectangularShape(), NO_OFFSET_IN_PX,
                TARGET_IS_NOT_CLICKABLE);
        this.hintCaseView.setParentView(view);
    }

    public View getView() {
        return this.hintCaseView;
    }

    public HintCase setTarget(View target) {
// Path: HintCase/src/main/java/com/joanfuentes/hintcase/utils/DimenUtils.java
// public class DimenUtils {
//     public static int getStatusBarHeight(Context context) {
//         int statusBarHeight = 0;
//         Resources resources = context.getResources();
//         int id = resources.getIdentifier("status_bar_height", "dimen", "android");
//         if (id > 0) {
//             statusBarHeight = resources.getDimensionPixelSize(id);
//         }
//         return statusBarHeight;
//     }
// 
//     public static int getActionBarHeight(Context context) {
//         int actionBarHeight = 0;
//         TypedValue tv = new TypedValue();
//         if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
//             actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data,
//                     context.getResources().getDisplayMetrics());
//         }
//         return actionBarHeight;
//     }
// 
//     public static int dipToPixels(Context context, float valueInDP) {
//         DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
//         return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, valueInDP, displayMetrics);
//     }
// 
//     public static Point getNavigationBarSizeIfExistAtTheBottom(Context context) {
//         Point appUsableSize = getAppUsableScreenSize(context);
//         Point realScreenSize = getRealScreenSize(context);
//         Point navigationPoint;
//         boolean navigationBarIsPresent = appUsableSize.y < realScreenSize.y;
//         if (navigationBarIsPresent) {
//             navigationPoint = new Point(appUsableSize.x, realScreenSize.y - appUsableSize.y);
//         } else {
//             navigationPoint = new Point();
//         }
//         return navigationPoint;
//     }
// 
//     public static Point getNavigationBarSizeIfExistOnTheRight(Context context) {
//         Point appUsableSize = getAppUsableScreenSize(context);
//         Point realScreenSize = getRealScreenSize(context);
//         Point navigationPoint;
//         boolean navigationBarIsPresent = appUsableSize.x < realScreenSize.x;
//         if (navigationBarIsPresent) {
//             navigationPoint =  new Point(realScreenSize.x - appUsableSize.x, appUsableSize.y);
//         } else {
//             navigationPoint =  new Point();
//         }
//         return navigationPoint;
//     }
// 
//     public static Point getAppUsableScreenSize(Context context) {
//         WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
//         Display display = windowManager.getDefaultDisplay();
//         Point size = new Point();
//         display.getSize(size);
//         return size;
//     }
// 
//     public static Point getRealScreenSize(Context context) {
//         Point size = new Point();
//         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
//             WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
//             Display display = windowManager.getDefaultDisplay();
//             display.getRealSize(size);
//         } else {
//             View decorView = null;
//             if(context instanceof Activity) {
//                 decorView = ((Activity) context).getWindow().getDecorView();
//             } else if(context instanceof ContextThemeWrapper) {
//                 Context baseContext = ((ContextThemeWrapper) context).getBaseContext();
//                 if(baseContext instanceof Activity) {
//                     decorView = ((Activity) baseContext).getWindow().getDecorView();
//                 }
//             }
//             if(decorView != null) {
//                 size.x = decorView.getWidth();
//                 size.y = decorView.getHeight();
//             }
//         }
//         return size;
//     }
// }


// Path: HintCase/src/main/java/com/joanfuentes/hintcase/HintCase.java
import android.app.Activity;
import android.content.Context;
import android.support.annotation.DimenRes;
import android.view.View;
import com.joanfuentes.hintcase.utils.DimenUtils;


    private HintCaseView hintCaseView;
    private Context context;

    public Shape getShape() {
        return this.hintCaseView.getShape();
    }

    public void hide() {
        this.hintCaseView.performHide();
        this.hintCaseView = null;
    }

    public interface OnClosedListener {
        void onClosed();
    }

    public HintCase(View view) {
        this.context = view.getContext();
        this.hintCaseView = new HintCaseView(context, this);
        this.hintCaseView.setTargetInfo(null, new RectangularShape(), NO_OFFSET_IN_PX,
                TARGET_IS_NOT_CLICKABLE);
        this.hintCaseView.setParentView(view);
    }

    public View getView() {
        return this.hintCaseView;
    }

    public HintCase setTarget(View target) {
        int offsetInPx = DimenUtils.dipToPixels(context, HintCase.DEFAULT_SHAPE_OFFSET_IN_DP);