// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String PREFS_NAME = "MyPrefsFile";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final long TIME_DEFAULT = 0;
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TIME_LEARN_DOUBLE_KEY = "timeLearnDouble";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TIME_LEARN_SINGLE_KEY = "timeLearnSingle";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TIME_PRACTICE_DOUBLE_KEY = "timePracticeDouble";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TIME_PRACTICE_SINGLE_KEY = "timePracticeSingle";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TIME_TEST_DOUBLE_KEY = "timeTestDouble";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TIME_TEST_SINGLE_KEY = "timeTestSingle";


import android.content.Context;
import android.content.SharedPreferences;
import static android.content.Context.MODE_PRIVATE;
import static com.aepronunciation.ipa.MainActivity.PREFS_NAME;
import static com.aepronunciation.ipa.MainActivity.TIME_DEFAULT;
import static com.aepronunciation.ipa.MainActivity.TIME_LEARN_DOUBLE_KEY;
import static com.aepronunciation.ipa.MainActivity.TIME_LEARN_SINGLE_KEY;
import static com.aepronunciation.ipa.MainActivity.TIME_PRACTICE_DOUBLE_KEY;
import static com.aepronunciation.ipa.MainActivity.TIME_PRACTICE_SINGLE_KEY;
import static com.aepronunciation.ipa.MainActivity.TIME_TEST_DOUBLE_KEY;
import static com.aepronunciation.ipa.MainActivity.TIME_TEST_SINGLE_KEY;
        return instance;
    }

    public void start(Context context, StudyType type) {

        // no need to restart the timer for the same type
        if (this.studyType == type) {
            return;
        }

        // stop and record time for previous type (if any)
        stop(context);

        // start time for this type
        startTime = System.nanoTime();
        this.studyType = type;
    }

    void stop(Context context) {

        if (studyType == null) {
            return;
        }

        String key;
        switch (studyType) {
            case LearnSingle:
                key = TIME_LEARN_SINGLE_KEY;
                break;
            case LearnDouble:
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String PREFS_NAME = "MyPrefsFile";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final long TIME_DEFAULT = 0;
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TIME_LEARN_DOUBLE_KEY = "timeLearnDouble";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TIME_LEARN_SINGLE_KEY = "timeLearnSingle";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TIME_PRACTICE_DOUBLE_KEY = "timePracticeDouble";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TIME_PRACTICE_SINGLE_KEY = "timePracticeSingle";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TIME_TEST_DOUBLE_KEY = "timeTestDouble";
// 
// Path: app/src/main/java/com/aepronunciation/ipa/MainActivity.java
// public static final String TIME_TEST_SINGLE_KEY = "timeTestSingle";


// Path: app/src/main/java/com/aepronunciation/ipa/StudyTimer.java
import android.content.Context;
import android.content.SharedPreferences;
import static android.content.Context.MODE_PRIVATE;
import static com.aepronunciation.ipa.MainActivity.PREFS_NAME;
import static com.aepronunciation.ipa.MainActivity.TIME_DEFAULT;
import static com.aepronunciation.ipa.MainActivity.TIME_LEARN_DOUBLE_KEY;
import static com.aepronunciation.ipa.MainActivity.TIME_LEARN_SINGLE_KEY;
import static com.aepronunciation.ipa.MainActivity.TIME_PRACTICE_DOUBLE_KEY;
import static com.aepronunciation.ipa.MainActivity.TIME_PRACTICE_SINGLE_KEY;
import static com.aepronunciation.ipa.MainActivity.TIME_TEST_DOUBLE_KEY;
import static com.aepronunciation.ipa.MainActivity.TIME_TEST_SINGLE_KEY;

        return instance;
    }

    public void start(Context context, StudyType type) {

        // no need to restart the timer for the same type
        if (this.studyType == type) {
            return;
        }

        // stop and record time for previous type (if any)
        stop(context);

        // start time for this type
        startTime = System.nanoTime();
        this.studyType = type;
    }

    void stop(Context context) {

        if (studyType == null) {
            return;
        }

        String key;
        switch (studyType) {
            case LearnSingle:
                key = TIME_LEARN_SINGLE_KEY;
                break;
            case LearnDouble:
                key = TIME_LEARN_DOUBLE_KEY;