// Path: app/src/main/java/com/camnter/easygank/gank/GankApi.java
// public class GankApi {
//     public static final String GANK_HOME_PAGE_NAME = "干货集中营";
//     public static final String GANK_HOME_PAGE_URL = "http://gank.io/";
// 
//     public static final String BASE_URL = "http://gank.io/api/";
// 
//     public static final String DATA_TYPE_WELFARE = "福利";
//     public static final String DATA_TYPE_ANDROID = "Android";
//     public static final String DATA_TYPE_IOS = "iOS";
//     public static final String DATA_TYPE_REST_VIDEO = "休息视频";
//     public static final String DATA_TYPE_EXTEND_RESOURCES = "拓展资源";
//     public static final String DATA_TYPE_JS = "前端";
//     public static final String DATA_TYPE_APP = "App";
//     public static final String DATA_TYPE_RECOMMEND = "瞎推荐";
//     public static final String DATA_TYPE_ALL = "all";
// 
//     public static final int DEFAULT_DATA_SIZE = 10;
//     public static final int DEFAULT_DAILY_SIZE = 15;
// 
//     public static final String GANK_DATA_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
// }


import com.google.gson.GsonBuilder;
import com.orhanobut.logger.Logger;
import android.app.Application;
import android.content.Context;
import android.support.multidex.MultiDex;
import com.anupcowkur.reservoir.Reservoir;
import com.camnter.easygank.gank.GankApi;
import com.google.gson.Gson;
/*
 * {EasyGank}  Copyright (C) {2015}  {CaMnter}
 *
 * This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
 * This is free software, and you are welcome to redistribute it
 * under certain conditions; type `show c' for details.
 *
 * The hypothetical commands `show w' and `show c' should show the appropriate
 * parts of the General Public License.  Of course, your program's commands
 * might be different; for a GUI interface, you would use an "about box".
 *
 * You should also get your employer (if you work as a programmer) or school,
 * if any, to sign a "copyright disclaimer" for the program, if necessary.
 * For more information on this, and how to apply and follow the GNU GPL, see
 * <http://www.gnu.org/licenses/>.
 *
 * The GNU General Public License does not permit incorporating your program
 * into proprietary programs.  If your program is a subroutine library, you
 * may consider it more useful to permit linking proprietary applications with
 * the library.  If this is what you want to do, use the GNU Lesser General
 * Public License instead of this License.  But first, please read
 * <http://www.gnu.org/philosophy/why-not-lgpl.html>.
 */

package com.camnter.easygank;


/**
 * Description：EasyApplication
 * Created by：CaMnter
 * Time：2016-01-03 23:14
 */
public class EasyApplication extends Application {
    private static EasyApplication ourInstance = new EasyApplication();
    public boolean log = true;
    public Gson gson;

    public static final long ONE_KB = 1024L;
    public static final long ONE_MB = ONE_KB * 1024L;
    public static final long CACHE_DATA_MAX_SIZE = ONE_MB * 3L;


    public static EasyApplication getInstance() {
        return ourInstance;
    }


    @Override protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }


    @Override public void onCreate() {
        super.onCreate();
        ourInstance = this;
        Logger.init();
        this.initGson();
        this.initReservoir();
    }


    private void initGson() {
// Path: app/src/main/java/com/camnter/easygank/gank/GankApi.java
// public class GankApi {
//     public static final String GANK_HOME_PAGE_NAME = "干货集中营";
//     public static final String GANK_HOME_PAGE_URL = "http://gank.io/";
// 
//     public static final String BASE_URL = "http://gank.io/api/";
// 
//     public static final String DATA_TYPE_WELFARE = "福利";
//     public static final String DATA_TYPE_ANDROID = "Android";
//     public static final String DATA_TYPE_IOS = "iOS";
//     public static final String DATA_TYPE_REST_VIDEO = "休息视频";
//     public static final String DATA_TYPE_EXTEND_RESOURCES = "拓展资源";
//     public static final String DATA_TYPE_JS = "前端";
//     public static final String DATA_TYPE_APP = "App";
//     public static final String DATA_TYPE_RECOMMEND = "瞎推荐";
//     public static final String DATA_TYPE_ALL = "all";
// 
//     public static final int DEFAULT_DATA_SIZE = 10;
//     public static final int DEFAULT_DAILY_SIZE = 15;
// 
//     public static final String GANK_DATA_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
// }


// Path: app/src/main/java/com/camnter/easygank/EasyApplication.java
import com.google.gson.GsonBuilder;
import com.orhanobut.logger.Logger;
import android.app.Application;
import android.content.Context;
import android.support.multidex.MultiDex;
import com.anupcowkur.reservoir.Reservoir;
import com.camnter.easygank.gank.GankApi;
import com.google.gson.Gson;

/*
 * {EasyGank}  Copyright (C) {2015}  {CaMnter}
 *
 * This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
 * This is free software, and you are welcome to redistribute it
 * under certain conditions; type `show c' for details.
 *
 * The hypothetical commands `show w' and `show c' should show the appropriate
 * parts of the General Public License.  Of course, your program's commands
 * might be different; for a GUI interface, you would use an "about box".
 *
 * You should also get your employer (if you work as a programmer) or school,
 * if any, to sign a "copyright disclaimer" for the program, if necessary.
 * For more information on this, and how to apply and follow the GNU GPL, see
 * <http://www.gnu.org/licenses/>.
 *
 * The GNU General Public License does not permit incorporating your program
 * into proprietary programs.  If your program is a subroutine library, you
 * may consider it more useful to permit linking proprietary applications with
 * the library.  If this is what you want to do, use the GNU Lesser General
 * Public License instead of this License.  But first, please read
 * <http://www.gnu.org/philosophy/why-not-lgpl.html>.
 */

package com.camnter.easygank;


/**
 * Description：EasyApplication
 * Created by：CaMnter
 * Time：2016-01-03 23:14
 */
public class EasyApplication extends Application {
    private static EasyApplication ourInstance = new EasyApplication();
    public boolean log = true;
    public Gson gson;

    public static final long ONE_KB = 1024L;
    public static final long ONE_MB = ONE_KB * 1024L;
    public static final long CACHE_DATA_MAX_SIZE = ONE_MB * 3L;


    public static EasyApplication getInstance() {
        return ourInstance;
    }


    @Override protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }


    @Override public void onCreate() {
        super.onCreate();
        ourInstance = this;
        Logger.init();
        this.initGson();
        this.initReservoir();
    }


    private void initGson() {
        this.gson = new GsonBuilder().setDateFormat(GankApi.GANK_DATA_FORMAT).create();