// 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.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.support.annotation.NonNull;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import com.joanfuentes.hintcase.utils.DimenUtils;
import java.util.ArrayList;
import java.util.List;
    private HintCase hintCase;
    private boolean isTargetClickable;
    private Point navigationBarSizeIfExistAtTheBottom;
    private Point navigationBarSizeIfExistOnTheRight;
    private boolean wasPressedOnShape;

    public View getHintBlockView() {
        return hintBlockView;
    }

    public HintCaseView(Context context, HintCase hintCase) {
        super(context);
        init(hintCase);
    }

    private void init(HintCase hintCase) {
        setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT));
        this.hintCase = hintCase;
        closeOnTouch = true;
        showExtraContentHolderAnimators = new ArrayList<>();
        hideExtraContentHolderAnimators = new ArrayList<>();
        hintBlock = NO_BLOCK_INFO;
        hintBlockView = NO_BLOCK_INFO_VIEW;
        extraBlocks = new ArrayList<>();
        extraBlockViews = new ArrayList<>();
        backgroundColor = DEFAULT_BACKGROUND_COLOR;
        offsetInPx = HintCase.NO_OFFSET_IN_PX;
        hintBlockPosition = DEFAULT_HINT_BLOCK_POSITION;
        basePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
// 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/HintCaseView.java
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.support.annotation.NonNull;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import com.joanfuentes.hintcase.utils.DimenUtils;
import java.util.ArrayList;
import java.util.List;

    private HintCase hintCase;
    private boolean isTargetClickable;
    private Point navigationBarSizeIfExistAtTheBottom;
    private Point navigationBarSizeIfExistOnTheRight;
    private boolean wasPressedOnShape;

    public View getHintBlockView() {
        return hintBlockView;
    }

    public HintCaseView(Context context, HintCase hintCase) {
        super(context);
        init(hintCase);
    }

    private void init(HintCase hintCase) {
        setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT));
        this.hintCase = hintCase;
        closeOnTouch = true;
        showExtraContentHolderAnimators = new ArrayList<>();
        hideExtraContentHolderAnimators = new ArrayList<>();
        hintBlock = NO_BLOCK_INFO;
        hintBlockView = NO_BLOCK_INFO_VIEW;
        extraBlocks = new ArrayList<>();
        extraBlockViews = new ArrayList<>();
        backgroundColor = DEFAULT_BACKGROUND_COLOR;
        offsetInPx = HintCase.NO_OFFSET_IN_PX;
        hintBlockPosition = DEFAULT_HINT_BLOCK_POSITION;
        basePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        navigationBarSizeIfExistAtTheBottom = DimenUtils.getNavigationBarSizeIfExistAtTheBottom(getContext());