package com.mapbox.rctmgl.components.mapview.helpers;

import android.util.Log;

/**
 * Created by nickitaliano on 12/12/17.
 */

public class CameraChangeTracker {
    public static final int USER_GESTURE = 1;
    public static final int USER_ANIMATION = 2;
    public static final int SDK = 3;
    public static final int EMPTY = -1;

    private int reason;
    private boolean isRegionChangeAnimated;

    public void setReason(int reason) {
        this.reason = reason;
    }

    public void setRegionChangeAnimated(boolean isRegionChangeAnimated) {
        this.isRegionChangeAnimated = isRegionChangeAnimated;
    }

    public boolean isUserInteraction() {
        return reason == USER_GESTURE || reason == USER_ANIMATION;
    }

    public boolean isAnimated() {
        return isRegionChangeAnimated;
    }

    public boolean isEmpty() {
        return reason == EMPTY;
    }
}

@@ -232,18 +232,23 @@
 nal int 
-US
+DEVELOP
 ER_ANIMA
@@ -288,16 +288,26 @@
  int SDK
+_ANIMATION
  = 3;%0A  
@@ -363,24 +363,32 @@
 e int reason
+ = EMPTY
 ;%0A    privat
@@ -399,36 +399,25 @@
 olean is
-RegionChange
 Animat
-ed
+ing
 ;%0A%0A    p
@@ -507,36 +507,27 @@
 void set
-RegionChange
+Is
 Animat
-ed
+ing
 (boolean
@@ -529,36 +529,25 @@
 olean is
-RegionChange
 Animat
-ed
+ing
 ) %7B%0A    
@@ -561,53 +561,31 @@
 s.is
-RegionChange
 Animat
-ed
+ing
  = is
-RegionChange
 Animat
-ed
+ing
 ;%0A  
@@ -681,18 +681,23 @@
 ason == 
-US
+DEVELOP
 ER_ANIMA
@@ -762,30 +762,139 @@
 urn 
-isRegionChange
+reason == DEVELOPER_ANIMATION %7C%7C reason == SDK_ANIMATION;%0A    %7D%0A%0A    public boolean isAnimating() %7B%0A        return this.is
 Animat
-ed
+ing
 ;%0A  

Fix for Android change events