// Path: sample/src/main/java/com/yydcdut/note/utils/AppCompat.java
// public class AppCompat {
// 
//     public static int getColor(int id, Activity activity) {
//         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
//             return activity.getResources().getColor(id);
//         } else {
//             return activity.getResources().getColor(id, activity.getTheme());
//         }
//     }
// 
//     public static void setBackgroundDrawable(View view, Drawable drawable) {
//         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
//             view.setBackground(drawable);
//         } else {
//             view.setBackgroundDrawable(drawable);
//         }
//     }
// 
//     /**
//      * 5.0之后的SDK
//      */
//     public static final boolean AFTER_LOLLIPOP = afterLollipop();
// 
//     private static boolean afterLollipop() {
//         return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
//     }
// 
//     @TargetApi(Build.VERSION_CODES.LOLLIPOP)
//     public static void setElevation(View view, float elevation) {
//         if (AFTER_LOLLIPOP) {
//             view.setElevation(elevation);
//         }
//     }
// 
//     public static void setFullWindow(Window window) {
//         if (AppCompat.AFTER_LOLLIPOP) {
//             window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
//                     | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION | 128);
//         } else {
//             window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
//         }
//     }
// 
//     public static void setFullWindowWithoutNavigationBar(Window window, Context context) {
//         if (AppCompat.AFTER_LOLLIPOP && hasNavigationBar(context)) {
//             window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
//                     | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
//         }
//     }
// 
//     public static boolean hasNavigationBar(Context context) {
//         boolean hasNavigationBar = false;
//         Resources rs = context.getResources();
//         int id = rs.getIdentifier("config_showNavigationBar", "bool", "android");
//         if (id > 0) {
//             hasNavigationBar = rs.getBoolean(id);
//         }
//         try {
//             Class systemPropertiesClass = Class.forName("android.os.SystemProperties");
//             Method m = systemPropertiesClass.getMethod("get", String.class);
//             String navBarOverride = (String) m.invoke(systemPropertiesClass, "qemu.hw.mainkeys");
//             if ("1".equals(navBarOverride)) {
//                 hasNavigationBar = false;
//             } else if ("0".equals(navBarOverride)) {
//                 hasNavigationBar = true;
//             }
//         } catch (Exception e) {
//             YLog.wtf("AppCompat", e.getMessage());
//         }
//         return hasNavigationBar;
//     }
// 
//     public static int getNavigationBarHeight(Context context) {
//         int navigationBarHeight = 0;
//         Resources rs = context.getResources();
//         int id = rs.getIdentifier("navigation_bar_height", "dimen", "android");
//         if (id > 0 && hasNavigationBar(context)) {
//             navigationBarHeight = rs.getDimensionPixelSize(id);
//         }
//         return navigationBarHeight;
//     }
// 
// }


import android.app.Activity;
import android.content.Context;
import android.hardware.Camera;
import android.support.annotation.NonNull;
import com.yydcdut.note.R;
import com.yydcdut.note.camera.param.Size;
import com.yydcdut.note.injector.ContextLife;
import com.yydcdut.note.model.rx.RxUser;
import com.yydcdut.note.mvp.IView;
import com.yydcdut.note.mvp.p.setting.ISettingPresenter;
import com.yydcdut.note.mvp.v.setting.ISettingView;
import com.yydcdut.note.utils.AppCompat;
import com.yydcdut.note.utils.Const;
import com.yydcdut.note.utils.LocalStorageUtils;
import com.yydcdut.note.utils.PermissionUtils;
import com.yydcdut.note.utils.permission.Permission;
import org.json.JSONException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import javax.inject.Inject;
import rx.android.schedulers.AndroidSchedulers;
            mSettingView.showSnackbar(mContext.getString(R.string.toast_fail));
        }
    }

    @Override
    public boolean getCameraSystem() {
        return mLocalStorageUtils.getCameraSystem();
    }

    @Override
    public boolean getCameraSaveSetting() {
        return mLocalStorageUtils.getCameraSaveSetting();
    }

    @Override
    public boolean getCameraMirrorOpen() {
        return mLocalStorageUtils.getCameraMirrorOpen();
    }

    @Override
    public int getCameraNumber() {
        return mLocalStorageUtils.getCameraNumber();
    }

    @Override
    public boolean getSplashOpen() {
        return mLocalStorageUtils.getSplashOpen();
    }

    private void setStatusBarClickable() {
// Path: sample/src/main/java/com/yydcdut/note/utils/AppCompat.java
// public class AppCompat {
// 
//     public static int getColor(int id, Activity activity) {
//         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
//             return activity.getResources().getColor(id);
//         } else {
//             return activity.getResources().getColor(id, activity.getTheme());
//         }
//     }
// 
//     public static void setBackgroundDrawable(View view, Drawable drawable) {
//         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
//             view.setBackground(drawable);
//         } else {
//             view.setBackgroundDrawable(drawable);
//         }
//     }
// 
//     /**
//      * 5.0之后的SDK
//      */
//     public static final boolean AFTER_LOLLIPOP = afterLollipop();
// 
//     private static boolean afterLollipop() {
//         return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
//     }
// 
//     @TargetApi(Build.VERSION_CODES.LOLLIPOP)
//     public static void setElevation(View view, float elevation) {
//         if (AFTER_LOLLIPOP) {
//             view.setElevation(elevation);
//         }
//     }
// 
//     public static void setFullWindow(Window window) {
//         if (AppCompat.AFTER_LOLLIPOP) {
//             window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
//                     | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION | 128);
//         } else {
//             window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
//         }
//     }
// 
//     public static void setFullWindowWithoutNavigationBar(Window window, Context context) {
//         if (AppCompat.AFTER_LOLLIPOP && hasNavigationBar(context)) {
//             window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
//                     | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
//         }
//     }
// 
//     public static boolean hasNavigationBar(Context context) {
//         boolean hasNavigationBar = false;
//         Resources rs = context.getResources();
//         int id = rs.getIdentifier("config_showNavigationBar", "bool", "android");
//         if (id > 0) {
//             hasNavigationBar = rs.getBoolean(id);
//         }
//         try {
//             Class systemPropertiesClass = Class.forName("android.os.SystemProperties");
//             Method m = systemPropertiesClass.getMethod("get", String.class);
//             String navBarOverride = (String) m.invoke(systemPropertiesClass, "qemu.hw.mainkeys");
//             if ("1".equals(navBarOverride)) {
//                 hasNavigationBar = false;
//             } else if ("0".equals(navBarOverride)) {
//                 hasNavigationBar = true;
//             }
//         } catch (Exception e) {
//             YLog.wtf("AppCompat", e.getMessage());
//         }
//         return hasNavigationBar;
//     }
// 
//     public static int getNavigationBarHeight(Context context) {
//         int navigationBarHeight = 0;
//         Resources rs = context.getResources();
//         int id = rs.getIdentifier("navigation_bar_height", "dimen", "android");
//         if (id > 0 && hasNavigationBar(context)) {
//             navigationBarHeight = rs.getDimensionPixelSize(id);
//         }
//         return navigationBarHeight;
//     }
// 
// }


// Path: sample/src/main/java/com/yydcdut/note/mvp/p/setting/impl/SettingPresenterImpl.java
import android.app.Activity;
import android.content.Context;
import android.hardware.Camera;
import android.support.annotation.NonNull;
import com.yydcdut.note.R;
import com.yydcdut.note.camera.param.Size;
import com.yydcdut.note.injector.ContextLife;
import com.yydcdut.note.model.rx.RxUser;
import com.yydcdut.note.mvp.IView;
import com.yydcdut.note.mvp.p.setting.ISettingPresenter;
import com.yydcdut.note.mvp.v.setting.ISettingView;
import com.yydcdut.note.utils.AppCompat;
import com.yydcdut.note.utils.Const;
import com.yydcdut.note.utils.LocalStorageUtils;
import com.yydcdut.note.utils.PermissionUtils;
import com.yydcdut.note.utils.permission.Permission;
import org.json.JSONException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import javax.inject.Inject;
import rx.android.schedulers.AndroidSchedulers;

            mSettingView.showSnackbar(mContext.getString(R.string.toast_fail));
        }
    }

    @Override
    public boolean getCameraSystem() {
        return mLocalStorageUtils.getCameraSystem();
    }

    @Override
    public boolean getCameraSaveSetting() {
        return mLocalStorageUtils.getCameraSaveSetting();
    }

    @Override
    public boolean getCameraMirrorOpen() {
        return mLocalStorageUtils.getCameraMirrorOpen();
    }

    @Override
    public int getCameraNumber() {
        return mLocalStorageUtils.getCameraNumber();
    }

    @Override
    public boolean getSplashOpen() {
        return mLocalStorageUtils.getSplashOpen();
    }

    private void setStatusBarClickable() {
        if (!AppCompat.AFTER_LOLLIPOP) {