// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/data/objects/earthquake/EarthquakeObject.java
// public class EarthquakeObject {
// 
//     @SerializedName("type")
//     @Expose
//     private String type;
//     @SerializedName("metadata")
//     @Expose
//     private Metadata metadata;
//     @SerializedName("features")
//     @Expose
//     private List<Feature> features = new ArrayList<>();
//     @SerializedName("bbox")
//     @Expose
//     private List<Double> bbox = new ArrayList<>();
// 
//     public static final int NOTIFICATION_ID_1 = 2001;
//     public static final int NOTIFICATION_ID_2 = 2000;
// 
//     public static final int SORT_TIME = 1;
//     public static final int SORT_MAGNITUDE = 2;
//     public static final int SORT_DISTANCE = 3;
// 
//     public static final String NOTIFICATION_GROUP = "earthquake_group";
// 
//     /**
//      *
//      * @return
//      * The type
//      */
//     public String getType() {
//         return type;
//     }
// 
//     /**
//      *
//      * @param type
//      * The type
//      */
//     public void setType(String type) {
//         this.type = type;
//     }
// 
//     /**
//      *
//      * @return
//      * The metadata
//      */
//     public Metadata getMetadata() {
//         return metadata;
//     }
// 
//     /**
//      *
//      * @param metadata
//      * The metadata
//      */
//     public void setMetadata(Metadata metadata) {
//         this.metadata = metadata;
//     }
// 
//     /**
//      *
//      * @return
//      * The features
//      */
//     public List<Feature> getFeatures() {
//         return features;
//     }
// 
//     /**
//      *
//      * @param features
//      * The features
//      */
//     public void setFeatures(List<Feature> features) {
//         this.features = features;
//     }
// 
//     /**
//      *
//      * @return
//      * The bbox
//      */
//     public List<Double> getBbox() {
//         return bbox;
//     }
// 
//     /**
//      *
//      * @param bbox
//      * The bbox
//      */
//     public void setBbox(List<Double> bbox) {
//         this.bbox = bbox;
//     }
// 
// }


import android.animation.Animator;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Build;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.text.Spanned;
import android.text.format.DateUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewAnimationUtils;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import com.adkdevelopment.earthquakesurvival.R;
import com.adkdevelopment.earthquakesurvival.data.objects.earthquake.EarthquakeObject;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;
        if (result != ConnectionResult.SUCCESS) {
            if (GoogleApiAvailability.getInstance().isUserResolvableError(result)) {
                GoogleApiAvailability.getInstance().getErrorDialog(activity, result, 0).show();
            } else {
                Log.e(TAG, "checkPlayServices not available");
            }
            return false;
        }
        return true;
    }

    /**
     * Sets sorting preferences in SharedPreferences
     * @param context from which call is being made
     * @param sort preference according to the database schema
     */
    public static void setSortingPreference(Context context, int sort) {
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putInt(context.getString(R.string.sharedprefs_key_sort), sort);
        editor.apply();
    }

    /**
     * Returns sorting preference
     * @param context from which call is being made
     * @return int preference according to the database schema
     */
    public static int getSortingPreference(Context context) {
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/data/objects/earthquake/EarthquakeObject.java
// public class EarthquakeObject {
// 
//     @SerializedName("type")
//     @Expose
//     private String type;
//     @SerializedName("metadata")
//     @Expose
//     private Metadata metadata;
//     @SerializedName("features")
//     @Expose
//     private List<Feature> features = new ArrayList<>();
//     @SerializedName("bbox")
//     @Expose
//     private List<Double> bbox = new ArrayList<>();
// 
//     public static final int NOTIFICATION_ID_1 = 2001;
//     public static final int NOTIFICATION_ID_2 = 2000;
// 
//     public static final int SORT_TIME = 1;
//     public static final int SORT_MAGNITUDE = 2;
//     public static final int SORT_DISTANCE = 3;
// 
//     public static final String NOTIFICATION_GROUP = "earthquake_group";
// 
//     /**
//      *
//      * @return
//      * The type
//      */
//     public String getType() {
//         return type;
//     }
// 
//     /**
//      *
//      * @param type
//      * The type
//      */
//     public void setType(String type) {
//         this.type = type;
//     }
// 
//     /**
//      *
//      * @return
//      * The metadata
//      */
//     public Metadata getMetadata() {
//         return metadata;
//     }
// 
//     /**
//      *
//      * @param metadata
//      * The metadata
//      */
//     public void setMetadata(Metadata metadata) {
//         this.metadata = metadata;
//     }
// 
//     /**
//      *
//      * @return
//      * The features
//      */
//     public List<Feature> getFeatures() {
//         return features;
//     }
// 
//     /**
//      *
//      * @param features
//      * The features
//      */
//     public void setFeatures(List<Feature> features) {
//         this.features = features;
//     }
// 
//     /**
//      *
//      * @return
//      * The bbox
//      */
//     public List<Double> getBbox() {
//         return bbox;
//     }
// 
//     /**
//      *
//      * @param bbox
//      * The bbox
//      */
//     public void setBbox(List<Double> bbox) {
//         this.bbox = bbox;
//     }
// 
// }


// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/utils/Utilities.java
import android.animation.Animator;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Build;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.text.Spanned;
import android.text.format.DateUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewAnimationUtils;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import com.adkdevelopment.earthquakesurvival.R;
import com.adkdevelopment.earthquakesurvival.data.objects.earthquake.EarthquakeObject;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;

        if (result != ConnectionResult.SUCCESS) {
            if (GoogleApiAvailability.getInstance().isUserResolvableError(result)) {
                GoogleApiAvailability.getInstance().getErrorDialog(activity, result, 0).show();
            } else {
                Log.e(TAG, "checkPlayServices not available");
            }
            return false;
        }
        return true;
    }

    /**
     * Sets sorting preferences in SharedPreferences
     * @param context from which call is being made
     * @param sort preference according to the database schema
     */
    public static void setSortingPreference(Context context, int sort) {
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putInt(context.getString(R.string.sharedprefs_key_sort), sort);
        editor.apply();
    }

    /**
     * Returns sorting preference
     * @param context from which call is being made
     * @return int preference according to the database schema
     */
    public static int getSortingPreference(Context context) {
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
        return sharedPreferences.getInt(context.getString(R.string.sharedprefs_key_sort), EarthquakeObject.SORT_TIME);