// Path: app/src/main/java/com/mummyding/app/leisure/support/Settings.java
// public class Settings {
// 
//     public static  boolean needRecreate = false;
//     public static boolean isShakeMode = true;
//     public static boolean noPicMode = false;
//     public static boolean isNightMode = false;
//     public static boolean isAutoRefresh = false;
//     public static boolean isExitConfirm = true;
//     public static int searchID = 0;
//     public static int swipeID = 0;
// 
//     public static final String XML_NAME = "settings";
// 
//     public static final String SHAKE_TO_RETURN = "shake_to_return_new";
// 
//     public static final String NO_PIC_MODE = "no_pic_mode";
// 
//     public static final String NIGHT_MODE = "night_mode";
// 
//     public static final String AUTO_REFRESH = "auto_refresh";
// 
//     public static final String LANGUAGE = "language";
// 
//     public static final String EXIT_CONFIRM = "exit_confirm";
// 
//     public static final String CLEAR_CACHE = "clear_cache";
// 
//     public static final String SEARCH = "search";
// 
//     public static final String SWIPE_BACK = "swipe_back";
//     private static Settings sInstance;
// 
//     private SharedPreferences mPrefs;
// 
//     public static Settings getInstance() {
//         if (sInstance == null) {
//             sInstance = new Settings(LeisureApplication.AppContext);
//         }
//         return sInstance;
//     }
// 
//     private Settings(Context context) {
//         mPrefs = context.getSharedPreferences(XML_NAME, Context.MODE_PRIVATE);
//     }
// 
//     public Settings putBoolean(String key, boolean value) {
//         mPrefs.edit().putBoolean(key, value).commit();
//         return this;
//     }
// 
//     public boolean getBoolean(String key, boolean def) {
//         return mPrefs.getBoolean(key, def);
//     }
// 
//     public Settings putInt(String key, int value) {
//         mPrefs.edit().putInt(key, value).commit();
//         return this;
//     }
// 
//     public int getInt(String key, int defValue) {
//         return mPrefs.getInt(key, defValue);
//     }
// 
//     public Settings putString(String key, String value) {
//         mPrefs.edit().putString(key, value).commit();
//         return this;
//     }
// 
//     public String getString(String key, String defValue) {
//         return mPrefs.getString(key, defValue);
//     }
// 
// }


import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.animation.DecelerateInterpolator;
import android.widget.FrameLayout;
import com.mummyding.app.leisure.R;
import com.mummyding.app.leisure.support.Settings;
package com.mummyding.app.leisure.ui.support;




/**
 * 滑动关闭页面基类，使用时继承此类并使用BlankTheme主题即可
 */

/**
 * this file was written by @NashLegend {https://github.com/NashLegend}  -- MummyDing
 */
public class SwipeBackActivity extends AppCompatActivity {

    private SwipeLayout swipeLayout;

    /**
     * 是否可以滑动关闭页面
     */
    protected boolean swipeEnabled = true;

    /**
     * 是否可以在页面任意位置右滑关闭页面，如果是false则从左边滑才可以关闭。
     */
    protected boolean swipeAnyWhere = false;

    public SwipeBackActivity() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        swipeLayout = new SwipeLayout(this);

// Path: app/src/main/java/com/mummyding/app/leisure/support/Settings.java
// public class Settings {
// 
//     public static  boolean needRecreate = false;
//     public static boolean isShakeMode = true;
//     public static boolean noPicMode = false;
//     public static boolean isNightMode = false;
//     public static boolean isAutoRefresh = false;
//     public static boolean isExitConfirm = true;
//     public static int searchID = 0;
//     public static int swipeID = 0;
// 
//     public static final String XML_NAME = "settings";
// 
//     public static final String SHAKE_TO_RETURN = "shake_to_return_new";
// 
//     public static final String NO_PIC_MODE = "no_pic_mode";
// 
//     public static final String NIGHT_MODE = "night_mode";
// 
//     public static final String AUTO_REFRESH = "auto_refresh";
// 
//     public static final String LANGUAGE = "language";
// 
//     public static final String EXIT_CONFIRM = "exit_confirm";
// 
//     public static final String CLEAR_CACHE = "clear_cache";
// 
//     public static final String SEARCH = "search";
// 
//     public static final String SWIPE_BACK = "swipe_back";
//     private static Settings sInstance;
// 
//     private SharedPreferences mPrefs;
// 
//     public static Settings getInstance() {
//         if (sInstance == null) {
//             sInstance = new Settings(LeisureApplication.AppContext);
//         }
//         return sInstance;
//     }
// 
//     private Settings(Context context) {
//         mPrefs = context.getSharedPreferences(XML_NAME, Context.MODE_PRIVATE);
//     }
// 
//     public Settings putBoolean(String key, boolean value) {
//         mPrefs.edit().putBoolean(key, value).commit();
//         return this;
//     }
// 
//     public boolean getBoolean(String key, boolean def) {
//         return mPrefs.getBoolean(key, def);
//     }
// 
//     public Settings putInt(String key, int value) {
//         mPrefs.edit().putInt(key, value).commit();
//         return this;
//     }
// 
//     public int getInt(String key, int defValue) {
//         return mPrefs.getInt(key, defValue);
//     }
// 
//     public Settings putString(String key, String value) {
//         mPrefs.edit().putString(key, value).commit();
//         return this;
//     }
// 
//     public String getString(String key, String defValue) {
//         return mPrefs.getString(key, defValue);
//     }
// 
// }


// Path: app/src/main/java/com/mummyding/app/leisure/ui/support/SwipeBackActivity.java
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.animation.DecelerateInterpolator;
import android.widget.FrameLayout;
import com.mummyding.app.leisure.R;
import com.mummyding.app.leisure.support.Settings;

package com.mummyding.app.leisure.ui.support;




/**
 * 滑动关闭页面基类，使用时继承此类并使用BlankTheme主题即可
 */

/**
 * this file was written by @NashLegend {https://github.com/NashLegend}  -- MummyDing
 */
public class SwipeBackActivity extends AppCompatActivity {

    private SwipeLayout swipeLayout;

    /**
     * 是否可以滑动关闭页面
     */
    protected boolean swipeEnabled = true;

    /**
     * 是否可以在页面任意位置右滑关闭页面，如果是false则从左边滑才可以关闭。
     */
    protected boolean swipeAnyWhere = false;

    public SwipeBackActivity() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        swipeLayout = new SwipeLayout(this);

        Settings.swipeID = Settings.getInstance().getInt(Settings.SWIPE_BACK,0);