// Path: app/src/main/java/ca/rmen/android/scrumchatter/Constants.java
// public class Constants {
//     public static final String TAG = "ScrumChatter";
//     public static final String PREF_TEAM_ID = "team_id";
//     public static final int DEFAULT_TEAM_ID = 1;
//     public static final String DEFAULT_TEAM_NAME = "Team A";
// }
// 
// Path: app/src/main/java/ca/rmen/android/scrumchatter/util/Log.java
// @SuppressWarnings("unused")
// public class Log {
//     public static void v(String tag, String message) {
//         if (BuildConfig.DEBUG) android.util.Log.v(tag, message);
//     }
// 
//     public static void v(String tag, String message, Throwable t) {
//         if (BuildConfig.DEBUG) android.util.Log.v(tag, message, t);
//     }
// 
//     public static void d(String tag, String message) {
//         if (BuildConfig.DEBUG) android.util.Log.d(tag, message);
//     }
// 
//     public static void d(String tag, String message, Throwable t) {
//         if (BuildConfig.DEBUG) android.util.Log.d(tag, message, t);
//     }
// 
//     public static void i(String tag, String message) {
//         android.util.Log.i(tag, message);
//     }
// 
//     public static void i(String tag, String message, Throwable t) {
//         android.util.Log.i(tag, message, t);
//     }
// 
//     public static void w(String tag, String message) {
//         android.util.Log.w(tag, message);
//     }
// 
//     public static void w(String tag, String message, Throwable t) {
//         android.util.Log.w(tag, message, t);
//     }
// 
//     public static void e(String tag, String message) {
//         android.util.Log.e(tag, message);
//     }
// 
//     public static void e(String tag, String message, Throwable t) {
//         android.util.Log.e(tag, message, t);
//     }
// 
//     public static void wtf(String tag, String message) {
//         android.util.Log.wtf(tag, message);
//     }
// 
//     public static void wtf(String tag, String message, Throwable t) {
//         android.util.Log.wtf(tag, message, t);
//     }
// }
// 
// Path: app/src/main/java/ca/rmen/android/scrumchatter/util/StrictModeUtil.java
// public class StrictModeUtil {
//     private static final String TAG = Constants.TAG + "/" + StrictModeUtil.class.getName();
//     private StrictModeUtil() {
//         // prevent instantiation
//     }
// 
//     public static void enable() {
//         Log.v(TAG, "enable");
//         // Use strict mode for monkey tests.  We can't enable strict mode for normal use
//         // because, when sharing (exporting), the mail app may read the attachment in
//         // the main thread.
//         if (ActivityManager.isUserAMonkey()) {
//             StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().penaltyLog().penaltyDeath().build());
//         }
//     }
// 
//     public static void disable() {
//         Log.v(TAG, "disable");
//         StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().permitAll().build());
//     }
// 
// }


import android.content.Context;
import android.content.SharedPreferences;
import android.os.Looper;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import java.util.Map;
import ca.rmen.android.scrumchatter.Constants;
import ca.rmen.android.scrumchatter.util.Log;
import ca.rmen.android.scrumchatter.util.StrictModeUtil;
/*
 * Copyright 2017 Carmen Alvarez
 * <p/>
 * This file is part of Scrum Chatter.
 * <p/>
 * Scrum Chatter is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * <p/>
 * Scrum Chatter is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * <p/>
 * You should have received a copy of the GNU General Public License
 * along with Scrum Chatter. If not, see <http://www.gnu.org/licenses/>.
 */
package ca.rmen.android.scrumchatter.settings;




public final class Prefs {
    enum Theme {
        Dark,
        Light,
        Auto
    }

    static final String PREF_THEME = "PREF_THEME";
    private static final String TAG = Constants.TAG + "/" + Prefs.class.getSimpleName();

    private static Prefs INSTANCE;
    private final SharedPreferences mPrefs;

    private Prefs(Context context) {
        // We try to behave by not reading from the disk on the ui thread.  But one exception
        // we can allow is to read the shared prefs one time when this singleton is initialized
        boolean cheatIgnoreStrictModeViolations = Looper.getMainLooper().getThread() == Thread.currentThread();
        if (cheatIgnoreStrictModeViolations) StrictModeUtil.disable();
        mPrefs = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());
        Map<String, ?> allPrefs = mPrefs.getAll();
        Log.v(TAG, "Read prefs " + allPrefs);
// Path: app/src/main/java/ca/rmen/android/scrumchatter/Constants.java
// public class Constants {
//     public static final String TAG = "ScrumChatter";
//     public static final String PREF_TEAM_ID = "team_id";
//     public static final int DEFAULT_TEAM_ID = 1;
//     public static final String DEFAULT_TEAM_NAME = "Team A";
// }
// 
// Path: app/src/main/java/ca/rmen/android/scrumchatter/util/Log.java
// @SuppressWarnings("unused")
// public class Log {
//     public static void v(String tag, String message) {
//         if (BuildConfig.DEBUG) android.util.Log.v(tag, message);
//     }
// 
//     public static void v(String tag, String message, Throwable t) {
//         if (BuildConfig.DEBUG) android.util.Log.v(tag, message, t);
//     }
// 
//     public static void d(String tag, String message) {
//         if (BuildConfig.DEBUG) android.util.Log.d(tag, message);
//     }
// 
//     public static void d(String tag, String message, Throwable t) {
//         if (BuildConfig.DEBUG) android.util.Log.d(tag, message, t);
//     }
// 
//     public static void i(String tag, String message) {
//         android.util.Log.i(tag, message);
//     }
// 
//     public static void i(String tag, String message, Throwable t) {
//         android.util.Log.i(tag, message, t);
//     }
// 
//     public static void w(String tag, String message) {
//         android.util.Log.w(tag, message);
//     }
// 
//     public static void w(String tag, String message, Throwable t) {
//         android.util.Log.w(tag, message, t);
//     }
// 
//     public static void e(String tag, String message) {
//         android.util.Log.e(tag, message);
//     }
// 
//     public static void e(String tag, String message, Throwable t) {
//         android.util.Log.e(tag, message, t);
//     }
// 
//     public static void wtf(String tag, String message) {
//         android.util.Log.wtf(tag, message);
//     }
// 
//     public static void wtf(String tag, String message, Throwable t) {
//         android.util.Log.wtf(tag, message, t);
//     }
// }
// 
// Path: app/src/main/java/ca/rmen/android/scrumchatter/util/StrictModeUtil.java
// public class StrictModeUtil {
//     private static final String TAG = Constants.TAG + "/" + StrictModeUtil.class.getName();
//     private StrictModeUtil() {
//         // prevent instantiation
//     }
// 
//     public static void enable() {
//         Log.v(TAG, "enable");
//         // Use strict mode for monkey tests.  We can't enable strict mode for normal use
//         // because, when sharing (exporting), the mail app may read the attachment in
//         // the main thread.
//         if (ActivityManager.isUserAMonkey()) {
//             StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().penaltyLog().penaltyDeath().build());
//         }
//     }
// 
//     public static void disable() {
//         Log.v(TAG, "disable");
//         StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().permitAll().build());
//     }
// 
// }


// Path: app/src/main/java/ca/rmen/android/scrumchatter/settings/Prefs.java
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Looper;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import java.util.Map;
import ca.rmen.android.scrumchatter.Constants;
import ca.rmen.android.scrumchatter.util.Log;
import ca.rmen.android.scrumchatter.util.StrictModeUtil;

/*
 * Copyright 2017 Carmen Alvarez
 * <p/>
 * This file is part of Scrum Chatter.
 * <p/>
 * Scrum Chatter is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * <p/>
 * Scrum Chatter is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * <p/>
 * You should have received a copy of the GNU General Public License
 * along with Scrum Chatter. If not, see <http://www.gnu.org/licenses/>.
 */
package ca.rmen.android.scrumchatter.settings;




public final class Prefs {
    enum Theme {
        Dark,
        Light,
        Auto
    }

    static final String PREF_THEME = "PREF_THEME";
    private static final String TAG = Constants.TAG + "/" + Prefs.class.getSimpleName();

    private static Prefs INSTANCE;
    private final SharedPreferences mPrefs;

    private Prefs(Context context) {
        // We try to behave by not reading from the disk on the ui thread.  But one exception
        // we can allow is to read the shared prefs one time when this singleton is initialized
        boolean cheatIgnoreStrictModeViolations = Looper.getMainLooper().getThread() == Thread.currentThread();
        if (cheatIgnoreStrictModeViolations) StrictModeUtil.disable();
        mPrefs = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());
        Map<String, ?> allPrefs = mPrefs.getAll();
        Log.v(TAG, "Read prefs " + allPrefs);
        if (cheatIgnoreStrictModeViolations) StrictModeUtil.enable();